Re: [PHP] date.timezone set and still getting strict warnings.

2011-06-14 Thread Tamara Temple


On Jun 13, 2011, at 4:17 PM, Daniel Brown wrote:

On Mon, Jun 13, 2011 at 16:25, Tamara Temple  
tamouse.li...@gmail.com wrote:

I have date.timezone set, as shown in the phpinfo() output:

portfolio:Downloads tamara$ php -r 'phpinfo();' | grep 'timezone'
Default timezone = America/Chicago
date.timezone = 'America/Chicago' = 'America/Chicago'


   That's the CLI version of PHP

Yet, when I call a function like strtotime(), i still get the  
Strict warning
about not having date.timezone set. (Yes, I have restarted the  
server,
twice, and the correct value shows up if I invoke phpinfo() via the  
server.)


    and you're referencing the web version here.


Any clues?


   Check the web version of PHP's phpinfo() output and see if it and
the CLI are using the same php.ini file.  My guess is that they're
not, and - while the CLI one is set with the timezone - its web
counterpart is missing the flag.


Ok, first off, are you telling me the CLI and the Web versions  
reference different php.ini files? I thought they both used /etc/ 
php.ini...


Secondly, I *did* check the output of phpinfo() from the web with the  
exact same results.


Now, the problem is...

   I surrounded the date.timezone setting with single quotes.

So, removing the quotes got me what I needed.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date.timezone set and still getting strict warnings.

2011-06-14 Thread Shawn McKenzie
On 06/14/2011 09:35 AM, Tamara Temple wrote:
 
 On Jun 13, 2011, at 4:17 PM, Daniel Brown wrote:
 
 On Mon, Jun 13, 2011 at 16:25, Tamara Temple tamouse.li...@gmail.com
 wrote:
 I have date.timezone set, as shown in the phpinfo() output:

 portfolio:Downloads tamara$ php -r 'phpinfo();' | grep 'timezone'
 Default timezone = America/Chicago
 date.timezone = 'America/Chicago' = 'America/Chicago'

That's the CLI version of PHP

 Yet, when I call a function like strtotime(), i still get the Strict
 warning
 about not having date.timezone set. (Yes, I have restarted the server,
 twice, and the correct value shows up if I invoke phpinfo() via the
 server.)

 and you're referencing the web version here.

 Any clues?

Check the web version of PHP's phpinfo() output and see if it and
 the CLI are using the same php.ini file.  My guess is that they're
 not, and - while the CLI one is set with the timezone - its web
 counterpart is missing the flag.
 
 Ok, first off, are you telling me the CLI and the Web versions reference
 different php.ini files? I thought they both used /etc/php.ini...
 
 Secondly, I *did* check the output of phpinfo() from the web with the
 exact same results.
 
 Now, the problem is...
 
I surrounded the date.timezone setting with single quotes.
 
 So, removing the quotes got me what I needed.
 

Glad you got it fixed.  Many distros do it differently.  Windows
normally has one php.ini, Ubuntu and derivatives have 2.  Other will
vary.  Here's mine:

/etc/php5/apache2/php.ini
/etc/php5/cli/php.ini

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date.timezone set and still getting strict warnings.

2011-06-14 Thread Daniel Brown
On Tue, Jun 14, 2011 at 10:35, Tamara Temple tamouse.li...@gmail.com wrote:

 Ok, first off, are you telling me the CLI and the Web versions reference
 different php.ini files? I thought they both used /etc/php.ini...

Depends on the compile-time arguments and such.  You can also have
local php.ini files (as in, under your public_html/ directory, et al).
 Some installs even scan those familiar '.d' directories for *.ini.
So, for example: /etc/php.d/*.ini .

 Secondly, I *did* check the output of phpinfo() from the web with the exact
 same results.

 Now, the problem is...

       I surrounded the date.timezone setting with single quotes.

 So, removing the quotes got me what I needed.

That'll do it, too.  ;-P

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] date.timezone set and still getting strict warnings.

2011-06-13 Thread Daniel Brown
On Mon, Jun 13, 2011 at 16:25, Tamara Temple tamouse.li...@gmail.com wrote:
 I have date.timezone set, as shown in the phpinfo() output:

 portfolio:Downloads tamara$ php -r 'phpinfo();' | grep 'timezone'
 Default timezone = America/Chicago
 date.timezone = 'America/Chicago' = 'America/Chicago'

That's the CLI version of PHP

 Yet, when I call a function like strtotime(), i still get the Strict warning
 about not having date.timezone set. (Yes, I have restarted the server,
 twice, and the correct value shows up if I invoke phpinfo() via the server.)

 and you're referencing the web version here.

 Any clues?

Check the web version of PHP's phpinfo() output and see if it and
the CLI are using the same php.ini file.  My guess is that they're
not, and - while the CLI one is set with the timezone - its web
counterpart is missing the flag.

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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php