Tuesday, February 28, 2012

linux: php basic installation with apache configuration

download a php source file and install
# ./configure
# make
# make install


copy php.ini-dist to /usr/local/lib/php.ini

edit your php.ini file and set the following:
extension_dir = "/usr/local/apache2/modules/" # this is my apache modules directory
include_path = "/usr/local/lib/php
extension=php_mysql.so

if you have pgsql add:
extension=php_pgsql.so

edit your /etc/ld.so.conf file and add the following:
/usr/local/lib
/usr/local/include

if you have pgsql add:
/usr/local/pgsql/lib

load ldconfig
# ldconfig -v

edit your apache httpd.conf configuration file
verify that the line below is not in comment:
LoadModule php5_module modules/libphp5.so
then add the following lines:
                -AddType application/x-httpd-php .php
                -AddType application/x-httpd-php-source .phps
                -AddType application/x-httpd-php .phtml

restart your apache server

create a test php file with the content below:
<?php phpinfo(); ?>
then test by browsing your test php file

sometimes it takes a while before php pages work after installation. give it a few minutes before testing

No comments:

Post a Comment

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...