Under Linux build PHP development environment, Php-Fpm process management

Currently PHP project development of several popular architecture built in, LNMP is the best in terms of performance, because of this, makes LNMP architecture became popular, today, mentioned earlier Nginx deployment, due to the need to project the actual environment, today talking about how to deploy PHP.

surroundings

6.3 CentOS
PHP 5.6
installation steps

1. Download and install PHP: first download the file to a directory, then extract the files.

[root@izbp1fpkhq7mg4o07jzot0z ~]# wget http://cn2.php.net/distributions/php-5.6.0.tar.xz 
[root@izbp1fpkhq7mg4o07jzot0z ~# xz -d php-5.6.0.tar.xz 
[root@izbp1fpkhq7mg4o07jzot0z ~]# tar xvf php-5.6.0.tar 
[root@izbp1fpkhq7mg4o07jzot0z ~]# cd php-5.6.0 

 

2. Install PHP dependencies

[root@izbp1fpkhq7mg4o07jzot0z ~]# yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel

If you copy, use the command, make sure command line.

 

3. Create a user www: This is the default user PHP5.6 otherwise might be an error on startup PHP.

[root@izbp1fpkhq7mg4o07jzot0z ~]# groupadd www 
[root@izbp1fpkhq7mg4o07jzot0z ~]# useradd -g www -s /sbin/nologin -M www 

 

4. Compile and install PHP

[root@izbp1fpkhq7mg4o07jzot0z php-5.6.0]# ./configure 
--prefix=/usr/local/webserver/php \ 
--with-config-file-path=/usr/local/webserver/php/etc \ 
--enable-inline-optimization \ 
--disable-debug \ 
--disable-rpath \ 
--enable-shared \ 
--enable-opcache \ 
--enable-fpm \ 
--with-fpm-user=www \ 
--with-fpm-group=www \ 
--with-mysql=mysqlnd \ 
--with-mysqli=mysqlnd \ 
--with-pdo-mysql=mysqlnd \ 
--with-gettext \ 
--enable-mbstring \ 
--with-iconv \ 
--with-mcrypt \ 
--with-mhash \ 
--with-openssl \ 
--enable-bcmath \ 
--enable-soap \ 
--with-libxml-dir \ 
--enable-pcntl \ 
--enable-shmop \ 
--enable-sysvmsg \ 
--enable-sysvsem \ 
--enable-sysvshm \ 
--enable-sockets \ 
--with-curl \ 
--with-zlib \ 
--enable-zip \ 
--with-bz2 \ 
--with-readline 
Installation Parameters 

"" " Installation Path " ""  
--prefix = / usr / local / the webserver / PHP \ 
 "" " the php.ini Profile Path " ""  
--with-config- File -path = / usr / local / webserver / PHP / etc \ 
 "" " optimization options " ""  
--enable-inline- optimization \ 
 --disable Debug \ 
 --disable rpath \ 
 --enable- Shared \ 
 "" " enable opcache, by default + ZendOptimizer (ZendOpcache) "" "  
--enable- opcache \ 
 " "" FPM """ 
--enable-fpm \ 
--with-fpm-user=www \ 
--with-fpm-group=www \ 
""" MySQL """ 
--with-mysql=mysqlnd \ 
--with-mysqli=mysqlnd \ 
--with-pdo-mysql=mysqlnd \ 
""" 国际化与字符编码支持 """ 
--with-gettext \ 
--enable-mbstring \ 
--with-iconv \ 
""" 加密扩展 """ 
--with-mcrypt \ 
--with-mhash \ 
--with-openssl \ 
""" 数学扩展 """ 
--enable-bcmath \ 
"""the SOAP \ 
 
--enable-"" "Web services, soap rely libxmllibxml----with dir \ 
 "" " process, signal and memory " ""  
--enable- PCNTL \ 
 --enable- shmop \ 
 --enable- sysvmsg \ 
 --enable- SYSVSEM \ 
 --enable- SYSVSHM \ 
 " "" socket & curl "" "  
--enable- Sockets \ 
 --with- curl \ 
 " "" compression and archive "" "  
--with- zlib \ 
 --enable- ZIP \ 
 --with- bz2 \ 
 " "" GNU readline command-line shortcut key bindings "" "  
--with-readline

 

5. Compile and install

[root@izbp1fpkhq7mg4o07jzot0z php-5.6.0]# make 
[root@izbp1fpkhq7mg4o07jzot0z php-5.6.0]# make install 

 

6. Configure PHP

The process of configuring PHP mainly copies of the relevant documents to the appropriate installation directory, including the configuration file php.ini, php-pfm startup script. Please refer to the actual situation of the specific path.

[root@izbp1fpkhq7mg4o07jzot0z php-5.6.0]# cp /usr/local/webserver/php/etc/php-fpm.conf.default /usr/local/webserver/php/etc/php-fpm.conf
[root@izbp1fpkhq7mg4o07jzot0z php-5.6.0]# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[root@izbp1fpkhq7mg4o07jzot0z php-5.6.0]# chmod +x /etc/init.d/php-fpm

 

7. Start php-fpm Service

[root@izbp1fpkhq7mg4o07jzot0z php-5.6.0]#service php-fpm start 

 

Guess you like

Origin www.cnblogs.com/ai10999/p/11488780.html