Monday, 7 March 2011

Install PHP into Linux

Install php into the system using these steps.
First unzip the files
# tar jxvf php-xxxx.tar.bz2

Ensure both apache and mysql are in /usr/local. Check the php documentation.
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
# make
# make install


For the next following steps, do it according to how we install php in windows
Open up the httpd.conf file in /usr/local/apache2/conf/
Add in this line: LoadModule php4_module modules/libphp4.so
Add in index.php in the list of valid Directory index files
<IfModule mod_dir.c>
     DirectoryIndex index.php index.htm .php .foo
</IfModule>

Next add in additional file type extensions
AddType application/x-httpd-php .php .foo
AddType application/x-httpd-php .php

Copy php.ini-recommend into /usr/local/php/lib/php.ini
# cp php.ini-recommended /usr/local/php/lib/php.ini
# nano /usr/local/php/lib/php.ini


If system has nano writer install, simply use nano command to open a notepad writer. This is available in Ubuntu.
For slackware, nano is not install. However i can simply use kwrite. If there are no programs to open up a text file, use vi editor.

Update the php.ini as follows (search for the doc root in php.ini)
doc_root="/usr/local/apache2/htdocs/"

Voila... php is install

No comments:

Post a Comment

Cash flow Forecasting

Why cash forecasting? A cash forecasting model is an essential tool for treasuer to manage working capital. Forecasting preempt treasurer ...