Solaris 10 integrated Apache and PHP process and error handling _php tutorial

Source: Internet
Author: User
Tags phpinfo
A few days ago, I was in the Solaris 10 integration of Apache and PHP, during which encountered some problems, very representative, here to the relevant procedures and processing measures recorded, I hope to be helpful.

Unlike Solaris 9, the GNU Development tools (Gcc,make, etc.) are installed by default in Solaris 10. But the default environment variable does not set the associated path-see if the path is set, as long as you execute the command without options and parameters gcc will know-search for files with find make and GCC, and then write the path into the file/etc/profile, my system/etc/ The profile path settings are as follows:

Export  path= $PATH:/usr/ccs/bin:/usr/sfw/bin

After the change, the execution of Source/etc/profile can be done. Given that the Solaris 10 comes with tar that is inconvenient, replace it with GNU tar, as follows:

gunzip-d Tar-1.16.tar.gztar xvf tar-1.16.tarcd Tar-1.16./configure-prefix=/usr/local/gnutar//designated directory, otherwise may error Makemake    Install//pack the package in the catalogue/usr/local/gnutar Mv/usr/sbin/tar  /usr/sbin/tar.orig  //Move the system's VI to one side,
                                So that in case of an accident, it recovers back//ln–s/usr/local/gnutar/bin/tar  /usr/sbin/tar

Next you install Apache with the following process:

Cd/roottar zxvf httpd-2.2.0.tar.gzcd httpd-2.2.0./configure–prefix=/usr/local/apache2–enable-so makemake instal  

Check to see if the directory is/usr/local/apache2 to know if Apache is installed correctly.

To install PHP, the process is as follows:

Cd/roottar ZXVF PHP-5.2.0.TAR.GZCD PHP-5.2.0./CONFIGURE-PREFIX=/USR/LOCAL/PHP-WITH-APXS2

This process does not work properly, the following error message appears:

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 system comes with a low LIBXML2 version and requires 2.6.11 or more versions. There are 2 ways to solve this problem: upgrade libxml2 and reinstall a LIBXML2. In a Solaris environment that is running a business, upgrades are a very risky approach, and we have a lot of programmers who are messing with the system by tinkering with software packages, so it's highly recommended to be as conservative as I am and to reinstall a new libxml2. As long as we specify the installation directory during the source installation, the installation of the new LIBXML2 will not cause any harm to the system, of course, occupy that bit of disk space is negligible. Here are the steps to install a new libxml:

Cd/roottar zxvf Libxml2-2.6.26.tar.gz./configure–prefix=/usr/local/libxmlmakemake Install

Then we'll come back and 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   //configuration has been completed successfully makemake install

The last step is configuration and testing, and you actually only need to modify the Apache configuration file httpd.conf. Because the option-WITH-APXS is used during the configuration of PHP, the "LoadModule php5_module modules/libphp5.so" line is inserted in the htppd.conf file, first checking to see if it is automatically written , and then manually insert the line "AddType application/x-httpd-php. php. phtml", Note: php,.phtml front each has a space, no this space will not parse the PHP page normally, this is a very easy to ignore the problem, please novice attention. Write one of the simplest test file index.php, including "!--? php phpinfo (); !--? php phpinfo ();--> ", save it in the directory where the Apache root document is located (this is/usr/local/apache/htdocs/index.php). Execute/usr/local/apache/bin/apachectl start to launch the Apache daemon, enter
from the browser

http://www.bkjia.com/PHPjc/446800.html www.bkjia.com true http://www.bkjia.com/PHPjc/446800.html techarticle A few days ago, I was in the Solaris 10 integration of Apache and PHP, during which encountered some problems, very representative, here to the relevant procedures and processing measures recorded, I hope to be helpful. ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.