http://www.webtatic.com/blog/2009/06/php-530-on-centos-5/
PHP 5.3 on CentOS 5
Posted 20th June 2009 by Andrew Thompson | 63 Comments
My previous articles on installing PHP on CentOS dealt with installing PHP 5.2.6. I have found this to have some bugs that kill the process without error information. One bug I found, which was on an x86_64 server, was that converting an object to a string did this.
So, I have compiled the latest PHP version, 5.2.10 5.3.0, and put it in my own repository for easy installation. I have compiled it for CentOS 5 i386 and x86_64, and provided the source RPMS in the repo, if anyone wants to compile it for another OS or architecture.
Update 2009-07-03 – I updated the version to PHP 5.3, which was released a few days before. This includes many new features such as closures, namespaces, and packaged scripts in phar files, which I’ll blog about soon. Check out PHP changelog for more details.
Update 2009-09-01 – Added a note about deprecated errors, and how to silence them. Also I have included a tip that might help those of you struggling to install.
I have also included the same php extensions I mentioned in my other article, php-mcrypt, php-mhash, php-mssql and php-tidy
To install, first you must tell rpm to accept rpm’s signed by me:
rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
Then add the yum repository information to yum:
cd /etc/yum.repos.d/
wget http://repo.webtatic.com/yum/webtatic.repo
Now you can install php by doing:
yum --enablerepo=webtatic install php
Or update an existing installation of php, which will also update all of the other php modules installed:
yum --enablerepo=webtatic update php
If this does not work correctly, try disabling all other repositories while installing/updating, by adding the –disablerepo=* option. This will stop other dependencies from being installed, so you may want to install them first.
yum --disablerepo=* --enablerepo=webtatic update php
Deprecated Errors
Once you are running the new version, you may get “deprecated” errors in your error logs. This isn’t bad, it just means to tell you that some of the functions you are using are no longer prefered, and may be removed in a future major release. An example of this is the ereg functions. Preg functions are prefered over these, as they are much faster and more powerful, and in all cases do at least the same thing.
If upgrading the functions are not an option, and you would like to hide the deprecated errors from your error log, for example on a production server, just edit your /etc/php.ini file, find the line:
error_reporting = E_ALL
and replace to:
error_reporting = E_ALL & ~E_DEPRECATED
PHP 5.2.10
I am also maintaining a PHP 5.2.10 release, so should you prefer to install that (for reasons like incompatibilities or testing), you can force it to install that instead by doing:
yum --enablerepo=webtatic --exclude=php*5.3* update php
Or you can add to the /etc/yum.repos.d/webtatic.repo the line:
exclude=php*5.3*
Related Posts
* Installing PHP 5.2.6 on CentOS 5 – extra extensions
* Installing PHP 5.2.6 on CentOS 5
* Git 1.6.4 on CentOS 5
* Get an “A” in YSlow with Webtatic Optimizer
* PHP public key cryptography using OpenSSL
* Generating a random PHP identifier
This entry was posted on at 10:13 am and is filed under Server Admin, Software using CentOS, PHP as tag(s). You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
« mod_auth_mysql digest authentication patch
PHP public key cryptography using OpenSSL »
63 Responses to “PHP 5.3 on CentOS 5”
1.
Matt says:
21st June 2009 at 3:32 pm
Thanks for this!
Reply
2.
Andy says:
23rd June 2009 at 12:04 pm
Noticed Fedora 11 has a version of php 5.2.9, so I built a new version based on that (a few modifications were needed for CentOS), and put it in the repo.
This version has the additional patches that Fedora added, and comes in a single source RPM. There are a few additonal RPMs as well, such as a ZTS (Zend Thread Safety) compilation which will work better on Httpd Worker mpm.
Reply
3.
iNoize says:
25th June 2009 at 1:48 pm
Hmm got some Trouble
php-gd-5.2.10-4.x86_64 from webtatic has depsolving problems
–> Missing Dependency: libt1.so.5()(64bit) is needed by package php-gd-5.2.10-4.x86_64 (webtatic)
Error: Missing Dependency: libt1.so.5()(64bit) is needed by package php-gd-5.2.10-4.x86_64 (webtatic)
Reply
4.
Aurelian says:
30th June 2009 at 2:16 pm
–> Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-4.i386 (webtatic)
Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-4.i386 (webtatic)
Why do i get this error?! I have installed CENTOS using
http://www.howtoforge.com/perfect-server-centos-5.3-i386-ispconfig-2
As tutorial. I’m complete newbie in LINUX. Please guide me through this.
Reply
5.
Andy says:
30th June 2009 at 10:42 pm
Sorry, it appears to be a rpm dependency that was missing in Fedora’s spec file I used. I’ve compiled new i386 and x64 binaries that have the correct dependencies, so you should just be able to attempt again and it’ll work.
I’ll try mentioning it to them, as it must be an issue on Fedora as well. The base install may include the package or something though.
Reply
6.
Joseph says:
3rd July 2009 at 9:14 am
First off, thanks for providing these packages! I’ve just installed PHP 5.3.0 on CentOS 5.3 and it is working great!
However, when trying to install php-gd I get an error similar to what Aurelian is reporting above:
php-gd-5.3.0-1.i386 from webtatic has depsolving problems
–> Missing Dependency: libt1.so.5 is needed by package php-gd-5.3.0-1.i386 (webtatic)
php-gd-5.3.0-1.i386 from webtatic has depsolving problems
–> Missing Dependency: t1lib is needed by package php-gd-5.3.0-1.i386 (webtatic)
Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.3.0-1.i386 (webtatic)
Error: Missing Dependency: t1lib is needed by package php-gd-5.3.0-1.i386 (webtatic)
Any ideas?
Reply
7.
Andy says:
3rd July 2009 at 12:07 pm
right, figured out the problem, t1lib was part of rpmforge’s repository (I always set that one up as it has a few extra packages I use)
I’ve removed the t1lib dependency and recompiled a new version of 5.3.0, so you can install/update to that and it should work fine.
Reply
*
Joseph says:
3rd July 2009 at 4:21 pm
Awesome! Works now. Thanks so much for your work.
8.
Hamid says:
25th July 2009 at 6:23 pm
Andy, thanks for providing help and yum sources. However, after doing “yum –enablerepo=webtatic update php”, I get:
–> Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
I am doing this on CentOS 5.2 64-bit for PHP 5.3 although I would be happy with PHP 5.2.10. Is your solution expected to work for me?
Reply
*
Andy says:
25th July 2009 at 6:27 pm
Hi Hamid,
PHP 5.3 actually contains the fileinfo extension as part of its default extensions.
You can remove the pecl extension and the rpms will install the fileinfo extension as part of the base php-common package.
*
Hamid says:
25th July 2009 at 8:53 pm
Hi Andy. Thanks for the guidance. I did:
yum remove php-pecl-Fileinfo.x86_64
ran PHP 5.3’s ./configure, make, make test & make install. php -v gives tons of errors relating to shared extensions written to /usr/lib/20090626 instead of the 64-bit one defined in /usr/lib64/php/modules.
Is there any hope in building PHP 5.3.0 on Centos 5.2-64?
*
Andy says:
25th July 2009 at 8:58 pm
sorry I don’t understand why you are building PHP 5.3? The repo contains that version, so you don’t need to compile.
9.
Hamid says:
26th July 2009 at 2:00 am
Andy, I have tried yum upgrade php.x86_64 & yum update php.x86_64 to no avail. Also, I tried yum upgrade of most other php packages installed:
php.x86_64
php-cli.x86_64
php-common.x86_64
php-dba.x86_64
php-devel.x86_64
php-gd.x86_64
php-imap.x86_64
php-ldap.x86_64
php-mbstring.x86_64
php-mysql.x86_64
php-odbc.x86_64
php-pdo.x86_64
php-pear.noarch
php-pear-DB.noarch
php-pear-Date.noarch
php-pecl-Fileinfo.x86_64
php-tidy.x86_64
php-xml.x86_64
which result in “No Packages marked for Update”.
I have your repo in my repo list. Can you point me in the right direction?
Many thanks, Andy.
Reply
10.
Andy says:
26th July 2009 at 9:31 am
hmm, my .repo file seems to act funny with the source repo definition in. I’ve deleted that part, so if you re-download it, yum should work better.
all you should have to do is:
yum –enablerepo=webtatic update php
Reply
11.
Hamid says:
26th July 2009 at 5:57 pm
Andy, now it’s at least trying:
#yum –enablerepo=webtatic update php
…
–> Processing Dependency: php-api = 20041225 for package: php-pecl-Fileinfo
–> Processing Dependency: php-api = 20041225 for package: php-pecl-memcache
–> Finished Dependency Resolution
php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 from installed has depsolving problems
–> Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
php-pecl-memcache-2.2.3-1.el5_2.x86_64 from installed has depsolving problems
–> Missing Dependency: php-api = 20041225 is needed by package php-pecl-memcache-2.2.3-1.el5_2.x86_64 (installed)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-memcache-2.2.3-1.el5_2.x86_64 (installed)
Error: Missing Dependency: php-api = 20041225 is needed by package php-pecl-Fileinfo-1.0.4-3.el5.centos.x86_64 (installed)
except that I already have php-pecl-memcache installed:
# yum install php-pecl-memcache.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: http://www.cyberuse.com
* updates: mirror.anl.gov
* addons: mirror.raystedman.net
* extras: http://www.cyberuse.com
Setting up Install Process
Parsing package install arguments
Package php-pecl-memcache-2.2.3-1.el5_2.x86_64 already installed and latest version
Nothing to do
I don’t even see your repo in the list.
Reply
*
Andy says:
26th July 2009 at 11:02 pm
Sorry Hamid, I haven’t built any of CentOS’s php-pecl-* packages with PHP 5.3.
It probably would be a good idea to, so I’ll try and sort that out soon, but in the meantime the only alternative is to uninstall all of them and “pecl install memcache” yourself. Fileinfo is already contained in the php packages, so you wont need to manually compile that.
*
Hamid says:
26th July 2009 at 11:31 pm
Thank you kindly Andy.
12.
Chip says:
29th July 2009 at 2:58 am
Thanks a ton, Andy! This was a huge help.
Reply
13.
Klaus says:
29th July 2009 at 10:13 pm
Great work! Thanks for the great packages, Andy. Really appreciated.
Any chance you can provide a package with curl? Thanks! :)
Reply
14.
TonyG says:
30th July 2009 at 4:23 am
My current php version is “5.1.6-20.el5_2.1″. I followed the instructions and got the following error, what can I do to resolve?:
….
—> Package php-ncurses.i386 0:5.2.10-5 set to be updated
–> Processing Dependency: php-common = 5.2.10-5 for package: php-ncurses
—> Package php-snmp.i386 0:5.3.0-3 set to be updated
—> Package php-pdo.i386 0:5.3.0-3 set to be updated
—> Package php-mysql.i386 0:5.3.0-3 set to be updated
—> Package php-imap.i386 0:5.3.0-3 set to be updated
—> Package php-xml.i386 0:5.3.0-3 set to be updated
–> Finished Dependency Resolution
Error: Missing Dependency: php-common = 5.2.10-5 is needed by package php-ncurses
Reply
15.
Andy says:
30th July 2009 at 7:50 am
@Klaus – php-curl is provided by the php-common package which should already be installed as it is a dependency of the php package, if that’s what you mean?
@TonyG – php-ncurses was removed from php’s distribution in 5.3, however you could “yum remove php-ncurses”, and “pecl install ncurses” when you’ve upgraded php, as it should be in pecl’s repository.
Reply
16.
brian says:
31st July 2009 at 5:34 pm
I have been able to install the 5.2.10 packages from your repo, which is great, but I am also trying to use your mhash and mcrypt packages. They seem to have installed correctly, however they do not show up in phpinfo() when run through apache. They DO show up if phpinfo() is run from the command line “php” command. Any ideas?
I’m using CentOS 5.3 32-bit.
Reply
*
Andy says:
31st July 2009 at 6:32 pm
The only situation I’d expect that to occur would be if you haven’t reloaded apache, sorry if you have already.
17.
brian says:
31st July 2009 at 8:07 pm
I have reloaded apache and found these messages in the error log:
PHP Warning: PHP Startup: mcrypt: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0
PHP Warning: PHP Startup: mhash: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0
This is my apache version: httpd-2.2.3-22.el5.centos.1
Reply
18.
Michael Mansour says:
2nd August 2009 at 5:20 pm
Hi Andy. I’ve just used your 5.2.10 RPM’s on Scientific Linux 5.3 (RHEL 5 derivative like CentOS).
They installed fine.
I used to use the Jason Litka’s (utterramblings) RPM’s for php 5.2.6 but he hasn’t updated in a long time. I have also tried remi which wouldn’t install without upgrading MySQL 5.0.45 to 5.1.x.
I’m glad your php 5.2.10 installs without the problems above.
However, one really good php module supplied by utterramblings is the php-xcache module, which is the php accelerator, one of the fastest open source ones around.
Could you compile this into your repo please?
I found a src rpm here:
http://yum.aclub.net/pub/linux/centos/5/umask/SRPMS/
I’m also wondering how with yum, you can tell it not to list the php 5.3.0 RPM’s on a yum list (or yum check-update) and concentrate only on the 5.2.x series?
Lastly, I wouldn’t mind emailing you directly outside of these comments sections but I couldn’t find an email address for you.
Could you email me please as I have some questions which aren’t really suitable for these comments.
Thanks for providing all this btw, you’re a life saver.
Reply
*
Andy says:
2nd August 2009 at 10:56 pm
Updated the article to show how to install just the PHP 5.2.10 version.
@Michael Thanks, I’ve sent you an email.
19.
Toby says:
3rd August 2009 at 3:07 pm
Hi there,
Great article, thanks for posting this. Would I be able to use your repository to add php-devel to my PHP 5.2.9 installation?
Cheers,
Toby
Reply
*
Andy says:
3rd August 2009 at 6:27 pm
Hi Toby,
I’d recommend upgrading to php 5.2.10, which is in this repository, including its php-devel package, as it is only a bugfix release, and shouldn’t have incompatibilities with my previous php 5.2.9 release.
I’d rather not maintain multiple bugfix releases, as there is a lot of overhead in having to recompile them with additional patches.
*
Toby says:
3rd August 2009 at 8:45 pm
Ok Andy, thanks for the tip, I’ll give it a try!
Best wishes,
Toby
20.
Toby says:
4th August 2009 at 1:51 pm
Hi Andy,
Sorry to bother you again. Trying to upgrade to 5.2.10 as suggested gives me a similar missing dependency to that mentioned by Joseph above:
php-gd-5.2.10-5.i386 from webtatic has depsolving problems
–> Missing Dependency: t1lib is needed by package php-gd-5.2.10-5.i386 (webtatic)
php-gd-5.2.10-5.i386 from webtatic has depsolving problems
–> Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-5.i386 (webtatic)
Error: Missing Dependency: t1lib is needed by package php-gd-5.2.10-5.i386 (webtatic)
Error: Missing Dependency: libt1.so.5 is needed by package php-gd-5.2.10-5.i386 (webtatic)
Is there anything I can do to work around this? And presumably if I can get this to work I then just do an install of php-devel from your repository?
Thanks again,
Toby
Reply
*
Andrew Thompson says:
4th August 2009 at 3:10 pm
Hi Toby,
Sorry, I had only removed the t1lib dependency from the 5.3 version. I’ve compiled a new php 5.2.10 one now which you can use.
21.
Toby says:
4th August 2009 at 5:19 pm
Hi Andy,
I’m really sorry to keep bugging you, it seems unfair given all your good work! Having upgraded to 5.2.6 it ’seems’ to have toasted my install. My Apache error_log now shows this on restart:
PHP Warning: PHP Startup: bcmath: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=0\nPHP compiled with module API=20060613, debug=0, thread-safety=1\nTh$
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/curl.so’ – /usr/lib/php/modules/curl.so: undefined symbol: file_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/dbase.so’ – /usr/lib/php/modules/dbase.so: undefined symbol: core_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/gd.so’ – /usr/lib/php/modules/gd.so: undefined symbol: core_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/json.so’ – /usr/lib/php/modules/json.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mbstring.so’ – /usr/lib/php/modules/mbstring.so: undefined symbol: sapi_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysql.so’ – /usr/lib/php/modules/mysql.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysqli.so’ – /usr/lib/php/modules/mysqli.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo.so’ – /usr/lib/php/modules/pdo.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo_mysql.so’ – /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_register_driver in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/pdo_sqlite.so’ – /usr/lib/php/modules/pdo_sqlite.so: undefined symbol: executor_globals in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/zip.so’ – /usr/lib/php/modules/zip.so: undefined symbol: executor_globals in Unknown on line 0
and phpinfo() is missing a bunch of sections (including mysql, bcmath etc).
Any idea what’s happened? Should I/can I roll back to the previous version?
Sorry to pester you with so many questions, I’m far from the Linux ninja I should be.
Toby
Reply
*
Toby says:
4th August 2009 at 6:36 pm
PS Actually, I should probably mention that after the PHP upgrade I installed php-devel from your repository followed by httpd-devel and apc, although apc has now been removed.
*
Toby says:
4th August 2009 at 6:46 pm
PPS Final two installs were from centos repository
*
Andrew Thompson says:
4th August 2009 at 6:52 pm
Hi Toby, I’ve sent you an email, so you can reply to me from the email if you’d like.
22.
Tom says:
4th August 2009 at 8:10 pm
Thank you for providing these packages!!
I am trying to use this to install lilac and it’s saying “PHP’s POSIX support is not available. POSIX support is required for the importer/exporter/autodiscovery to function”
Was this compiled with “–disable-posix” or is there something else wrong?
Reply
*
Andrew Thompson says:
4th August 2009 at 8:20 pm
At some point fedora split off the posix and other process extensions from the base install, you can install it doing “yum install php-process”
*
Tom says:
5th August 2009 at 12:50 am
Andrew,
Thank you so much. That was what I needed.
Tom
*
Lawal Adekunle says:
5th August 2009 at 4:59 pm
@ Andrew Thompson. Thanks so much for your post. You saved ma a whole lot of headache. i was installing centreon and it kept giving me Critical: php-posix functions are not installed. Now its Solved thanks a lot
23.
Matt Farmer says:
5th August 2009 at 9:02 am
Hey Andy,
Thanks for putting this all together. I’m also running into dependency issues with php-common.
# yum –enablerepo=webtatic update php
…
–> Finished Dependency Resolution
php-ncurses-5.2.10-6.i386 from webtatic has depsolving problems
–> Missing Dependency: php-common = 5.2.10-6 is needed by package php-ncurses-5.2.10-6.i386 (webtatic)
sb-publish-3.0.1-200705230939.noarch from installed has depsolving problems
–> Missing Dependency: any-php-sqlite2 is needed by package sb-publish-3.0.1-200705230939.noarch (installed)
php-mhash-5.2.10-6.i386 from webtatic has depsolving problems
–> Missing Dependency: php-common = 5.2.10-6 is needed by package php-mhash-5.2.10-6.i386 (webtatic)
Error: Missing Dependency: php-common = 5.2.10-6 is needed by package php-mhash-5.2.10-6.i386 (webtatic)
Error: Missing Dependency: any-php-sqlite2 is needed by package sb-publish-3.0.1-200705230939.noarch (installed)
Error: Missing Dependency: php-common = 5.2.10-6 is needed by package php-ncurses-5.2.10-6.i386 (webtatic)
Reply
*
Andrew Thompson says:
5th August 2009 at 9:53 am
Hi Matt,
Try “yum update –enablerepo=webtatic php*”. Possibly it’s trying to satisfy dependencies without upgrading them.
Also your output says something about “sb-publish”, which doesn’t look like it works with it.
24.
Matt Farmer says:
5th August 2009 at 5:05 pm
Thanks for your reply Andy,
That command gives a very similar reply. Could it be because the extensions in your repository are version 5.2.10-6 and not 5.3.0?
# yum list –enablerepo=webtatic php-mhash*
–snip–
Installed Packages
php-mhash.i386 5.2.6-1.el5.art installed
Available Packages
php-mhash.i386 5.2.10-6 webtatic
Reply
*
Andrew Thompson says:
5th August 2009 at 6:37 pm
@Matt
PHP 5.3 made mhash obsolite, and moved its functionality into php-hash which is installed by default.
I’ll compile a new version of 5.3 with the correct obsolite’s
25.
Joomla Developer says:
9th August 2009 at 4:39 am
Thanks a lot this worked like a charm on my CentOS 5.3 installation.
Reply
26.
Chas says:
11th August 2009 at 10:32 pm
Hmm the 5.4.10 seems have have broken some extensions and phpmyadmin
error_log:
Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/mysqli.so’ – /usr/lib/php/modules/mysqli.so: undefined symbol: executor_globals in Unknown on line 0
Linux yn 2.6.16.38-xenU #2 SMP Wed Aug 13 21:03:44 EDT 2008 i686 i686 i386 GNU/Linux
I installed the glibc compatability libraries but that didn’t help
suggestions? I’m rolling back for now – Chas.
Reply
27.
waynem says:
15th August 2009 at 3:02 am
I installed the PHP 5.3 on a Centos 5.3 unit, and it loaded and installed great, however, I needed to use either Zend or Ioncube with my software, and neither products have a PHP 5.3 compatible product. They will however work with PHP 5.2.10 I tried to re-install your 5.2.10 version, but it gives errors stating that no files were marked for “upgrade”. Probably because they are now 5.3 version, and 5.2.10 would be a “rollback” in versions. How can I rollback your PHP 5.3 upgrade and then install the 5.2.10 version ??
I am sure others will also run into this problem.
Thanks,
Wayne
Reply
28.
Andrew Thompson says:
15th August 2009 at 12:38 pm
Sorry about the 5.2.10 version not working before. I rebuilt exactly the same spec on another server and it now works.
As for downgrading, there doesn’t seem to be any easy way other than to “yum remove php*” then install again with the exclude (the yum-allowdowngrade plugin doesn’t seem to work), .
Reply
29.
waynem says:
17th August 2009 at 5:40 pm
The removal worked great, however, when I now try to update ( or “install” ) to the 5.2.10 version with the –exclude=*5.3* tag I get that I am missing dependencies for php-common = 5.2.10-6.1 and php-cli = 5.2.10-6.1 !!!
And the “update” will not load these dependencies.
Is there anyway to load these separately, so the php-5.2.10 version will load and run properly ?
Thanks again,
Wayne
Reply
30.
waynem says:
17th August 2009 at 8:43 pm
I was able to manually re-install the 5.2.10 versions using your RPMs and all is well.
Thank you,
Hopefully Zend and ION cube will get their act together and we can then upgrade to the 5.3 version.
Wayne
Reply
*
Andrew Thompson says:
18th August 2009 at 12:47 pm
Yep, you can manually install individual or multiple packages via rpm,
e.g.
rpm -i http://repo.webtatic.com/yum/centos/5/i386/php-cli-5.2.10-6.1.i386.rpm
Wish I could work out how people get to the state of the repository not finding packages, but in all my tests I haven’t found any problems. In theory it should work exactly correct if not having mixed up with other repositories or guides.
31.
rhino says:
27th August 2009 at 8:26 pm
Nice work! I was able to update my centos5 box to php5.3 when remi’s repo was missing a dependency…yours worked like a champ. Thanks!
Reply
32.
Kevin Lane says:
31st August 2009 at 5:34 am
Hi. I was having the same issue with no updates found until I realized that the version of CentOS I installed had priorities enabled by default. I had to put: priority=1 into your repo to make it find the updates.
Thanks for this page though as it helped a lot.
Reply
33.
Alex W says:
1st September 2009 at 8:56 pm
Although Andrew has already said it, I’m going to repeat that if you are missing packages, you can download and individually install them from here
http://repo.webtatic.com/yum/centos/5/i386/
With the 5.2.10 install, I found that mcrypt wasn’t being installed when I did
yum –enablerepo=webtatic –exclude=php*5.3* update php
but I was able to download it and install it manually afterwards
(and thanks Andrew, you’ve been a life saver)
Reply
34.
various ramblings says:
2nd September 2009 at 12:51 pm
[...] installing php5.3 with xml support on centos [...]
Reply
35.
Camulos says:
8th September 2009 at 9:16 am
thanx so much! I was looking for this :) ( PHP 5.2.10 !!)
Reply
36.
Alex says:
17th September 2009 at 1:05 am
You’re a life saver. One thing you have to add is XCache 1.3.0 which supports PHP 5.3. I dug up your email addy and I’ll email you the srpm.
Thanks!
Alex
Reply
37.
Deep says:
19th September 2009 at 5:06 pm
Hi Andy,
I managed to upgrade my PHP from 5.1.6 to 5.2.10. But then I wanted to install imap.
I did yum install php-imap, which surprisingly looking at the older version
[root@00:16:3e:69:96:bf-my00001 yum.repos.d]# yum install php-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: mirror.nus.edu.sg
* updates: mirror.nus.edu.sg
* base: mirror.nus.edu.sg
* addons: mirror.nus.edu.sg
* extras: mirror.nus.edu.sg
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
–> Running transaction check
—> Package php-imap.x86_64 0:5.1.6-23.2.el5_3 set to be updated
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-imap
–> Processing Dependency: libc-client.so.1()(64bit) for package: php-imap
–> Running transaction check
—> Package php-imap.x86_64 0:5.1.6-23.2.el5_3 set to be updated
–> Processing Dependency: php-common = 5.1.6-23.2.el5_3 for package: php-imap
—> Package libc-client.x86_64 0:2004g-2.2.1 set to be updated
–> Finished Dependency Resolution
php-imap-5.1.6-23.2.el5_3.x86_64 from updates has depsolving problems
–> Missing Dependency: php-common = 5.1.6-23.2.el5_3 is needed by package php-imap-5.1.6-23.2.el5_3.x86_64 (updates)
Error: Missing Dependency: php-common = 5.1.6-23.2.el5_3 is needed by package php-imap-5.1.6-23.2.el5_3.x86_64 (updates)
I tried to run the rpm directly from your server:
# rpm -i http://repo.webtatic.com/yum/centos/5/x86_64/php-imap-5.2.11-1.x86_64.rp...
but this is giving me error:
error: Failed dependencies:
libc-client.so.1()(64bit) is needed by php-imap-5.2.11-1.x86_64
Need your help.
Thanx in advance.
Regards,
Deep
Reply
*
Andrew Thompson says:
20th September 2009 at 2:43 pm
Hi Deep,
You need to set the enablerepo flag whenever you install any packages that depend on my version, e.g.
yum install –enablerepo=webtatic php-imap
Also the reason the rpm -i failed was because rpm on its own doesn’t resolve dependencies. You would need to install the dependency beforehand.
You can lookup the package that the dependency is in by doing:
yum provides libc-client.so.1
In this case its libc-client, but names aren’t always the same.
38.
PHP 5.3 « devspan says:
28th September 2009 at 7:02 pm
[...] only has PHP 5.1 in it’s repository but Andy Thomson is hosting a 5.3 repo at Webtatic.com with a step by step guide on installing it from fresh or [...]
Reply
39.
John says:
17th October 2009 at 4:56 pm
Hi, I think I’ve everything set up! Thankyou for your great job!
I’m just missing the php_mysql.so : where can I find it?
Reply
*
Andrew Thompson says:
23rd October 2009 at 6:22 pm
php_mysql.so should be part of the php-mysql package (along with mysqli, pdo_mysql). Is yum not resolving it as a dependency?
40.
Jonathan Lambert says:
19th October 2009 at 1:34 pm
http://us2.php.net/manual/en/pcre.installation.php
It looks like you compiled PCRE support without –enable-utf8… this breaks frameworks like Kohana, which require it. Not sure how to fix this without recompiling (which is what I did) from source.
I might suggest it. :)
TY for your efforts!
Reply
*
Andrew Thompson says:
23rd October 2009 at 6:21 pm
Interesting, I only really modified the Fedora PHP package, so it only has the configure options that that adds.
Maybe though PHP 5.3 acts differently with this option and I need to add it. I’ll have a look later next week.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
http://fri8nd.egloos.com/2629817
PHP 설치 리눅스관련
* 작성시간 : 2009/10/12 16:21
* 퍼머링크 : fri8nd.egloos.com/2629817
* 작성자 : ceojune
* 덧글수 : 0
PHP 설치과정에 대해서 이야기 하고자 한다.
PHP 와 아파치를 동적으로 연동하기 위해서는 몇가지 설정이 필요하며, 아파치가 동적으로 돌아가기 위해서 DSO support 형식으로 PHP 가 지원 하여야 한다.
PHP 설치도 다른 어플리케이션과 마찬가지로
Source 설치 및 RPM 설치가 있다. RPM 방식설치는 레드햇 엔터프라이즈 5.4 버전에서 설치 되어있다.
일단은 RPM 형식으로 설치 되어있는 PHP 를 삭제를 해야한다.
#rpm -qa | grep php
하게 되면, php 에 대한 rpm 패키지들이 설치 되어있는지 확인해 볼 수 있다.
삭제를 위해서는
#rpm -e 해당rpm
해서 삭제가 가능 하다.
패키지가 연동되어있기 때문에 의존성을 무시하고 설치하려면,
#rpm -e php --nodeps <= nodeps 옵션을 줘야 삭제가 가능 하다.
이렇게 해서 PHP 를 삭제하였다면,
www.PHP.net 에 접속해서 php 를 다운 받도록 하자.
다운 받은 파일을 압축을 해제 하면
#tar zxvf php.5.3.0.tar.gz 으로 압축을 해제 하자 !
압축을 해제 했다면 설정을 컴파일 하기 전에 설정을 먼저 해줘야한다.
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql-=/usr/local/mysql
--with-config-file-path=/usr/local/apache/conf --with-exec-dir=/usr/local/apache/bin
으로 설정을 해줘야한다.
위와 같이 설정을 하는 이유는
--with-apxs2 는 PHP 가 아파치 데몬에 DSO 모듈로 로딩되도록 하기 위해서 apxs 파일을 위치 지정하는 것이고
--with-mysql 은 mysql과 연동하기 위해서 설치되어있는 위치를 가르키는 일이다.
--with-config-file-path 는 php.ini 파일 경로를 지정하는 옵션이며,
--with-exec-dir 은 아파치 데몬의 실행경로를 지정하는 일을 한다.
위와 같이 설정이 끝났다면, #make && make instaill
php 소스가 있는 곳에서
#cp php.ini-production /usr/local/apache/conf/php.ini 를 복사한다.
apache 설정을 해줘야하는 데 /usr/local/apache/conf/httpd.conf 파일을 vi 로 열어서
ServerName 을 편집해주고,
AddType 이 있는 부분에
AddType application/x-httpd-php .php .html .html .inc .php5 .php4
AddType application/x-httpd-php-source .phps
를 설정해준다.
이 설정은 파일을 해석할 때 어떠한 확장자를 해석 할 수 있는지 정의 해주는 부분이다.
이 후 apache 를 재시작 해주면 된다.
# /usr/local/apache/bin/apachectl restart
빵 !!
하면 된다... .....
But......
# /usr/local/apache/bin/apachectl start
httpd: Syntax error on line 99 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
위와 같은 메세지를 만나게 될 것이다. ! 봉착 문제의 봉착 !
문제가 발생한것이다. 이것은 PHP 가 동적으로 DSO 모듈로 제대로 선언되지 못한것과 Shared Object 의 보안 설정 문제나 SeLInux 문제 일 수 있습니다.
이것을 해결하기 위해서는 PHP 동적 모듈이 문제 일 경우는 압축 해제 부터 다시 해서 해결 하면 되며,
보안 설정 문제 이면 아래와 같이 해결 하면 됩니다.
#/sbin/restorecon -R -v /usr/local/apache/modules/libphp5.so
#/usr/bin/chcon -t texrel_shlib_t /usr/local/apache/modules/libphp5.so
위와 같이 해결시에도 문제가 해결 되지 않은 경우 SELinux 를 설정을 해줘야한다.
# /etc/sysconfig/selinux 파일을 vi 로 열어서 아래의 항목과 같이 SELinux 를 해제 해줘야한다. !
SELINUX=disabled
위와 같이 해결 하면 된다.
이상 mysql + apache + php 연동으로 서버 구축을 해보았음.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
http://jonnychoe.egloos.com/5101760
[CentOS5.3] APM 설치 Linux
* by 멋진쟈니
* 2009/09/03 17:14
* jonnychoe.egloos.com/5101760
* 덧글수 : 0
<1.mysql>
./configure --prefix=/usr/local/mysql --localstatedir=/home/sqldata --enable-assembler --without-debug --with-mysqld-user=mysql --with-charset=utf8 --with-extra-charsets=complex --enable-thread-safe-client
컴파일시 에러뜨면 아래 설치
rpm -qa |grep gcc
yum -y install gcc-c++ gcc-gfortran
make
make install
/usr/local/mysql/bin/mysql_install_db
/usr/local/mysql/bin/mysqld_safe &
/usr/local/mysql/bin/mysqladmin -u root password '암호'
접속
/usr/local/mysql/bin/mysql -u root -p
show databases;
<2.apache2>
/server/mpm/prefork/prefork.c 파일에서
#define DEFAULT_SERVER_LIMIT 4096(256->4096)
/server/mpm/worker/worker.c 파일에서
#define DEFAULT_THREAD_LIMIT 256
./configure --prefix=/usr/local/apache2 --enable-so --enable-modules=all --enable-mods-shared=all --enable-ssl=shared --enable-rewrite=shared --enable-cache --enable-disk-cache --enable-mem-cache
<3.php>
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --enable-track-vars=yes --with-ttf --with-iconv --enable-mbstring --enable-sockets --with-freetype-dir=/usr/local/freetype --enable-mbregex --enable-exif --with-gd --enable-gd-native-ttf --with-xmlrpc --with-config-file-path=/usr/local/php --with-ldap=/usr --with-zlib-dir=/usr/lib --enable-calendar
make: warning: Clock skew detected. Your build may be incomplete.
의미
컴파일 한 파일들이 현재의 시스템 시간보다 빠른다는 의미다.
해결 방법
file의 시간을 변경 해주면 된다.
컴파일 하기전 아래의 명령어를 실행시킨다.
touch *
Apache : "Cannot load /usr/local/apache2/modules/libphp5.so"
# service httpd restart
httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
SOLUTION ......................................
chcon -t texrel_shlib_t /usr/local/apache2/modules/libphp5.so
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Redhat 7.3 에서는 SQL서버를 설치하면 기본적으로 Mysql이 아닌 pgsql (postgress SQL)을 기본 DB로 PHP가 설정됩니다. (이는 phpinfo 파일에서 확인할 수 있음)
이것도 모르고 당연히 RPM으로 설치하면 PHP와 Mysql 이 연동 가능하리라 생각하신분들 많으셨을겁니다.
Mysql 과 PHP 를 RPM 으로 연동시켜주기 위해서 php-mysql 모듈이 필요한데 Redhat Linux CD 배포판 에서는 어찌된일인지 php-mysql-7.x.x.rpm 파일을 포함하고 있지 않습니다.
따 라서 현재 설치되어 있는 PHP 버젼과 동일한 버젼의 php-mysql RPM 패키지를 구하여서 설치한후 php.ini 파일에 mysql.so 모듈을 등록시켜준 다음 apache 를 다시띄워주면 PHP와 Mysql 이 연동됩니다. (phpinfo 파일을 확인해보시면 Mysql 이 등록되어 있음을 확인할수 있음)
파일다운로드 http://rpmfind.rediris.es/
RPM 설치후 제로보드를 사용하시고자 하시는 분들은 꼭 확인하세요. 참고로 php.ini 에서 file upload 가 기본적으로 Off 되어 있다는 사실도 확인하세요 !!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
CentOS 와 PHP5.2
* Posted at 2009/03/25 14:01
CentOS 는 태생이 RHEL 계열인지라, RehHat에서 PHP 버전을 관리하는 방식을 따르게 됩니다. 설치형 블로그인 textcube도 PHP 5.2 이상을 지원한다고 선언한 이 마당에서, 아직 RHEL 계열이 5.1에서 멈춰있군요.
이런 쓰레드도 있고, 이런 쓰레드도 있네요. 둘다 PHP5.2를 언제 지원할 예정이냐는 이야기들입니다.
더 찾아보니, Upgrading to PHP 5.2.3 on RHEL and CentOS 이라는 글이 있군요.
Source 받아서 rpmbuild --rebuild php-5.2.5-jason.2.src.rpm 로 간단히 rpm을 만들 수가 있고, /usr/src/RPMS 에서 찾으시면될 것 같습니다.
http://www.php.net/
phpmyadmin을 사용하려하니, yum install phpmyadmin 이 안먹혔다.
그래서, 어차피 /var/www/html(centos,redhat)안에서 웹페이지처럼
작동할것이라서, 그냥 갖다가 복사해놨다.
그런데, php5.2 이상을 요구한다고 문구를 내보내며, 작동이 안됐다.
그래서 이젠 아예 누가 하는것처럼 5.2이상버젼(소스)을 가져다가
rpm으로 컴파일한후에 설치할 생각을 하게됐다.
http://www.php.net/에가서, 5.30으로 받았다.
/usr/src/soso/폴더를 만들어서, 그안에다 압축을 풀어놓고는,
soso/php-5.3.0/로 들어가서.
.configure
http://www.zend.com/en/products/server-ce/downloads