1.安裝
2 | cd /usr/ports/www/apache22-worker-mpm; make install |
5 | cd /usr/ports/lang/php5; make install |
8 | cp /usr/ local /etc/php.ini-production /usr/ local /etc/php.ini |
11 | cd /usr/ports/lang/php5-extensions; make install |
14 | cd /usr/ports/www/mod_fastcgi; make install |
2.修改設定
/usr/local/etc/apache22/httpd.conf
2 | LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so |
5 | Include etc/apache22/extra/httpd-mpm.conf |
新增/usr/local/etc/apache22/Includes/php.conf
2 | LoadModule php5_module libexec/apache22/libphp5.so |
3 | AddType application/x-httpd-php .php .html |
4 | AddType application/x-httpd-php- source .phps |
8 | FastCGIExternalServer /usr/ local /sbin/php-fpm -socket /tmp/php-fpm.sock -idle-timeout 900 |
9 | AddHandler php-fastcgi .php |
10 | Action php-fastcgi /usr/ local /sbin/php-fpm.fcgi |
11 | ScriptAlias /usr/ local /sbin/php-fpm.fcgi /usr/ local /sbin/php-fpm |
13 | <Directory /usr/ local /sbin > |
14 | Options ExecCGI FollowSymLinks |
15 | SetHandler fastcgi-script |
21 | DirectoryIndex index.php index.html |
修改/usr/local/etc/php-fpm.conf
2 | ;listen = 127.0.0.1:9000 |
3 | listen = /tmp/php-fpm.sock |
修改/etc/rc.conf
6 | apache22_http_accept_enable= "YES" |
3.啟動
1 | /usr/ local /etc/rc.d/php-fpm start |
2 | /usr/ local /etc/rc.d/apache22 start |