Linux installation php-7.0.16, complete PHP and Apache configuration ____linux

Source: Internet
Author: User
Tags install php php download phpinfo

Linux installation php-7.0.16, complete PHP and Apache configuration



Version: php-7.0.16.tar.gz,libxml2-2.9.2.tar.gz (PHP needs its support, install it first)


Description: Install Apache blog, complete PHP and Apache configuration, on a blog address: http://blog.csdn.net/forrest_ou/article/details/60769087


LIBXML2 Download Address: www.xmlsoft.org



During the installation of libxml2-2.9.2.tar.gz, there were two errors about Python, because I didn't use it, I put him there, still installed in the OPT/DAAS/LAPW folder


PHP Download Address: www.xmlsoft.org







Install php-7.0.16.tar.gz


The third step: decompression, two times operation Gzip-d php-7.0.16.tar.gz
TAR-XF Php-7.0.16.tar
php-7.0.16 This folder is more than the folder


Step Fourth: Install, CD php-7.0.16, enter the php-7.0.16 folder, and then execute the following command
./CONFIGURE-PREFIX=/OPT/DAAS/LAPW/PHP7--WITH-LIBXML-DIR=/OPT/DAAS/LAPW/LIBXML2

--with-apxs2=/opt/daas/lapw/apache/bin/apxs
Make
Make Intall
Description:-PREFIX=/OPT/DAAS/LAPW/PHP7 Specifies the installation directory and installs the PHP7 folder under the LAPW folder
--WITH-LIBXML-DIR=/OPT/DAAS/LAPW/LIBXML2--with-apxs2=/opt/daas/lapw/apache/bin/apxs Specify dependencies



Step Fifth: Test whether the installation is successful, configure httpd.conf (apache/conf/httpd.conf) before testing, and modify the configuration in httpd.conf as follows
Search LoadModule, add later: LoadModule php7_module modules/libphp7.so (not added, will appear to run PHP file into download). followed by the add:
<filesmatch "\.ph (p[2-6]?| tml) $ ">
SetHandler Application/x-httpd-phpaddtype application/x-compress. Z
AddType application/x-gzip. GZ tgz
</FilesMatch>
Search for DirectoryIndex and add index.php to the back index.phtml
Found it
AddType application/x-compress. Z

AddType application/x-gzip. GZ tgz
Add at a later
AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source. Php7
The above httpd.conf file modification complete
Add test file phpinfo.php to Apache/htdocs directory
Content of phpinfo.php:
<?php
Phpinfo ();
?>
Restart Apache, test the Apache path with/phpinfo.php before the browser is entered, and the PHP page appears to be installed successfully


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.