Step 3 Installation PHP5.
|
|
Installation of the PHP5:
跟隨下面步驟安裝 PHP5.
使用Ports方式安裝PHP5,進(jìn)入PHP5所在的Ports安裝目錄/usr/ports/www/php2執(zhí)行ake install clean進(jìn)行安裝。
Shell:
whereis php5
php5: /usr/ports/lang/php5
cd /usr/ports/lang/php5/
make install clean |
安裝時(shí),會(huì)要求進(jìn)行php5選項(xiàng)設(shè)定,這里選擇如下
Options for php5 5.2.5
| [X]
| APACHE
| Build Apache module
| [X]
| MULTIBYTE
| Enable zend multibyte support
|
| 安裝完成后,輸入rehash命令刷新
Shell:
***************************************************************
Make sure index.php is part of your DirectoryIndex.
You should add the following to your Apache configuration file:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
***************************************************************
===>
Cleaning for pkg-config-0.22_1
===>
Cleaning for libxml2-2.6.30
===>
Cleaning for php5-5.2.5
rehash | 系統(tǒng)提示,需要添加以上被標(biāo)記顏色到httpd.conf文件。
先備份httpd.conf文件
Shell:
cd /usr/local/etc/apache22/
cp httpd.conf httpd.conf.bak | 編輯httpd.conf文件
Shell:
vi /usr/local/etc/apache22/httpd.conf |
編輯/usr/local/etc/apache22/httpd.conf文件,以使Apache Server支持php
編輯/usr/local/etc/apache22/httpd.conf,在AddType application/x-gzip .gz .tgz(大約354行)下面添加添加以下內(nèi)容
Editor:
index.php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps |
修改前:
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz |
修改后:
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps |
先不要退出,添加'index.php' 到'DirectoryIndex' 主目錄索引(大約212行)
Editor:
DirectoryIndex index.php index.html index.htm |
修改前:
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
# |
修改后:
#
<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
</IfModule>
# | 保存退出后。
[ 本帖最后由 freemongolia 于 2007-11-29 13:36 編輯 ] |