strange PHP behaviour after Apache upgrade in WHM


Well-Known Member
Mar 3, 2006
That goes back to the versions where php doesnt actually update. This has to do with your mysql version. Downgrade to mysql 4.0 or 4.1 then your php5.05 will install fine then revert back to your desired mysql. There are many other work-arounds but this is the simplest.


Aug 8, 2006
If you plan on upgrading mysql/php you wanna update mysql first by doing the following

log into WHM => Tweak Settings => MySQL = Choose version etc. => Save

Normally I like to wait around 10-15 minutes after hitting save then run

/scripts/perlinstaller --force Bundle::DBD::mysql
Not really optional, WHM is supposed to run this command when you hit save however there are some slight cases when it doesn't.

After that just recompile Apache with PHP5

if you're already at mysql5 and need to downgrade you might have to edit your /var/cpanel/cpanel.config

search for mysql-version=
Last edited:


Well-Known Member
May 27, 2006
Johannesburg, South Africa
cPanel Access Level
Root Administrator
running php -v via SSH, I get this:

[email protected] [~]# php -v
PHP 4.4.4 (cli) (built: Oct 18 2006 04:00:41)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.0.1, Copyright (c) 1998-2006, by Zend Technologies
[email protected] [~]# which php

And then, looking at the environment variables from the phpinfo() file:

Variable Value
PATH /usr/local/bin:/usr/bin:/bin
I have run the command you suggested, I updated to the latest RELEASE built, and then re-ran the Apache update, chooing PHP 5.0.5, which the phpinfo() page confirms, but not php -v in SSH, so I cannot install other stuff like eaccalerator, PHP JSON, PHP PECL Mailparse, etc.


Well-Known Member
Jan 6, 2004
New Jersey
cPanel Access Level
Root Administrator
I had this problem before on a development box, but can't remember exactly how I solved it. Do locate and find all binaries relating to php. Find the one that is truly php5 (run /usr/local/bin/php -v, /usr/bin/php -v, etc). Symlink all the others to that one that is truly php5. See how that works for you. It basically comes down to where shell is finding the php binary when you simply type "php -v". If your shell finds the old php4 binary in your path directory, it will run that first.

Back then I believe I actually cleaned off EVERYTHING relating to php then reinstalled. The recompiled apache and things came back in check.