A few days ago, I integrated apache and php on solaris 10, and encountered some problems, which are very representative. Here I will record the relevant processes and handling measures and hope to help you.
Unlike solaris 9, solaris 10 has installed the GNU development tool (GCC, make, etc.) by default ). However, the related paths are not set in the default environment variables.-Check whether the paths are set, you only need to execute the command gcc without options and parameters.-Use the find search file make and gcc, and then write the path into the file/etc/profile, the/etc/profile path of my system is set as follows:
export PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin |
After modification, run source/etc/profile. Because the tar that comes with solaris 10 is not convenient, replace it with GNU tar. The process is as follows:
Gunzip-d tar-1.16.tar.gztar xvf tar-1.16.tarcd tar-1.16. /configure-prefix =/usr/local/gnutar // specify the directory, otherwise, the makemake install // package may be installed in the directory/usr/local/gnutar mv/usr/sbin/tar. orig // move the vi that comes with the system to one side, In case of an accident, it can be recovered. // ln-s/usr/local/gnutar/bin/tar/usr/sbin/tar |
Next, install apache. The process is as follows:
cd /roottar zxvf httpd-2.2.0.tar.gzcd httpd-2.2.0./configure –prefix=/usr/local/apache2 –enable-so makemake instal |
Check whether the directory/usr/local/apache2 is generated to check whether apache is correctly installed.
Install php as follows:
cd /roottar zxvf php-5.2.0.tar.gzcd php-5.2.0./configure -prefix=/usr/local/php -with-apxs2 =/usr/local/apache2/bin/apxs ……… |
This process cannot run normally and the following error message is displayed:
Configuring extensionschecking whether to enable LIBXML support... yeschecking libxml2 install dir... nochecking for xml2-config path... /usr/bin/xml2-configconfigure: error: libxml2 version 2.6.11 or greater required. |
This indicates that the libxml2 version is low and later than 2.6.11 is required. There are two ways to solve this problem: Upgrade libxml2 and reinstall libxml2. In the solaris environment where the business is running, upgrading is a very risky method. We have many programmers here to upgrade the software package randomly to set a precedent for system crash. Therefore, we strongly recommend that you be as conservative as I do, reinstall libxml2. As long as the installation directory is specified during the source code installation process, the new libxml2 installation will not cause any harm to the system. Of course, occupying that disk space is negligible. To install a new libxml file, follow these steps:
cd /roottar zxvf libxml2-2.6.26.tar.gz./configure –prefix=/usr/local/libxmlmakemake install |
Then we will come back to install php.
cd /root/php-5.2.0./configure -prefix=/usr/local/php5 -with-apxs2=/usr/local/apache2/bin/apxs -With-libxml-dir =/usr/local/libxml // The makemake install configuration is successfully completed. |
The last step is configuration and test. In fact, you only need to modify the apache configuration file httpd. conf. Because the option-with-apxs is used in the php configuration process. insert the "LoadModule php5_module modules/libphp5.so" line in the conf file, check whether the line is automatically written, and then manually insert the line "AddType application/x-httpd-php. php. phtml ", note :. php ,. there is a space in front of phtml. Without this space, the php page cannot be parsed normally. This is a problem that is easy to ignore. Please pay attention to it for beginners. Write the simplest test file index. php, which contains" ", Save it in the directory where the apache Root document is located (here is/usr/local/apache/htdocs/index. php ). Run/usr/local/apache/bin/apachectl start to start the apache daemon and enter