php-general Digest 4 Nov 2011 13:35:15 -0000 Issue 7552

Topics (messages 315585 through 315592):

PHP 5.3.9RC1 Released for Testing
        315585 by: Johannes Schlüter

Writing out errors to a file
        315586 by: Rick Dwyer
        315587 by: Jim Giner
        315588 by: Adam Richardson
        315592 by: Daniel Brown

Re: Placing the masterpassword
        315589 by: tamouse mailing lists

What's the problem with this PHP code?
        315590 by: Sophia
        315591 by: shiplu

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
The first release candidates of 5.3.9 was just released for testing and
can be downloaded here:

http://downloads.php.net/johannes/php-5.3.9RC1.tar.bz2 (md5sum:
5e8564008606edfab6a81137c1daf354)

The windows binaries are available at: http://windows.php.net/qa/

This is the first step in the release process of this versions and goal
is having a 2nd RC two weeks from now. Majority of the changes are of
the "bug fix" variety. One important change is for bug #55475 [1] where
PHP 5.3.7 changed the behavior of is_a(). 5.3.9 will revert the
behavior. Please ensure that the release is solid and all things behave
as expected! Please test this RC against your code base and report any
problems you encounter or successful tests you've run.

Johannes Schlüter
PHP 5.3 Release Master

[1] https://bugs.php.net/bug.php?id=55475


--- End Message ---
--- Begin Message ---
Hello all.
How do I get PHP to write out any errors or warnings to a text file that I can review and go through to troubleshoot issues? I don't have access to the ini file... so I was hoping for a simple write to a file at the web root.

Thanks,


 --Rick



--- End Message ---
--- Begin Message ---
Try reading the manual on "set_error_handler".  I've never needed to do this 
kind of thing, but this sure looks like something that could do it. 
Basically, I'm imagining that it would open a file handle on some text file 
in some folder, then append a write of mysql_error() to that file and 
probably the line number and such and then close it. 



--- End Message ---
--- Begin Message ---
On Thu, Nov 3, 2011 at 9:04 PM, Jim Giner <jim.gi...@albanyhandball.com>wrote:

> Try reading the manual on "set_error_handler".  I've never needed to do
> this
> kind of thing, but this sure looks like something that could do it.
> Basically, I'm imagining that it would open a file handle on some text file
> in some folder, then append a write of mysql_error() to that file and
> probably the line number and such and then close it.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
The combination of set_error_handler() and within the handler using
error_log() works very well.

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
On Thu, Nov 3, 2011 at 19:55, Rick Dwyer <rpdw...@earthlink.net> wrote:
> Hello all.
> How do I get PHP to write out any errors or warnings to a text file that I
> can review and go through to troubleshoot issues?
> I don't have access to the ini file... so I was hoping for a simple write to
> a file at the web root.

    (NOTE: This reply presumes you're using *NIX or similar, with
hints to Apache.  You may need to make some adjustments.)

    Others gave you some great suggestions, but here's another tip:
