PHP Linux installation or php upgrade howto
Q. How do I install PHP under Red Hat enterprise Linux?
A. PHP (Hypertext Preprocesso) is a server-side web programming language that you can embed into HTML pages. When a user accesses a PHP-based page, PHP dynamically creates a web page that is then passed to the browser.
PHP works with Apache, Lighttpd and other webservers. PHP offers built-in database integration for several commercial and non-commercial database management systems. It also has the ability to perform many useful Web-related tasks using a large set of built-in functions.
PHP generally runs on a web server, taking PHP code as its input and creating Web pages as output, but command-line scripting and client-side GUI applications are part of the three primary uses of PHP as well. PHP can be deployed on any web server and on almost every OS platform free of charge.
Installing PHP is easy these days.
Red Hat enterprise Linux PHP installation
If you would like to install or upgrade PHP use up2date command:
# up2date php
CentOS/Fedora core Linux PHP installation
If you would like to install PHP use yum command
# yum install php
If you would like to upgrade PHP use yum command
# yum update php
Debian / Ubentu Linux PHP installation
If you would like to install or upgrade PHP use atp-get command
# apt-get install php4-cgi php4-cli
# sudo apt-get install php4-cgi php4-cli
To install PHP 5
# apt-get install php5-cgi php5-cli
# sudo apt-get install php5-cgi php5-cli
FreeBSD PHP installation
Use pkg_add command as follows:
# pkg_add -v -r php
Use above command to install Apache or Lighttpd web server.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Upgrade Linux kernel howto
- How do I install or upgrade an RPM file or package under Red Hat / Fedora / Suse Linux?
- How To Simulate Linux Package Upgrade Without Installing Anything ( Dry Run )
- Upgrade WHM / cPanel Linux server to EDGE release
- How To Upgrade FreeBSD 6.3 to 7.0 Stable Release
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!


June 1st, 2007 at 6:43 am
Can you please provide the detailed step by step process for Upgrading the PHP4 to PHP 5.?
Also the system requirements for this like Zend Engine, Apache server version required or MySQL version required ?
June 1st, 2007 at 9:28 pm
Just run up2dat/yum or apt-get command to update version. If you need more help join our forum
October 15th, 2007 at 1:54 pm
Hello there,
Actually when I run ‘yum update php’ on CentOS 5, it does not update the php to the latest version of 5.2.3 and remains to version 5.1.6 only and says that it can not find any updates.
Anything am I missing?
Regards,
Naresh Khokhaneshiya
October 15th, 2007 at 6:08 pm
Naresh,
5.1.6 is latest and stable for RHEL / CentOS. PHP 5.2.3 won’t be available for CentOS 5.0. You have to wait or compile from source code.
October 24th, 2007 at 10:59 pm
I to in a way have the same problem as Naresh
however a little defferant. I have version 5.1.6
and am trying to install ffmpeg.php it needs the comand phpize to be ran and there is no sush program on my server !
which phpize / it says none
Why would this not get installed with my version of php (any ideas ?) Also if you have any thoughts as to how I can install this please let me no. I realy do not want to have to reinstall php or upgrade.
have you hurd of a patch for this or something?
Thanks Mars
October 25th, 2007 at 2:20 pm
Mars,
Install php-devel package to get phpize binary:
yum install php-devel
December 29th, 2007 at 8:11 pm
Hi,
Thanks for your guide. I ran the update command using yum and my PHP was updating to a version of Nov 2005. My system is Redhat. Can you tell me how to upgrade to the latest PHP version? Do I have to first uninstall the old version or something?
Thanks
December 30th, 2007 at 11:43 am
John,
If you are using RHEL 4, there is no offical PHP 5 exists. Redhat only provides updates for RHEL 4. I strongly recommend to update your box to RHEL 5.x
April 5th, 2008 at 3:52 pm
HEllo all
I ran this and it installed the phpize
Install php-devel package to get phpize binary:
yum install php-devel
However now when i try to use phpize it says?
make sure you run ‘usr/bin/phpize’ in the top level source directory of the module
I have looked everywhere on the net and there is no help on this that i could find. Do you have any thoughts on what this means?
Thank You
May 22nd, 2008 at 7:37 am
I tryed the command on Ubuntu:
sudo apt-get install php5-cgi php5-cli
Ant it installed the version 5.2.3 of php but the last version is 5.2.6.
It’s not so important, but how upgrade to the last version using apt-get ?
Thanks for this post