更新ports-tree
portsnap fetch extract
portsnap fetch update

安裝 Apache 2.4
cd /usr/ports/www/apache24
make install
選擇event 模式
(x) MPM_EVENT          MPM worker variant with the goal of consuming threx
(x) MPM_SHARED         all MPMs as loadable module

安裝php7.0
cd /usr/ports/lang/php70
make install
[x] ZTS      Force Zend Thread Safety (ZTS) build

安裝需要的php extensions
cd /usr/ports/lang/php70-extensions
make install

設定apache 支援php
/usr/local/etc/apache24/Includes/php-fpm.conf
<FilesMatch "\.php$">
    SetHandler "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost"
</FilesMatch>

編輯 /etc/rc.conf
php_fpm_enable="YES"
apache24_enable="YES"

啟動 apache && php-fpm
/usr/local/etc/rc.d/php-fpm start
/usr/local/etc/rc.d/apache24 start

測試網頁是否正常
<?php
    phpinfo();
?>


undefined
PHP學習手冊

arrow
arrow
    文章標籤
    freebsd apache php
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()