Portal Home > Knowledgebase > Articles Database > Updated PHP to 5.3.13 today and i already have big problems...


Updated PHP to 5.3.13 today and i already have big problems...




Posted by minadreapta, 05-26-2012, 02:14 PM
Hi there, i have a Centos 5.8 server with WHM on it and last night i upgraded PHP through cPanel's easyapache script to 5.3.13. All seemed to be fine until a client told me he can't use some basic php functions, eg: getLocation(),timezone_location_get(). All the scripts using these functions are throwing an Internal Server Error (error 500). I tried to look in the logs but i couldn't find more than a generic "Premature end of script headers: filename.php". Does anyone have an idea about what is happening? Thanks. PHP 5 Handler is suphp on that server and suexec is ON. the kernel is 2.6.18-308.4.1.el5PAE suphp and suexec were also used before, prior to the upgrade to PHP 5.3.13 (upgraded from 5.3.10 where i didn't have this problem) Thanks.

Posted by minadreapta, 05-26-2012, 03:48 PM
i just checked and both the old 5.3.10 php.ini and the new 5.3.13 php.ini are identical. so is this a php issue or is it something else? please help. thanks.

Posted by quantumphysics, 05-26-2012, 03:53 PM
getLocation() is not a native php function..

Posted by minadreapta, 05-26-2012, 03:56 PM
http://www.php.net/datetimezone.getlocation look, the script i am trying to use is just this: and it outputs an error 500. and something i just checked: both the old 5.3.10 php.ini and the new 5.3.13 php.ini are identical.

Posted by quantumphysics, 05-26-2012, 03:57 PM
oh, that one check your error log, it should say what the 500 is?

Posted by minadreapta, 05-26-2012, 04:01 PM
var/log/messages - nothing dmesg - nothing suphp log - nothing only /etc/httpd/logs/error_log outputs something generic: "[Sat May 26 22:50:30 2012] [error] [client xx.xx.xx.xx] Premature end of script headers: test.php" that's all.

Posted by rcs, 05-26-2012, 04:23 PM
search in php.ini where is the php error log and look there.

Posted by minadreapta, 05-26-2012, 04:35 PM
well, from what i know, on a Centos/cPanel server the php log is at /etc/httpd/logs/error_log. i already looked in that file. if you have another suggestion please do tell.

Posted by rcs, 05-26-2012, 04:44 PM
I said look at php.ini because it might have a different file for the logs. You can also set error reporting level there and get more detailed output then you get now.

Posted by minadreapta, 05-26-2012, 04:53 PM
no, it doesn't have different file for the logs. it is default. i enabled display_errors in php configuration and still get only the "Premature end of script headers: test.php". i am kind of desperate here as i don't want to revert back to the 5.2.x branch as it is insecure.

Posted by rcs, 05-26-2012, 05:00 PM
play with the error_reporting variable and try to set more output.

Posted by minadreapta, 05-26-2012, 05:17 PM
i tried with E_ALL and E_ALL & ~E_NOTICE & ~E_DEPRECATED. display_errors = ON in php errors_to_browser=true in /opt/suphp/etc/suphp.conf nothing helps me in seeing more about this error. anyway, it is an error 500, "internal server error", i don't think it is meant to be detailed on the browser...

Posted by devonblzx, 05-26-2012, 05:28 PM
Use a PHP error log, not apache, it will give you more detailed info to diagnose: http://www.cyberciti.biz/tips/php-ho...-log-file.html

Posted by M Bacon, 05-26-2012, 05:34 PM
What does the output of this say? Does it display any errors? Is timezonedb and oauth installed in php pecl? Try reinstalling timezondb. & Do you have Silence Deprecated Patch This patch will remove E_DEPRECATED and E_USER_DEPRECATED from E_ALL Checked in easy apache? If that doesn't work, Contact cPanel. They will help you for sure.

Posted by minadreapta, 05-26-2012, 05:38 PM
ok, i added "error_log = /var/log/php-scripts.log" in php.ini and restarted apache. nothing is logged in /var/log/php-scripts.log thou

