修改后:
#
<IfModule dir_module>
DirectoryIndex index.php index.html index.htm index.html.var
</IfModule>
#
Installation of the PHP Extensions:
安装php5-extensions扩展.
cd /usr/ports/lang/php5-extensions
make config
make install clean
安装选项如下:
详细安装选项
Options for php5-extensions 1.0
[X] BZ2 bzip2 library support
[X] CALENDAR calendar conversion support
[X] CTYPE ctype functions
[X] GD GD library support
[X] ICONV iconv support
[X] MBSTRING multibyte string support
[X] MYSQL MySQL database support
[X] PCRE Perl Compatible Regular Expression support
[X] POSIX POSIX-like functions
[X] SESSION session support
[X] SOCKETS sockets support
[X] TOKENIZER tokenizer support
[X] ZIP ZIP support
[X] ZLIB ZLIB support
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
安装完成后,重新启动你的 web server.
Execute the following command to start / restart the Apache webserver.
/usr/local/etc/rc.d/apache22 restart
提示:
如果出现这样的错误
root@WOW[/root]#/usr/local/etc/rc.d/apache22 restart
httpd not running, trying to start
[Sat Sep 29 16:05:07 2007] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
解决办法:
在/boot/loader.conf添加accf_http_load=”yes”
root@WOW[/root]#echo accf_http_load="YES" >> /boot/loader.conf
然后reboot一下就可以解决了
这是因为Apache无法开启FreeBSD下accept filter 的机制,
FreeBSD 系统还提供了http filter,会自动过滤掉不完整的HTTP请求。
解决方法:
root@WOW[/root]#kldload accf_http
并修改/boot/defaults/loader.conf,以便下次启动自动装载模块(大约364行)
修改前:
accf_data_load="NO"
accf_http_load="NO"
修改后:
accf_data_load="YES"
accf_http_load="YES"
测试Apache Server
浏览器打开http://youipaddress
显示:
It works!
OK,现在Aapche Server工作正常。什么?为什么只有一行It works!?因为FreeBSD开发的达人们只追求速度、简单,呵呵。
Step 4 安装 ZendOptimizer.
Installation of the ZendOptimizer:
安装ZendOptimizer.
Shell:
root@ohaha[/root]#cd /usr/ports/devel/ZendOptimizer/
root@ohaha[/usr/ports/devel/ZendOptimizer/]#make install clean
安装完成提示如下
***************************************************************
You have installed the ZendOptimizer package.
Edit /usr/local/etc/php.ini and add:
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer="/usr/local/lib/php/20060613/Optimizer"
zend_extension_manager.optimizer_ts="/usr/local/lib/php/20060613/Optimizer_TS"
zend_extension="/usr/local/lib/php/20060613/ZendExtensionManager.so"
zend_extension_ts="/usr/local/lib/php/20060613/ZendExtensionManager_TS.so"
***************************************************************
编辑/usr/local/etc/php.ini
增加内容如下
Editor:
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer="/usr/local/lib/php/20060613/Optimizer"
zend_extension_manager.optimizer_ts="/usr/local/lib/php/20060613/Optimizer_TS"
zend_extension="/usr/local/lib/php/20060613/ZendExtensionManager.so"
zend_extension_ts="/usr/local/lib/php/20060613/ZendExtensionManager_TS.so"
重新启动你的 web server.
Execute the following command to start / restart the Apache webserver.
Shell:
/usr/local/etc/rc.d/apache22 restart
测试Aapche Server 对PHP和ZendOptimizer支持
浏览器打开http://youipaddress
显示:
PHP Version 5.1.6
System
FreeBSD ohaha.3322.org 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
root@ohaha[/home/www/web/upload]#rm install.php
编辑/usr/local/etc/apache22/httpd.conf文件,修改DocumentRoot为/usr/local/www/apache22/data默认值
vi /usr/local/etc/apache22/httpd.conf
修改前:
DocumentRoot "/home/www/web/upload"
修改后:
DocumentRoot "/usr/local/www/apache22/data"
重新启动你的 web server.
Execute the following command to start / restart the Apache webserver.