Note: This howto is OUT OF DATE. Please refer to the IUS repository for installing php 5.3x (php53u).
This howto will instruct you how to correctly install php 5.2.x on Official Centos 5.x systems.
Applicable to Centos Versions:
- Centos 5.x
Requirements
Explanation of requirements.
- Root or Sudo access with root privileges.
- Internet access.
Doing the Work
Basic description of what will be done and what is expected.
- Setup c5-testing:
- Install or update php:
- Replace the php.ini:
cd /etc/yum.repos.d && wget http://dev.centos.org/centos/5/CentOS-Testing.repo
sudo yum --enablerepo=c5-testing install php* sudo yum --enablerepo=c5-testing update php* check to make sure it's been installed/updated: rpm -q php
If you've already had php installed previously (i.e. you used the update method above) then run this command: sudo cp /etc/php.ini /etc/php.ini_(todays date) && sudo cp /etc/php.ini.rpmnew /etc/php.ini && sudo service httpd restart If not then simply restart httpd: sudo service httpd restart create and save a file called phpinfo.php in your httpd docroot with only this in it:1<?php phpinfo(); ?>
Troubleshooting / How To Test
Explanation troubleshooting basics and expectations.
- Let’s go test and make sure we can see the current php version and other information:
- Make sure httpd is started, also make sure you have correctly replaced the php.ini file if you had previously installed php from official Centos repos.
Open a web browser and navigate to: http://www.example.com/phpinfo.php
sudo service httpd status
Common problems and fixes
Describe common problems here, include links to known common problems if on another site
More Information
Any additional information or notes.
Disclaimer
We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #centoshelp on irc.freenode.net

