# cd /usr/ports/databases/mysql50-server
# make install clean
# cd /usr/ports/databases/php5-mysql
# make install clean
主要配置檔:/usr/local/etc/apache22/httpd.conf、extra/httpd-languages.conf、extra/httpd-default.conf
ServerAdmin you@example.comServerName www.example.com:80(無域名可用 IP)DocumentRoot "/usr/local/www/apache22/data" + 對應 <Directory> 權限DirectoryIndex index.html index.htm index.php index.php3 index.cgi index.plAddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
取消 AddHandler cgi-script .cgi 註解並加 .pl 支援 CGI/Perl。
# echo 'apache22_enable="YES"' >> /etc/rc.conf
重啟後瀏覽 https://IP/ 應見「It works!」。
# vi /usr/local/www/apache22/data/test.php
# 瀏覽 https://IP/test.php 應顯示 PHP 組態資訊