Learn notes ———— centos7.4 under PHP compilation installation

Source: Internet
Author: User
Tags fpm

PHP (foreign name: Php:hypertext Preprocessor, Chinese name: "Hypertext Preprocessor") is a common open source scripting language. The grammar absorbs the C language, Java and Perl features, is conducive to learning, widely used, mainly for the field of web development. PHP's unique syntax mixes the syntax of C, Java, Perl, and PHP's own creation. It can execute Dynamic Web pages more quickly than CGI or Perl. Dynamic pages made in PHP are compared to other programming languages, and PHP is executed in HTML (an application under the standard Universal Markup Language), which is much more efficient than CGI, which generates HTML markup entirely; PHP can also execute post-compilation code, Compilation can achieve encryption and optimize code execution, making code run faster.
Note: cited for network

Website address: http://php.net/
SOURCE Package http://cn2.php.net/distributions/php-7.1.10.tar.gz

To install a dependency package:
[Email protected] ~]# yum-y install php-mcrypt libmcrypt libmcrypt-devel autoconf freetype gd libmcrypt libpng libpng-de Vel libjpeg libxml2 libxml2-devel zlib Curl Curl-devel re2c

Compiling and installing PHP
[Email protected] ~]# tar XF php-7.1.10.tar.gz-c/usr/local/src/
[Email protected] ~]# cd/usr/local/src/php-7.1.10/
[Email protected] php-7.1.10]#/configure--prefix=/usr/local/php/--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS-- Enable-mbstring--with-curl--with-gd--enable-fpm--enable-mysqlnd--with-pdo-mysql=mysqlnd--with-config-file-path =/usr/local/php/etc/--with-mysqli=mysqlnd--with-mysql-sock=/var/lib/mysql/mysql.sock
Note:
--WITH-APXS2 #将php编译为Apache的一个模块进行使用
--enable-mbstring #多字节字符串的支持
--with-curl #支持cURL
--WITH-GD #支持gd库
--ENABLE-FPM #支持构建fpm
--enable-mysqlnd #启用mysqlnd
--with-pdo-mysql #支持pdo: MySQL Support
--with-config-file-path #设置配置文件路径
--with-mysqli #支持MySQLi
--with-mysql-sock #关联mysql的socket文件

Installation:
[[email protected] ~]# make && make install

To build the configuration file:
[email protected] php-7.1.10]# CP Php.ini-production/usr/local/php/etc/php.ini
Add Apache Support
[Email protected] php-7.1.10]# vim/usr/local/apache/conf/httpd.conf
AddType application/x-httpd-php. php. phtml

To create a test page:
[Email protected] php-7.1.10]# cd/usr/local/apache/htdocs/
[Email protected] htdocs]# vim index.php
[email protected] htdocs]# cat index.php
<?php
Phpinfo ();
?>
Restart Apache
[Email protected] htdocs]#/etc/init.d/apachectl restart
Test:

The previous article about the installation of Apache, what unreasonable place to hope that the big boys to point out the younger brother

Learn notes ———— centos7.4 under PHP compilation installation

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.