Join The San Francisco PHP Meetup Group

You'll get invited to our Meetups as soon as they're scheduled!

Re: [php-139] configure phpMyAdmin on PHP5, Leopard, timezone error, Apache2

From: Mariano Peterson
Sent on: Wednesday, March 18, 2009 3:43 PM
You have two php.ini files:
/etc/php.ini
/usr/local/php5/lib/php.ini

Your copy of PHP was compiled to first look for the configuration file in "/etc/php.ini".  This is indicated the phpinfo() output you posted, specifically the following config parameter:
'--with-config-file-path=/etc'

You can learn more about how PHP uses the configuration file, and where PHP looks for the file, in the PHP documentation here:
http://php.net/configuration.file

Entropy installs their PHP ini file in:
/usr/local/php/lib/php.ini
(See "Where is the php.ini file here?" on this page:  http://www.entropy.ch/software/macosx/php/ )

Somehow you ended up with another INI file in:
/etc/php.ini

The "correct" config file is probably whichever one you were using *before* the upgrade that caused your errors.  To get PHP to use the desired file, just move the incorrect config file to a backup folder so that PHP won't scan it, and so that you can revert later if realize you need it after all.

Did you install Zend Studio recently? The Zend Studio installer has clobbered my PHP binary and libphp5.so files a few times. When that happened I had to reinstall the copy of PHP that I wanted.

BTW, I usually backup my configure parameters (save my configure command as a text file) and php.ini.

Good luck!
Mariano




On Mar 18, 2009, at 1:03 PM, Robert Gonzalez wrote:

Does that php.ini include the mcrypt extension? Sounds like your install is totally knackered. Can you start over again at all?

On Wed, Mar 18, 2009 at 12:46 PM, Janis Rough <[address removed]> wrote:

Changing the php.ini to the /etc/php.ini did however get rid of the timezone error message so I could configure phpmyadmin.
 
Janis L. Rough



From: Robert Gonzalez <[address removed]>
To: [address removed]
Sent: Tuesday, March 17, 2009 10:30:56 PM
Subject: Re: [php-139] configure phpMyAdmin on PHP5, Leopard, timezone error, Apache2

Edit the file that is being consumed by PHP as shown in the php.ini directive when you run phpinfo(). Also note that you could have two different INI files being parsed, one for CLI and one for SAPI. To see your CLI ini file, at the command, type:

php -i

You might want to pipe that through less to keep the output manageable.

On Tue, Mar 17, 2009 at 10:37 PM, Janis Rough <[address removed]> wrote:

This is exciting!  I looked at php_info()  and the php.ini looks like it is pointing to /etc
I don't know how it got there but assume it is from Leopard install and Apache2 is in that /etc directory
also which is why I did the Leopard install.
The entropy PHP5 install php.ini is in /usr/local/php5/lib
Which one should I use and how do I get it to use one or the other?
I am really happy, :-)
Thanks ,


diff php.ini.default /usr/local/php5/lib/php.ini
(snip)
> ; Xdebug config for MacOSX and Netbeans IDE
> zend_extension_debug="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
> xdebug.remote_enable=1
> xdebug.remote_handler=dbgp
> xdebug.remote_mode=req
> xdebug.remote_host=127.0.0.1
> xdebug.remote_port=9000
> xdebug.idekey=
(snip)
> date.timezone = America/Los_Angeles
(snip)

Janis L. Rough




From: Robert Gonzalez <[address removed]>
To: [address removed]
Sent: Tuesday, March 17, 2009 7:34:27 PM
Subject: Re: [php-139] configure phpMyAdmin on PHP5, Leopard, timezone error, Apache2

Are you sure you are editing the right php.ini file? Run your phpinfo() script again and see what the php.ini file is?

On Tue, Mar 17, 2009 at 7:14 PM, Janis Rough <[address removed]> wrote:
Nick & Nick et al
 I took out everything ex
Janis L. Rough
I now have only


date.timezone = America/Los_Angeles

I restarted and got the same error.  I looked in the config folder in phpMyADmin.  A config.php file didn't get saved.
I even deleted the server and started over with the setup.  The folder is system Read and Write, and Everyone read & write
and Wheel is Read only. 

Below are all the errors:

It has been a problem.

Thanks,
-Janis
-------------------

Runtime Notice in ./libraries/common.inc.php#281
date_default_timezone_get() [function.date-default-timezone-get]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead

...<SNIP BACKTRACE>...

From: Nick Wilson <[address removed]>
To: [address removed]
Sent: Tuesday, March 17, 2009 5:04:48 PM

