On 1/4/12 13:33, "Tim Streater" <t...@clothears.org.uk> wrote:
>What I do seem to have is /etc/php.ini.default which I suppose you could
>rename to php.ini if you really wanted to modify it.
Yes, this is correct. I'm not sure if Apple started doing this with Lion
or before, but they give you the .default file to rename (or better, copy)
as php.ini if you desire. Note that the .default file isn't actually used
by PHP, but rather is merely intended to be used as a template.
Also, if I remember right, Apple sets up Apache so that each user has
his/her own config file inside the conf folder. You should make any config
changes, such as turning on PHP, in there, rather than in the primary
config file. The latter is subject to being overwritten on OS updates and
upgrades, while the former is not. Segregating your changes also makes it
easier to tell exactly what you've changed from the defaults.
>I'm however carefully ensuring that the client and server aspects of my
>app (which will both run on the user's machine) don't use anything except
>what comes with the standard OS X distribution, so to fix the date time
>issue I do:
> date_default_timezone_set (@date_default_timezone_get ());
I recommend against this. First of all, in PHP 5.4, this is just going to
return UTC if you haven't explicitly set the time zone, and that's
probably not what you want. Plus, the use of @ here leaves a nasty taste
in the mouth (as it does in most cases).
Instead, I suggest creating a php.ini file and changing this setting there
by setting it to a specific time zone. For example, in mine, I have this
date.timezone = 'America/Phoenix'
This ensures that PHP is always using the same zone no matter what script
is running, avoids PHP errors if you forget to make the change in a
script, avoids you having to modify all your scripts in the first place,
and lets you easily change the time zone used by your applications to
whatever you want independently of the server's own time zone (or in 5.4,
to something other than UTC).
Robert E. Williams, Jr.
Associate Vice President of Software Development
Newtek Businesss Services, Inc. -- The Small Business Authority
Notice: This communication, including attachments, may contain information that
is confidential. It constitutes non-public information intended to be conveyed
only to the designated recipient(s). If the reader or recipient of this
communication is not the intended recipient, an employee or agent of the
intended recipient who is responsible for delivering it to the intended
recipient, or if you believe that you have received this communication in
error, please notify the sender immediately by return e-mail and promptly
delete this e-mail, including attachments without reading or saving them in any
manner. The unauthorized use, dissemination, distribution, or reproduction of
this e-mail, including attachments, is prohibited and may be unlawful. If you
have received this email in error, please notify us immediately by e-mail or
telephone and delete the e-mail and the attachments (if any).
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php