How to Set up Php on Apache 2.2.3 on CentOS 5.3

Method 1 Httpd

  1. Php on Apache,Connect to your VPS using SSH to get a command line (unless its being installed on your local machine).

Your device will need to be connected to the network to download programs. Packages can be installed the use of the ‘yum’ command.

  • CentOS and Red Hat based distros name the Apache server ‘httpd’ instead of Apache. This may be difficult at instances to new humans, however it is the equal utility/server. You should look for Apache the use of the command ‘yum seek httpd’ . This will probably display you a whole lot of effects, however a number of these things are modules or addons. The principal one to search for looks as if ‘httpd.I386’ or similar. Now you can install it with ‘yum deploy httpd.I386’

2. Php on Apache,Remember that search for the PHP.

PHP comes with many modules, this means a ‘yum search personal home page’ will display plenty greater objects. The main one to put in is personal home page.I386 (like the httpd) except you run a 64bit OS in which case you may see the distinction in call inside the search.

Method 2 PHP

  1. Php on Apache,Install the PHP, and any modules you need.

Modules begin with personal home page- . Ie common set up line would be yum set up personal home page.I386 Hypertext Preprocessor-imap.I386 Hypertext Preprocessor-dbase.I386 Hypertext Preprocessor-xml.I386 personal home page-pgsql.I386 personal home page-mysql.I386 personal home page-gd.I386 Hypertext Preprocessor-mcrypt.I386

2. Restart the Apache server with ‘service httpd restart’

3. Put the following script anywhere under your document root(usually /var/www/html/) but make sure it has a .php extension (ie index.php):

4. Open your web browser and browse to the uploaded file, and if it says Hello World, then PHP is working!