PHP Installation in linux

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

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Related Posts

Related Posts with Thumbnails

About the Author

CoreTimer

has written 31 stories on this site.

System administrator(Linux/UNIX/Windows) RHCE,MCP,CCNA

Write a Comment

Copyright © 2012 CoreTimer.com|System Admin’s Reference. All rights reserved.

Switch to our mobile site