How to Set up Php on Apache 2.2.3 on CentOS 5.3
This article is aimed at people who have CentOS 5.3 and Apache 2.2.3. It may also work on RHEL (but you have to pay for RHEL). Connect to your VPS using SSH to get a command line (unless its being installed on your local machine). Your...
Method 1 of 2:
Httpd
-
Connect to your VPS using SSH to get a command line (unless its being installed on your local machine). Your machine will need to be connected to the network to download packages. Packages can be installed using the 'yum' command.- CentOS and Red Hat based distros call the Apache server 'httpd' rather than Apache. This can be confusing at times to new people, but it is the same application/server. You should search for Apache using the command 'yum search httpd' . This will probably show you a lot of results, however some of these things are modules or addons. The main one to look for looks like 'httpd.i386' or similar. Now you can install it with 'yum install httpd.i386'
-
Remember that search for the PHP. PHP comes with many modules, this means a 'yum search php' will show a lot more items. The main one to install is php.i386 (like the httpd) unless you run a 64bit OS in which case you will see the difference in name in the search.
Method 2 of 2:
PHP
-
Install the PHP, and any modules you need. Modules start with php- . ie common install line would be yum install php.i386 php-imap.i386 php-dbase.i386 php-xml.i386 php-pgsql.i386 php-mysql.i386 php-gd.i386 php-mcrypt.i386 -
Restart the Apache server with 'service httpd restart' -
Put the following script anywhere under your document root (usually /var/www/html/) but make sure it has a .php extension (ie index.php): -
Open your web browser and browse to the uploaded file, and if it says Hello World, then PHP is working!
4.1 ★ | 10 Vote
Read More
- How to install CentOS on a Raspberry Pi
- How to install the Arduino IDE on CentOS 8
- Set up a CentOS 5.7 server and install ISPConfig 3.
- How to Install CentOS
- Compare Nginx and Apache
- Install CentOS on Windows 10 WSL
- MSI presents the laptop to play 'dinosaur' GE70 Apache Pro
- How to Install Apache Guacamole via Docker on Ubuntu 22.04
- Differences between RHEL, CentOS and Fedora
- How to install KDE Plasma Desktop on CentOS 8
- How to install VLC Media Player 3 on CentOS 8
- Integrating ClamAV with PureFTPd in CentOS 5.4
- 10 measures of Apache security
- How to install Apache Netbean on Windows 10