you *do* have access to the ini file.  You just need to copy it into
your local folder and then you can modify it to your heart's content
(at long as your heart doesn't desire changing PHP_INI_SYSTEM values).
 See here:

        http://php.net/manual/en/ini.list.php

    So, for example, if your host maintains the php.ini file in
/etc/php.ini, simply copy it from there to your home directory.  You
will have privileges to read the file on the system, and your local
copy will then be owned by you, not the original owner, permitting its
modification.  Then, any allowable changes you make in the file will
be reflected in your site and all of its subfolders --- no need to
restart Apache.

    Don't want to have changes affect all of the subdirectories?  Just
move your local php.ini to the directory you want to be affected by
the change.  Wherever you place the file in your site structure, it
will affect that and all child directories.  So the home and
public_html (or www, et cetera) directories will affect the entire
site, while ~/public_html/admin/php.ini will have an effect on
~public_html/admin, ~public_html/admin/includes,
~public_html/admin/.private, and the like, but will *not* interfere
with ~/public_html, ~/public_html/customers, and so forth.  You can
have just one to tweak your site settings, or one in each and every
directory with different settings (which would be a nightmare, but
it's still possible).

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On Tue, Nov 1, 2011 at 8:24 AM, Florian Müller <florip...@hotmail.com> wrote:
>
> Hi all
> I got a little question about a good application design in PHP.
> If I use a mysql connection for example, I have to store my mysql-password 
> somewhere in the code. If it's just in the mysql-class, that's not that good, 
> because if somebody changes the functionality, he'd see it.
> I also can't store it in a text file. Until now, I just created a password 
> class where all the passwords are described and i can get them by a 
> get-function.
> Where are passwords stored in the big applications? There has to be at least 
> one big masterpassword somewhere - how can I store it safely? How is this 
> problem solved in big systems in production?
> Thanks for help ;) Regs, Flo.

As Alain and Jim have replied, storing the password in a file outside
the reach of the web server is important. I find it interesting to
hear you say you can't store the password in a text file but you seem
to be able to store it in a .php class -- which is also a file on the
system. In what way is this safer than than storing it in a text file
(unless you mean the text file was visible to the web server -- then I
understand).

In large production systems I've worked on, the passwords were
maintained by the IT support group, and you had to use special
functions to get them in your application that only they maintained
the interface to. This way, they could control who had access to what
databases for dev, test, stage and production. It also did generate a
bit of a bureaucracy for the company to maintain this, so it has to be
thought through rather carefully. (What happens when the IT people who
knew the passwords and access software leave, etc.)

For an application farm, having this in one place well-known to the
Ops, Dev, Test and Integration people is the best solution.

Using a single data base user and password for all applications is not
a bad thing as long as they're for the same domain/company, as long as
that fits their security needs/policies. I wouldn't use the same db
name & password for different clients' installations, however.

--- End Message ---
--- Begin Message ---
Here is the PHP code:


<?php


$panka = "   c:can-it-rock-
    :the-boat-of-
:love-  ";

$pankb = preg_split(':',$panka);
$pankc = $pankb{"1"};

echo "(" . $panka . ")\n(" . $pankc . ")\n";


?>






I keep getting the following error:

Sophia-Shapiras-MacBook-Pro:tmp red_angel$
Sophia-Shapiras-MacBook-Pro:tmp red_angel$ php testo.php

Warning: preg_split(): No ending delimiter ':' found in /Users/red_angel/tmp/testo.php on line 8
(   c:can-it-rock-
    :the-boat-of-
:love-  )
()
Sophia-Shapiras-MacBook-Pro:tmp red_angel$
Sophia-Shapiras-MacBook-Pro:tmp red_angel$




So --- what am I missing? What am I doing wrong? I'm pulling my hair out over this one! Anyone have a clue what's up? I can see that the colon is present *multiple* times in the string that is meant to be split! How come PHP's preg_split() function can't see it?

Thanks,
Sophia

--- End Message ---
--- Begin Message ---
On Fri, Nov 4, 2011 at 1:47 PM, Sophia <red_an...@techno-info.com> wrote:

> Here is the PHP code:
>
>
> <?php
>
>
> $panka = "   c:can-it-rock-
>    :the-boat-of-
> :love-  ";
>
> $pankb = preg_split(':',$panka);
>

It should be preg_split('/:/', $panka);



> $pankc = $pankb{"1"};
>
> echo "(" . $panka . ")\n(" . $pankc . ")\n";
>
>
> ?>
>
>
>
>
>
>
> I keep getting the following error:
>
> Sophia-Shapiras-MacBook-Pro:**tmp red_angel$
> Sophia-Shapiras-MacBook-Pro:**tmp red_angel$ php testo.php
>
> Warning: preg_split(): No ending delimiter ':' found in
> /Users/red_angel/tmp/testo.php on line 8
> (   c:can-it-rock-
>    :the-boat-of-
> :love-  )
> ()
> Sophia-Shapiras-MacBook-Pro:**tmp red_angel$
> Sophia-Shapiras-MacBook-Pro:**tmp red_angel$
>
>
>
>
> So --- what am I missing? What am I doing wrong? I'm pulling my hair out
> over this one! Anyone have a clue what's up? I can see that the colon is
> present *multiple* times in the string that is meant to be split! How come
> PHP's preg_split() function can't see it?
>
> Thanks,
> Sophia
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Shiplu Mokadd.im
Follow me, http://twitter.com/shiplu
Innovation distinguishes between follower and leader

--- End Message ---

Reply via email to