Posted by minadreapta, 05-26-2012, 05:43 PM
M Bacon root@server [/var/log]# service httpd status Apache Server Status for localhost Server Version: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 Server Built: May 25 2012 21:33:20 blab bla bla apache stuff here Total accesses: 2489 - Total Traffic: 55.8 MB CPU Usage: u.73 s1 cu60.08 cs0 - 22.8% CPU load 9.18 requests/sec - 211.0 kB/second - 23.0 kB/request 19 requests currently being processed, 4 idle workers bla bla bla bla apache stuff here now when i ran "pecl uninstall timezonedb" i got this: and then: in php.ini i have extension = "timezonedb.so" thou

Posted by M Bacon, 05-26-2012, 05:47 PM
I would run easy apache so that the timezonedb would be re-installed.

Posted by minadreapta, 05-26-2012, 05:49 PM
ok, thanks. i started easyapache and i hope it will work when it finishes.

Posted by M Bacon, 05-26-2012, 05:51 PM
Ok. You're Welcome. Also, make sure that something like this is in your php.ini.

Posted by minadreapta, 05-26-2012, 06:08 PM
well, it seems this didn;t work, easyapache finished but i still get that error. and i do have something like date.timezone = "Europe/Bucharest" in php.ini

Posted by M Bacon, 05-26-2012, 06:15 PM
I would contact cPanel then about it.

Posted by whmcsguru, 05-26-2012, 06:40 PM
cPanel has nothing to do with PHP Most likely this is just a fluke, happens more often than you think, which is why so many minor versions are released, to fix the flukes that the other ones released

Posted by Steven, 05-26-2012, 06:43 PM
In each account public_html, there would be error_log files if there was errors. No need to use that parameter..

Posted by M Bacon, 05-26-2012, 06:48 PM
It may have nothing to do with php but it should build everything with Easy Apache just fine and if the Easy Apache build fails to install minor things for your cPanel/WHM install. You should talk to them about it. They have Level 1 to 3 technicians. TimeZoneDb works on my server just fine. http://docs.cpanel.net/twiki/bin/vie...Log/EasyApache Implemented Case 58016: Make PHP use the system timezone database rather than the one built into PHP I have always asked cPanel about PHP Builds and they have fixed it for us.

Posted by minadreapta, 05-26-2012, 08:02 PM
thanks guys. i gave access to that server to cPanel and i am waiting to see if they cand solve it. i will post conclusions here later on.

Posted by M Bacon, 05-26-2012, 08:08 PM
Ok. You're Welcome.

Posted by minadreapta, 05-27-2012, 02:31 PM
ok: cPanel tech who first answered the ticket couldn't fix this. He escalated to Level 3 support. Jeff logged into the server but couldn't fix this. then i received an email from them: "I was able to reproduce this on one of our test beds and I'm escalating the issue now so that it can be better tracked down by a senior analyst and reported to our developers if they determine this is a bug with the new PHP version. It could be a little while until one of them gets into the office, but they will reply as soon as possible." so i think we should be patient. i will update you as soon as i get a solution to this.

Posted by minadreapta, 05-29-2012, 12:45 PM
the problem was solved by the cPanel guys. The cause of this issue seems to be related to "System Timezone" option (Use system timezone data in /usr/share/zoneinfo instead of PHP timezonedb)" being enabled in easyapache. Unchecking this option should allow your scripts to run without error. So, if you encountered this problem, run /scripts/easyapache and uncheck "System Timezone" option. Make sure the "Save my profile with appropriate PHP 5 options set so that it is compatible with cpphp" option is also unchecked, as it will prevent the first option to be unchecked. Have fun!

Posted by M Bacon, 06-06-2012, 11:27 PM
Sounds great. Thank you for posting the solution.

Posted by programguy, 06-06-2012, 11:31 PM
whcihc version did you upgrade from and is the old version correctly uninstalled and the proper dependencies removed or updated correctly?

Posted by minadreapta, 06-08-2012, 06:28 AM
we are using cPanel/WHM on all our servers. the upgrade is done via easyapache script so it's fully automated. there is not a question of removing the old version or the dependencies manually. it seems it doesn;t matter from what version you upgrade from, it's the latest easyapache script that has that issue, please read the solution that i posted.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Bandwidth Usage (Views: 464)