PHP Installation in linux
- Tuesday, June 22, 2010, 4:34
- PHP
- Add a comment
|
|
Prerequisites
Apache webserver
Mysql
Installation
Goto the directory
use this command to unpack the file
tar -xvf php-5.x.x.tar.gz
cd php-5.x.x
./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql
* –prefix specifies the location where PHP is to be installed .
* –with-apxs2 pointing to bin/apxs in the apache installation directory.
* –with-mysql to bind with mysql
After successfull execution of ./configure compile and install using the following commands
make
make install
Then edit /etc/httpd/conf/httpd.conf file in your favourite editor
verify the following lines in httpd.conf which is automatically added during installation.
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
Then create configuration file for PHP(php.ini)
You can create php.ini from sample file php.ini-recommended residing inside the php-5.x.x directory
cp php-5.x.x/php.ini-recommended /usr/local/php/lib/php.ini
Restart apache server
/etc/init.d/httpd restart
Readmore @ lynuxstuff.com


