1. Compile and build libxml2
Download libxml2 source code
Download and extract libxml2 source code
sudo ./configure
sudo make
sudo make install
2. Compile and build and configure php with apache web server
Download and extract PHP source code
./configure -prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs -with-libxml-dir=/usr/local --with-mysqli=/usr/local/mysql/bin/mysql_config
sudo make
sudo make install
sudo cp php.ini-development /usr/local/lib/php.in
modify php.ini as in below steps
a) include_path = "/usr/local/php5/lib/php:/usr/local/php5/include/php"
b) error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING
c) extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20180731/"
d) configure apache for php (httpd.conf)
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
e) uncomment
Include conf/extra/httpd-vhosts.conf
f) add index.php in below directive
DirectoryIndex index.html index.php
3. Configure httpd-vhosts.conf under /usr/local/apache2/conf/extra for webroot
DocumentRoot "/usr/local/apache2/htdocs/mywebroot/public_html"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error_log"
CustomLog "logs/localhost-access_log" common
"mywebroot" is the name of your choice
4. Create "index.php" in /usr/local/apache2/htdocs/mywebroot/public_html
5. Goto browser and type http://localhost/
|