I tried compiling PHP 5.2 on CentOS but after so many tries I gave up. I was getting struck at compiling PHP with gd. And without gd it was useless. So I decided to yum and install the same.
By default if you use yum install php it will be install only php 4 series and not 5. In order to install version 5 I had to enable repo centosplus.
yum install php –enablerepo=centosplus
or
yum update php –enablerepo=centosplus
I came across another interesting repo for yum by kbsingh and after installing I was able to install a lot more. If you are interested please check out this website
Have fun !! 😉
thanks. that really worked!
i keep getting this error: Excluding packages in global exclude list
any one know why that is?
BTW this as of November 2007 only PHP 5.1.6 is included in the centosplus repository, not PHP 5.2
i am working with centos5. And I did not get any errors
this are the steps I used
# wget ftp://xmlsoft.org/libxml2/libxml2-2.6.11.tar.gz
# tar xzvf libxml2-2.6.11.tar.gz
# cd libxml2-2.6.11
# ./configure
# make
# su -c “make install”
# wget http://uk2.php.net/get/php-5.2.5.tar.gz/from/uk.php.net/mirror
# tar zxvf php-5.2.5.tar.gz
# cd php-5.2.5
# ./configure –enable-soap
# make
# su -c “make install”
I hope it helps u
it solved my problem.
i was configuring php before xml installing and the word enable-soap solved it.
Thanks for your guide. 😀
Thanks for the guide: I installed as per Joe said above, using the latest releases. Install seemed to go OK, but if I check phpinfo, it still says 5.1.6!
Any ideas please?
to Joe: why do you use ‘-enable-soap’ as the configure options? If you configure in this way, the upgrade will be really different as the CentOS 5’s default configure for php 5.1.6.
Thanks for this, it worked and my PHP version is upgraded but it’s still 5.1 not 5.2.
Any ideas how to get 5.2?
If you want to get PHP-5.2 on CentOS-5, you really should be looking at using the php-5.2 hosted in the c5-testing repository at the moment ( those packages will get moved into the CentOS-5 Plus repo in the next few weeks ) – but for the time being look at http://wiki.centos.org/Repositories for info on howto get the c5-testing repo setup on your machine and use the php-5.2 from there.
Hope this helps.
Well i found the problem with Joe’s way
php when you do make install moves all to /usr/local and httpd looks for php in /usr
for the copy/pasters (like myself)
there are two dashes (–) before eneablerepo=centosplus
yum update php –enablerepo=centosplus
http://www.atomicorp.com/wiki/index.php/PHP
upgrading php to 5.2 on centos 5
the most seamless way to the moment
fantastics! it’s really works on my vps!
thanks a lot!
Modified it a bit for the latest versions (as of 3/17/09)
# wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
# tar xzvf libxml2-2.7.3.tar.gz
# cd libxml2-2.7.3
# ./configure
# make
# su -c “make install”
# wget http://uk2.php.net/get/php-5.2.9.tar.gz/from/uk.php.net/mirror
# tar zxvf php-5.2.9.tar.gz
# cd php-5.2.9
# ./configure –enable-soap
# make
# su -c “make install”
Thanks Brent.
yeah! that works!!! thanks a lot!
@Brent: Do i need to uninstall the php that i installed by ‘Yum install php’? And which packages do I need to use the ‘make’ command?
@Stephan If you want to compile PHP you might have to install gcc and all its dependencies
yum install gcc gcc-c++ kernel-devel
If you want to compile you don’t have to uninstall it. You can compile php to another custom location in configure
./configure –prefix=/usr/local/php5.2.8
I have a Centos install that just keep giving “Error: Missing Dependency: php <= 4.4.0 is needed by package php-sqlite2” when i try to install ?? can anyone help me out ?
I figured it out it was caused by my Plesk install which holds a different Mysql server package … reinstalled Plesk PHP en Mysql al together and it works 🙂
@Brent
Bret,
I just ran a yum update php on a centos, it didnt update from 5.2.8 to 5.2.9, do I need to follow your instructions to do this? Any reason why it wouldnt just update?
# wget http://uk2.php.net/get/php-5.2.9.tar.gz/from/uk.php.net/mirror
# tar zxvf php-5.2.9.tar.gz
# cd php-5.2.9
# ./configure –enable-soap
# make
# su -c “make install”
Let me know
Jamie
@Jamie
Sorry Brent, not Bret.
any one help me how to install smarty in CentOS-5
please help me the command for install and uninstall of Smarty in CentOS-5
@Brent
to Brent: I followed what you did. However, the phpinfo still show old version.
@scoff
You da man. Thank you.
Hello,
I’m I have also re-compiled php and restarted the server. phpinfo still shows the old version??
on the command line show the correct version though
# php -v
PHP 5.2.10 (cli) (built: Sep 14 2009 06:51:48)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
anyone can help or shed some light pls.
Just try to logout, log in again. Worked for me!
Hi pachimon,
I too faced the same problem. command line shows it 5.2.4 while phpinfo() shows it as 5.2.9
I restarted apache many times and also logged out and logged in. But no luck.
were you able to fix it?
Thanks
Mike
tnx man 🙂
I used the method from http://www.atomicorp.com/wiki/index.php/PHP
to upgrade my php on centOS 5 to php version 5.2.12, it seems working fine, but a lot of modules are missing (exactly 4 from the error warning):
PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
[05-Feb-2010 11:12:14] PHP Warning: PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
[05-Feb-2010 11:12:14] PHP Warning: PHP Startup: memcache: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
[05-Feb-2010 11:12:14] PHP Warning: PHP Startup: mssql: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0