ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
### configure ~~~ ./configure \ --enable-fpm \ --prefix=/usr/local/php \ --sysconfdir=/usr/local/php/etc \ --with-config-file-path=/usr/local/php/etc \ --with-config-file-scan-dir=/usr/local/php/etc/php.d \ --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-iconv-dir \ --with-freetype-dir \ --with-jpeg-dir \ --with-png-dir \ --with-zlib \ --with-libxml-dir \ --enable-xml \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --with-mcrypt \ --enable-mbregex \ --enable-mbstring \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --with-bz2 \ --enable-soap \ --without-pear ~~~ ### make && make install >[info] 说明 此处去掉了--enable-maintainer-zts,不再将php作为httpd的模块,不在需要线程安全ZTS 将--with-apxs2=/usr/local/apache/bin/apxs改为--enable-fpm ### 配置文件 #### php配置文件(源码中) ~~~ cp php.ini-production /usr/local/php/etc ~~~ #### php-fpm配置文件 ~~~ cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf ~~~ 编辑php-fpm的配置文件/usr/local/php/etc/php-fpm.conf 配置fpm的相关选项为你所需要的值,并启用pid文件(如下最后一行): ~~~ pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 2 pm.max_spare_servers = 8 pid = /usr/local/php/var/run/php-fpm.pid ~~~ ### php-fpm服务脚本,在编译目录下 ~~~ cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm chmod +x /etc/rc.d/init.d/php-fpm chkconfig --add php-fpm chkconfig php-fpm on ~~~ ### 启动php-fpm ~~~ service php-fpm start ~~~ 如需重新编译,需要清除之前的编译信息 ~~~ make distclean ~~~