Success,
Install PHP on the Virtual Machine (the test is successful and the problem has been solved) (1) first mount php-5.2.17.tar.gz to the operating system to mount/mnt/cdrom (my approach is to copy to the/home/soft directory, here we place my software package here, which is not required by readers) (2) decompress tar -zxvfphp-5.2.17.tar.gz,
Install PHP on the VM (the test is successful and the problem has been solved)
(1)first mount php-5.2.17.tar.gz to the operating system and mount/mnt/cdrom (my practice is to copy it to the/home/soft directory. Here my software package is specially placed, which is not required by readers)
(2) then decompress the tar-zxvf php-5.2.17.tar.gz, the current directory appears php-5.2.17 file, into the php-5.2.17 file cd php-5.2.17
(3) install./configure -- prefix =/usr/local/php.
-- With-apxs2 =/usr/local/apache/bin/apxs
-- With-mysql =/usr/local/mysql
(4) When the code in step 3 is executed, problems such as configure: error: libxml2 version 2.6.11 or greater required. So that the make and make install operations cannot be performed. First, analyze the problem and see the error prompt, and find that the libxml2 version that comes with the operating system is too low. In this case, you need to check whether libxml has been installed on the operating system.
(5) rpm-qa | grep libxml, found that the operating system indeed installed libxml software, but the version is too low, at this time I download a higher version package (libxml2-2.7.2 on www.xmlsoft.org website. Tar.gz) Prepare for Installation
(6) First, uninstall libxml2 of an earlier version. Rpm-e libxml -- nodeps (Force delete)
(7) after uninstalling, next install the new version of the libxml2-2.7.2. step: Mount-extract, unzip, enter the libxml2-2.7.2 directory and then execute. /configure -- prefix =/usr/local/libxml command to prepare for installation-make-> make install this way to install the heart version of The libxml2-2.7.2
(8) after installation, return to Step 3 to reinstall PHP.
./Configure -- prefix =/usr/local/php
-- With-apxs2 =/usr/local/apache/bin/apxs
-- With-mysql =/usr/local/mysql
(9) At this time, configure: error: libxml2 version 2.6.11 or greater required still occurs. after analysis, it is found that the path of libxml2 is not specified during PHP installation, so the parameter-
./Configure -- prefix =/usr/local/php
-- With-apxs2 =/usr/local/apache/bin/apxs
-- With-mysql =/usr/local/mysql
-- With-libxml-dir =/usr/local/libxml.
(10) At this time, the execution is successful, then execute make, and finally execute make install
(11) A new problem occurred when I started the system to execute startx the next day to enter the operation interface.
Error while loading shared libraries: libxml2.so. 2: cannot open shared object file: No such file or directory. First, after the analysis, find the cause, because when I installed libxml2 yesterday, I specified a new installation directory, and the system could not find libxml2.so. 2
(12) I entered/usr/local/libxml/lib and indeed sent libxml2.so. 2. After the analysis, I will go to/etc/ld. so. add the/usr/local/libxml/lib line to the conf file, save the line, and run:/sbin/ldconfig-v to update the configuration.
(13) after solving the above problems, the PHP installation is complete. Next, you need to install php and mysql. apache. After configuration and running, the LAMP (Linux + Apache + MySQL + PHP) environment has been set up.