| 
 | 
 
 本帖最后由 金关村村长 于 2014-6-14 13:35 编辑  
 
可以先安装mysql.由于mysql编译安装要巨长时间.所以用deb包安装 
aptitude install mysql-server mysql-client 
 
 
 
php自带一个build-in server,下载php回来然后make install就可以解析http请求解析php文件 
不过效率堪忧. 
nginx下载回来然后make install就可以解析http请求,html和图片资源无压力.不过不能解析php文件 
 
那nginx和php之间的交流有一种规范.这个规范叫做fastcgi.而php-fpm就是fastcgi的一种实现 
 
php configure的时候带上enable php-fpm然后make install得到php-fpm可执行文件 , .php-fpm就开始监控127.0.0.1:9000 
 
php 编译参数简单版 
 
./configure --prefix=/home/www/php --enable-fpm --enable-mbstring --enable-sockets --with-mysql --with-pdo-mysql --with-zlib --with-curl 
 
修改nginx配置文件把所有php后缀的都转发到这个127.0.0.1:9000就可以实现对php文件的解析 
 
注意看nginx的error.log 
如果配置不当有可能出现404错误 
 location ~ \.php$ { 
            root           html; 
            fastcgi_pass   127.0.0.1:9000; 
            fastcgi_index  index.php; 
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name; 
            include        fastcgi_params; 
        } 
 
修改nginx.conf之后记得reload ./nginx -s reload 
 
nginx worker process XXX exited on signal 11 这个时候ps -aux |  grep nginx 看worker用户.如果是nobody就修改nginx.conf改为www 
firebug表现上是http请求直接abort掉 |   
 
 
 
 |