Fedora Linux+Apache+MySQL+PHP安裝配置

火星人 @ 2014-03-12 , reply:0


   

1. 下載新的MySql_server.rpm

rpm -ivh Mysql_server_XXXX.rpm 安裝server平台

rpm -ivh Mysql_client_xxxx.rpm 安裝client包

 

如果你是更新安裝的話,可能提示 confict ,so replace rpm -ivh 為 rpm -Uvh

 

2. 安裝 apache

tar -zxvf httpd-2.2.6.tar.gz

cd httpd-2.2.6

./configure --prefix=/usr/local/apache --enable-module=so

make

make install

 

3.安裝 php-5.2.4

tar -zxvf php-5.2.4.tar.gz

cd php-5.2.4

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/lib --with-mysql

make

make install

cp php.ini-dist /usr/local/lib/php.ini

 

4.配置

vi /usr/local/apache/conf/httpd.conf對apache做如下配置

 

#ServerAdmin 一行改為您的郵箱地址

 

#DocumentRoot "/home/httpd/html/" 此處為html文件主目錄

 

#Options FollowSymLinks MultiViews 為安全起見,去掉"Indexes"

 

# DirectoryIndex default.php default.phtml default.php3 default.html default.htm

#

#設置apache的默認文件名次序

 

#AddType application/x-httpd-php .php .phtml .php3 .inc

#AddType application/x-httpd-php-source .phps

#設置php文件後綴

 

存檔退出

vi /usr/local/lib/php.ini

#register-golbals = On

存檔退出

 

5.啟動apache

/usr/local/apache2/bin/apachectl start

 

如果提示一下錯誤:

Can not load /usr/local/apache2/modules/libphp5.so into server:

/usr/local/apache2/modules/libphp5.so:

Can't restore segment prot after reloc : Permission denied

Linux

 

因為無法載入php模塊,在調試PHP程序是提示下載php,或者顯示php源代碼,解決方法:

 

修改 httpd.conf

LoadModule php5_module modules/libphp5.so

AddType application/x-httpd-php .php

 

執行:chcon /usr/local/apache2/modules/libphp5.so -t shlib_t

 

註銷系統重新進入

/usr/local/apache2/bin/apachectl start

(責任編輯:A6)





[火星人 via ] Fedora Linux+Apache+MySQL+PHP安裝配置已經有331次圍觀

http://www.coctec.com/docs/enterprise/show-post-73592.html