无标题文档
wdCP系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdCDN系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
wdOS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdDNS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
注册 发贴 提问 回复-必看必看 wddns免费智能 DNS 开通 本地或虚拟机使 用wdcp 一键包在mysql编 译时"卡住"
【300G高防】双线 无视攻击 wdcp官方技术支持/服务 阿里云8折优惠券 无敌云 腾讯云优惠中,现注册更有260代金额券赠送
返回列表 发帖
提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等

温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的
lanmp中nginx与apache的php是分开编译的,apache不支持php-fpm启动,只有nginx才支持php-fpm启动。需要apache支持php-fpm需要重新编译apache。
1.安装apache fastcgi模块
mod_fastcgi下载地址:http://www.fastcgi.com/dist/

tar -zxvf mod_fastcgi-current.tar.gz
cd mod_fastcgi-2.4.6
cp Makefile.AP2 Makefile
make top_dir=/path/to/apache2 #你的apache安装路径或者直接编辑Makefile[则不需加top_dir参数]
make install top_dir=/path/to/apache2

2.安装php-fpm
在安装PHP-FPM编译的时候会报找不到libevent,可以执行
yum -y install libevent*
wget http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz
tar zxvf libevent-1.4.12-stable.tar.gz
cd libevent-1.4.12
./configure --prefix=$prefix
mak && make install

tar -jxvf php-5.3.3.tar.bz2
cd php-5.3.3
./configure \
--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc \
--with-mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-zlib --with-curl --with-jpeg-dir --with-freetype-dir --with-png-dir \
--with-libxml-dir=/usr/ --with-gd --with-openssl  \
--with-openssl --with-ldap --with-ldap-sasl --with-xmlrpc --without-pear \
--enable-xml --enable-gd-native-ttf \
--enable-ctype --enable-calendar --enable-inline-optimization \
--enable-magic-quotes --with-bz2 --enable-mbstring \
--enable-fpm  --enable-safe-mode  --enable-bcmath  --enable-shmop \
--enable-sysvsem --enable-mbregex  --enable-mbstring --enable-pcntl  \
--enable-zip --enable-ftp --enable-sockets --enable-soap
--with-libevent-dir=/usr
make && make install

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod +x /etc/init.d/php-fpm

cp -r sapi/fpm/php-fpm.conf /usr/local/etc/
配置php-fpm.conf文件中相关参数

启动php-fpm
/etc/init.d/php-fpm start


3.修改apache,让apache支持php-fpm
vi httpd.conf
add LoadModule fastcgi_module modules/mod_fastcgi.so
在vhosts.conf文件的项目中加入以下
    ScriptAlias /cgi-bin/ "/map/app/php5_poi/bin/"
FastCgiExternalServer /map/app/php5_poi/bin/php-fpm -host 127.0.0.1:9000  #php由外部的fastcgi来处理
AddType application/x-httpd-php .php
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php-fpm
#Action php5-fastcgi /cgi-bin/php-fpm中的php-fpm一定要和FastCgiExternalServer中的文件名一样.而且/cgi-bin/和前面的ScriptAlias的路径也要一样,两句放一块就是说上面的映射也就是所有的.php文件都由/cgi-bin/php-fpm 处理
否則會出錯的.

<Directory "/map/app/php5_poi/bin/">
Options -Indexes FollowSymLinks +ExecCGI
Order allow,deny
Allow from all
</Directory>
加完以上的,安装完成了。但是php-fpm.conf配置文件需要优化。
bbs.swdyz.com   pp.gy

TOP

回复 6# kazaff


    你编译的是wdlinux的环境,那么就需要遵守wdlinux的路径来安装显然网站目录都没配置正确。还要注意权限问题。php-fpm本身是为nginx量身定制,运行于apache可以说牵强了些。毕竟已经不再是php5.2.x时的php-fpm了。
bbs.swdyz.com   pp.gy

TOP

回复 9# kazaff


    听我的就不要再apache中用php-fpm,apache要安装fastcgi模块,而这个东西好几年没更新了,不稳定。针对你的问题请去掉--with-libevent-dir     要么 运行一下 yum -y install libevent  先把这个模块安装了再编译php
bbs.swdyz.com   pp.gy

TOP

返回列表