💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
### 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 ~~~