php-7.0.18 version (compiled installation)-Custom installation path

Source: Internet
Author: User
Tags fpm openssl openldap

php-7.0.18version (compiled and installed)-Customizing the installation path

installation path:/application/php-7.0.18

1.Pre-PreparationInstalling the GCC and gcc-c++ required for compilation
Yum install-y gcc gcc-c++


PHPDependent

Libxml2-devel,openssl-devel,curl-devel,libjpeg-devel,libpng-devel, freetype-devel,openldap-devel,libmcrypt-devel

Yum-y Install libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel openldap-devel Libmcrypt-devel


Download the PHP source package and Unzip it
Cd/toolswget HTTP://CN2.PHP.NET/DISTRIBUTIONS/PHP-7.0.18.TAR.GZTAR-ZXF php-7.0.18.tar.gz


2.phpCompiling the installationGenerate Makefile File
CD php-7.0.18./configure--prefix=/application/php-7.0.18--with-mysqli--enable-mbstring--enable-fpm

Require additional functionality to add it yourself


compiling the source code and installing
Make && make install


3.Late EndCreate a soft link to php-7.0.18 remove the end version number
Ln-s/application/php-7.0.18//application/php


Adding environment Variables

Create a php command soft link to an environment variable

Ln-s/application/php/sbin/*/usr/local/sbin/ln-s/application/php/bin/*/usr/local/bin/


Configure PHPCopy configuration file
#引擎配置文件: Php.inicd/application/phpcp/tools/php-7.0.18/php.ini-development/application/php/etc/php.ini # Service configuration file: Php-fpm.confcd/application/php/etc/cp php-fpm.conf.default php-fpm.conf cd/application/php/etc/php-fpm.d/ CP Www.conf.default www.conf


Modify the service configuration file
 Run as Nginx phpsed -i  ' s#nobody#nginx#g '  www.conf turn on slow query log sed  -i  ' s#;slowlog#slowlog#g '  www.conf open mail settings sed -i  ' s#;p hp_admin_value\[sendmail_path\]# Php_admin_value\[sendmail_path\] #g '  www.conf Modify recipient sed -i  ' s#[email protected]#[email  Protected] #g '  www.conf  open pid file sed -i  ' s#;p id#pid#g '  /application/php/etc/ Php-fpm.conf Open error log sed -i  ' s#;error_log#error_log#g '  /application/php/etc/php-fpm.conf modify error level SED  -i  ' S#;log_level = notice#log_level = error#g '  /application/php/etc/ Php-fpm.conf Modify the number of file descriptors sed -i  ' s#;rlimit_files = 1024#rlimit_files = 32768#g '  /application/php/etc/php-fpm.conf modified to asynchronous Model sed -i  ' S#;events#events#g '  /application/php/etc/ Php-fpm.conf 


5.Common CommandsStart PHP-FPM
Php-fpm-c runs with the specified engine configuration file, not the default php-fpm-c/application/php/etc/php.ini


Stop PHP-FPM
Kill-sigquit $ (cat/application/php/var/run/php-fpm.pid) #平滑终止kill-sigint $ (cat/application/php/var/run/ PHP-FPM.PID) #立刻终止


Restart php-fpm
KILL-SIGUSR2 $ (cat/application/php/var/run/php-fpm.pid) #平滑重启


Signal Interpretation:

SIGINT, SIGTERM immediately terminate .

Sigquit Smooth Termination

SIGUSR1 reopen log file

SIGUSR2 smoothly overloads all worker processes and reloads the configuration and binary modules


This is your choice | Czlunsu "blog, be sure to keep this source http://czlun.blog.51cto.com/9876583/1945879

php-7.0.18 version (compiled installation)-Custom installation path

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.