pkg_add -r nginx location / { root /usr/local/www/nginx; index index.html index.htm; } location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/www/nginx$fastcgi_script_name; include fastcgi_params; }
# cd /usr/ports/www/nginx # make install HTTP_MODULE HTTP_REWRITE_MODULE HTTP_STATUS_MODULE
ports 安装 php-fpm 适合 php-5.2.10, 高于这个版本请跳过这节, 采用编译安装。
# cd /usr/ports/lang/php5 # make install
extensions
# cd /usr/ports/lang/php5-extensions/ # make install # ln -s /usr/local/etc/php.ini-production /usr/local/etc/php.ini
php-fpm - FastCGI Process Manager
homepage: http://php-fpm.org/downloads/freebsd-port/
# tar xvzf php-5.2.10-fpm-0.5.13.tar.gz --directory=/usr/ports/lang x php5-fpm/ x php5-fpm/files/ x php5-fpm/Makefile x php5-fpm/distinfo x php5-fpm/pkg-descr x php5-fpm/pkg-plist x php5-fpm/files/php-fpm.sh.in x php5-fpm/files/patch-scripts::phpize.in x php5-fpm/files/patch-TSRM_threads.m4 x php5-fpm/files/patch-Zend::zend.h x php5-fpm/files/patch-Zend_zend_list.c x php5-fpm/files/patch-Zend_zend_list.h x php5-fpm/files/patch-ext_standard_array.c x php5-fpm/files/patch-ext_standard_basic_functions.c x php5-fpm/files/patch-ext_standard_dns.h x php5-fpm/files/patch-ext_standard_image.c x php5-fpm/files/patch-php.ini-dist x php5-fpm/files/patch-php.ini-recommended x php5-fpm/files/patch-main::php_config.h.in x php5-fpm/files/patch-main_SAPI.c x php5-fpm/files/patch-acinclude.m4 x php5-fpm/files/patch-configure.in # cd /usr/ports/lang/php5-fpm/ && make install
ee /usr/local/etc/nginx/nginx.conf location / { root /www; index index.html index.htm index.php; } location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name; include fastcgi_params; }
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。