Install PHP [June 16, 2011, 11:43 a.m.]
i will try to gather information from the net how to install php on windows or linux
LINUX
download source
Get the source from http://www.php.net/downloads.php . At the time of writing this tutorial the best available version was 5.1.5 ( php-5.1.5.tar.gz ).
unpack, configure, compile
Go to the directory whith the downloaded file and enter:
tar -xzf php-5.2.1.tar.gz
cd php-5.2.1
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
The configuration options ought to be self-explaining; –prefix specifies the location where PHP is to be installed, –with-apxs2 with correct path pointing to bin/apxs
in the Apache installation directory is mandatory for the installator
to work. Since PHP 5, you need to explicitly bundle PHP with MySQL by –with-mysql directive (make sure you specified path to where MySQL is installed on your system).
There
are many other options which turn on additional features. For all
available configuration options and their default values type ./configure –help.
Tip: If you are performing an upgrade, you may want to copy config.nice from the old PHP installation directory (if available) to where you unpacked the new PHP tarball file. Run ./config.nice instead of ./configure. This way all the previous configure options will be applied to the new installation effortlessly.
Once you entered ./configure with all the options you need, compile and install the software:
make
make install
edit httpd.conf
All
necessary changes to httpd.conf (Apache configuration file) should have
already been made automatically during the installation, so usually you
need not do anything. Anyways, check that following lines were added to
your httpd.conf file:
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
If not, add them manually.
create php.ini file
Importanly, you have to create php.ini configuration file. Choose one of the pre-made files (preferably php.ini-recommended) residing inside the php-5.2.1/ directory (it’s the folder to which the downloaded archive was extracted). Copy the file to the lib/ directory in the PHP installation directory.
cp php-5.2.1/php.ini-recommended /usr/local/php/lib/php.ini
If you need to, edit the php.ini file:
vi /usr/local/php/lib/php.ini
However, the default settings should work for everyone in most cases.
restart apache server
After everything is set up, restart Apache:
/usr/local/bin/apachectl stop
/usr/local/bin/apachectl start
Alternatively, simply enter:
/usr/local/bin/apachectl restart