# php -m
Above command will provide you installed version of php. If you want to upgrade it then you need to download the source from the URL:
or use try the below mentioned steps:
# cd /usr/src
# wget http://museum.php.net/php4/php-4.3.3.tar.gz
# tar -zxvf php-4.3.3.tar.gz
# cd /usr/src/php-4.3.3
# ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-mysql
Note: A '/usr/local/apache/bin/apxs' the path of this apache extension binary may not be the same you need to set it as per your server configuration.
You can add other prefix and options for php extension like GD and other while compiling it.
# make test
# make install
You need to make some changes to work php with Apache, hence need to change the httpd.conf apache configuration file. Open this file with vi editor in insert mode.
If LoadModule php4_module modules/libphp4.so line is not added by php install to httpd.conf, then you have to add it yourself. Add it somewhere below section named "Dynamic Shared Object (DSO) Support"
LoadModule php4_module modules/libphp4.so
Now, add this line to httpd.conf file:
AddType application/x-httpd-php .php
Lastly restart your apache server.
Now create a test PHP file using any text editor and add these lines to it: