Copyright © tutorialspoint.com

PHP Installation on Linux/Unix

previous

If you plan to install PHP on Linux or any other variant of Unix, then here is the list of prerequisites:

Now here are the steps to install Apache and PHP5 on your Linux or Unix machine. If your PHP or Apache versions are different then please take care accordingly.

gunzip -c apache_1.3.x.tar.gz
tar -xvf apache_1.3.x.tar
cd apache_1.3.x
./configure --prefix=/usr/local/apache --enable-so
make
make install
gunzip -c php-5.x.tar.gz
tar -xvf php-5.x.tar
cd php-5.x
./configure --with-apxs=/usr/sbin/apxs \
            --with-mysql=/usr/bin/mysql
make
make install
cd ../../php-5.x
cp php.ini-dist /usr/local/lib/php.ini
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
cd ../bin
./apachectl start
chmod 755 /home/httpd/html/php

You should see a long table of information about your new PHP installation message Congratulations!

previous

Copyright © tutorialspoint.com