Subject: Re: [php-139] configure phpMyAdmin on PHP5, Leopard, timezone error, Apache2

Just to be sure we are on the same page, your timezone line should be:

date.timezone = America/Los_Angeles

It shouldn't have anything else after America/Los_Angeles and it
shouldn't be in quotes.


On Tue, Mar 17, 2009 at 5:00 PM, Janis Rough <
[address removed]> wrote:
> I first removed the quotes around 'America/Los_Angeles' and got the same
> error.
> then I also removed the quotes around the for 'PDT/-7.0/DST' also.  It still
> gives the timezone error.
> It is strange, it must be something simple since PHP5 is loaded.
> Thanks,
>
>
> ________________________________
> From: Nick Wilson <
[address removed]>
> To:
[address removed]
> Sent: Tuesday, March 17, 2009 4:17:53 PM
> Subject: Re: [php-139] configure phpMyAdmin on PHP5, Leopard, timezone
> error, Apache2
>
> Remove the quotes around the timezone in php.ini
>
> On Tue, Mar 17, 2009 at 4:12 PM, Chris Brand <
[address removed]> wrote:
>> I find this to be the best solution for getting a lamp stack on a leopard
>> machine.
>>
>>
http://www.mamp.info/en/index.html
>>
>> Christopher Brand
>> Phone: [masked]
>> Blog:
http://www.NikonWindow.com
>>
>>
>> On Tue, Mar 17, 2009 at 4:00 PM, Janis Rough <
[address removed]> wrote:
>>>
>>> I hope someone can help me.
>>> I upgraded to Leopard.
>>> I installed the latest version of PHP5 for Intel/ppc Macs.
>>> I can't configure phpMyADmin using setup.
>>> There is this pesky timezone error.
>>> Someone said that is because Apache2 doesn't know where to pull up the
>>> php5 module and so it is accessing php4 instead and that is why there is
>>> a
>>> timezone error from php4.  I don't think this is correct.  I have the two
>>> references to php4 commented out in httpd.conf:
>>> #LoadModule php4_module    libexec/httpd/libphp4.so
>>> #AddModule mod_php4.c
>>>
>>> Also in php.ini  I have the timezone set:
>>> date.timezone = 'America/Los_Angeles' for 'PDT/-7.0/DST'
>>>
>>> So why am I even getting a time zone error?  Can you see anything in my
>>> php_info() below that might give a clue?
>>>
>>> I notice that entropy build has a directive to load the php5 module and
>>> the
libphp5.so is in
>>> /usr/local/php5/libphp5.so,  so all should be well.  Besides I am getting
>>> php 5.2.6 in php_info:
>>> --------------entropy directive-----
>>>
>>> LoadModule php5_module        /usr/local/php5/libphp5.so
>>>
>>> <IfDefine APACHE1>
>>> AddModule mod_php5.c
>>> </IfDefine>
>>>
>>> <IfModule mod_php5.c>
>>>
>>>     AddType application/x-httpd-php .php
>>>     AddType application/x-httpd-php-source .phps
>>>
>>>     <IfModule mod_dir.c>
>>>         DirectoryIndex index.html index.php
>>>     </IfModule>
>>>
>>> </IfModule>
>>> "entropy-php.conf" 26L, 493C
>>> -----------------------------------
>>> But it seems to me this directive is working because I am getting
>>> php5.2.6
>>> in php_info()
>>> So how can I get rid of this pesky time zone error so I can use
>>> phpMyAdmin?
>>> Thanks and Regards,
>>> --Janis
>>>  -----php_info()-------------
>>>
>>> System Darwin J-Rs-Computer 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24
>>> 17:39:01 PST 2008; root:xnu-1228.9.59~1/RELEASE_PPC Power Macintosh
>>> Build Date Sep 19 2008 11:23:02
>>> Configure Command
>>> '/SourceCache/apache_mod_php/apache_mod_php-44.1/php/configure'
>>> '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info'
>>> '--disable-dependency-tracking' '--with-apxs2=/usr/sbin/apxs'
>>> '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli'
>>> '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif'
>>> '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx'
>>> '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr'
>>> '--with-config-file-path=/etc' '--sysconfdir=/private/etc'
>>> '--with-mysql-sock=/var/mysql' '--with-mysqli=/usr/bin/mysql_config'
>>> '--with-mysql=/usr' '--with-openssl' '--with-xmlrpc' '--with-xsl=/usr'
>>> '--without-pear'