目錄
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;
}