Study with me in linux 18

Source: Internet
Author: User
Learn about linux 18-Linux Enterprise Application-Linux server application with me. The following is a detailed description. 1. After mysql is installed, We will install php. The official website of php is www.php.net. Here we will download the latest version 5.2.3.
Http://cn.php.net/get/php-5.2.3.tar.gz/from/a/mirror
[Root @ zy jishu] # md5sum php-5.2.3.tar.gz to check whether your download is correct
Add a few tips here. If you download php-5.2.3.tar.bz2
Run the tar jxvf php-5.2.3.tar.bz2 to decompress the package.
[Root @ zy jishu] # tar zxvf php-5.2.3.tar.gz Decompression
[Root @ zy jishu] # cd php-5.2.3 to enter the Directory
[Root @ zy php-5.2.3] #./configure -- help | more View Script help
[Root @ zy php-5.2.3] #
. /Configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql =/usr/share this command is to add apache and mysql support details you can refer. /configure -- help | more
I failed to install php5.
Grouping extensions
Checking whether to enable LIBXML support... yes
Checking libxml2 install dir... no
Checking for xml2-config path.../usr/bin/xml2-config
Configure: error: libxml2 version 2.6.11 or greater required
The supervisor is installed again. If the test succeeds, you will be prompted for a sentence.
Thank you for using PHP.
[Root @ zy php-5.2.3] # make; make install
[Root @ zy php-5.2.3] # cp php. ini-dist/usr/local/lib/php. ini
Php requires a configuration file by default. We can directly put the php. ini-dist in it.
Use cp to lib as a configuration file
2. Next we will modify the apache configuration file, because the apache configuration file does not support [root @ zy etc] # vi httpd. conf in php by default.
Find the AttType class and add it in the next line.
# AddType application/x-tar. tgz
AddType application/x-httpd-php. php. phtml
Wq save and exit
3. Now we are writing a php test page.
[Root @ zy php-5.2.3] # cd/usr/local/apache2/htdocs/enter the htdocs directory under the apache directory, we compile a test. php file
[Root @ zy htdocs] # vi test. php
Phpinfo ();
?>
Wq
[Root @ zy etc] # vi httpd. conf modify httpd find LoadMoudle, and then add the line above and below
LoadMoudle php5 = module modules/libphp5.so
[Root @ zy htdocs] #/usr/local/apache2/bin/apachectl stop disable apache server
[Root @ zy htdocs] #/usr/local/apache2/bin/apachectl start and start the apache server
[Root @ zy htdocs] # lynx http: // localhost/test. php use this text browser to view the tool lynx
You can also enter http: // 192.168.1.144/test. php in ie.
192.168.1.144 is the address of my server.
Find AddType application/x-gzip. gz. tgz and add the following content under it:
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
Restart Apache
/Usr/local/apache22/bin/apachectl-k restart
Enter http: // 192.168.1.144/test. php in ie to check whether php is supported.

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.