./configure \
--prefix=/usr/local/php5 \
--enable-fastcgi \
--enable-debug \
--with-openssl=/usr/local/openssl-0.9.8i \
--with-zlib \
--with-bz2 \
--with-curl \
--enable-ftp \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-xpm-dir \
--with-ttf \
--with-freetype-dir \
--with-gettext \
--enable-mbstring \
--with-mcrypt \
--with-mhash \
--with-mysql \
--with-mysql-sock \
--enable-sockets \
--with-iconv-dir \
--with-libxml-dir \
--with-libexpat-dir && make && make install
./configure \
--prefix=/usr/local/mysql5 \
--with-charset=utf8 && make && make install
ln -s /usr/local/php5/bin/php /usr/local/bin/
cp php.ini-dist /usr/local/lib/php.ini
vi php.ini
cgi.fix_pathinfo=1
;doc_root =
lighttpd
./configure --prefix=/usr/local/lighttpd && make && make install
cp /usr/local/lighttpd/bin/spawn-fcgi /usr/local/nginx/sbin/spawn-fcgi
ln -s /usr/local/nginx/sbin/spawn-fcgi /usr/local/bin/
nginx
./configure \
--prefix=/usr/local/nginx \
--with-zlib=/usr/lib/ \
--with-openssl=/usr/local/openssl-0.9.8i/ \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_sub_module \
--with-http_dav_module \
–-with-cpu-opt=opteron
\
–-with-cc-opt='-02'
\
--with-epoll_module //高效,freebsd 使用
--with-kqueue_modulemake && make install
groupadd lighttpd
useradd -g lighttpd lighttpd
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 10005 -u lighttpd -g lighttpd -f /usr/local/php5/bin/php-cgi
cp fastcgi_params.default fastcgi.conf
cp nginx.conf.default nginx.conf
vi nginx.conf
user lighttpd lighttpd;
worker_processes 5;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
events {
use epoll;
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
root /home/kingsoft/;
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
access_log logs/host.access.log main;
location / {
root /home/kingsoft/;
index index.html index.htm index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/kingsoft/$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
}
fastcgi_param SCRIPT_FILENAME 你的php文件的目录
/usr/local/nginx/sbin/nginx
如果没有设定对,浏览器就会输出:
No input file specified
参考资料:
(本文完)
阅读(1720) | 评论(1) | 转发(0) |