源码编译nginx,php

来源:互联网 发布:snmp网络管理模型论文 编辑:程序博客网 时间:2024/05/18 01:45

1.download nginx,php,pcre源码:

nginx: http://nginx.org/en/download.html

php: http://cn2.php.net/downloads.php

pcre: http://download.chinaunix.net/download/0008000/7913.shtml

zlib: http://download.chinaunix.net/download/0013000/12241.shtml

-----注意装个 apt-get install g++(编译pcre需要)

安装nginx前,安装pcre,zlib

./configure 

make;sudo make install


安装nginx

./configure --prefix=/usr/local/nginx --with-pcre

make

make install


安装php

注意在安装php, 把php-fpm加进去。

./configure --prefix=/usr/local/php --enable-fpm

p.s. 缺少XML2: 下载http://download.chinaunix.net/download.php?id=28634&ResourceID=6094

安装 ./configure --prefix=/usr/local/xml2 

make;make install

建立软连: 在/usr/bin下: sudo ln -s /usr/local/libxml2-2.7.2/bin/xml2-config xml2-config

再编译php即可


useradd nobody

如果出现file not find 则

去 nginx.conf 加入fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

0 0
原创粉丝点击