Install libxml2 in php in Linux
Download decompressed libxml2-2.6.32.tar.gz
Install
./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/libxml2
Install php
Download http://www.php.net/downloads.php
Unzip tar-zxvf php-5.3.16.tar.gz
Install
./configure --prefix=/usr/local/php --with-libxml-dir=/usr/local/libxml2 --with-apxs2=/usr/local/httpd/bin/apxsmakesudo make install
There is a-with-apxs2 =/usr/local/httpd/bin/apxs option, where apxs is generated when Apache is installed, apxs is a tool for compiling and installing extension modules for the Apache HTTP Server. it can be loaded to the Apache server at runtime using the LoadModule command provided by mod_so. Use this tool to dynamically load the PHP module into Apache
Copy configuration file
cp ~/php-5.3.16/php.ini-development /usr/local/php/lib/php.ini
Modify the apache configuration file
Edit the/usr/local/httpd/conf/httpd. conf file.
Find:
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add:
AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .php5
Find:
DirectoryIndex index.html
Add:
DirectoryIndex index.html index. php
Restart apache
sudo apachectl restart
Verify
Create the info. php file in/usr/local/httpd/php/htdocs.
Enter ip/info. php in the browser and observe the following content, indicating that the installation is successful.