Install PHP4 on CentOS 5.5 VPS Print

  • 3

1. Install Apache

yum install httpd

2. Install Mysql

yum install mysql mysql-server php-mysql

3. Install dependencies

yum install flex gcc* bison bison-devel httpd-devel make

4. Download PHP4 cource


5. Extract PHP4

tar zxvf php-4.4.9.tar.gz

6. Enter folder and configure

cd php-4.4.9
./configure --with-apxs2=/usr/sbin/apxs

7. Install and verify

make test

8. Finalise installation

make install

9. Add configuration to php.conf

nano /etc/httpd/conf.d/php.conf

add this to the file and save the file

# /etc/httpd/conf.d/php.conf
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages
LoadModule php4_module modules/
# Cause the PHP interpreter to handle files with a .php extension.
AddHandler php-script .php
AddType text/html .php
# Add index.php to the list of files that will be served as directory
# indexes.
DirectoryIndex index.php
# Uncommenting the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#AddType application/x-httpd-php-source .phps

10. Restart Apache

service httpd restart


Was this answer helpful?

« Back