国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

PHP教程:Linux下PHP服務器的安裝與配置

2024-08-28 00:23:40
字體:
來源:轉載
供稿:網友

1、#cp httpd-2.0.47.tar.gz 到/usr/local/
2、#tar zxvf php-4.3.3.tar.gz
3、#cd php-4.3.3
4、#./configure --with-mysql --with-apxs2=/usr/local/apache/bin/apxs
   #./configure -with-apache=/path/to/apache/dir -with-mysql=/usr/local/mysql
5、#make
6、#make install  (一邊等待一邊保佑吧)
7 、#cp php.ini-dist /usr/local/lib/php.ini
8 、#vi /usr/local/apache2/conf/httpd.conf
9 、在addtype application/x-tar.tgz下面,添加以下內容:
addtype application/x-httpd-php .php
loadmodule php4_module /var/www/modules/libphp4.so (如果沒有的話加上)
10 、#vi /usr/local/apache2/htdocs/test.php
<?
echo phpinfo();
?>
11 、瀏覽http://ip/test.php。出現php信息。恭喜這一步成功了。

php和apache安裝后的基本配置
1.apache的配置
apache的配置文件是/usr/local/apache2/conf/httpd.conf,編輯httpd.conf 文件,在文件結尾加上以下兩行:
loadmodule php4_module modules/libphp4.so
addtype application/x-httpd-php .php .php3
同時修改directoryindex為:

directoryindex index.htm
directoryindex index.html
directoryindex index.php
directoryindex index.php3
directoryindex index.php4

apache的配置內容比較豐富,其它apache相關配置請參考apache的相關文檔。
2.php的配置
apache的配置文件是/usr/local/lib/php.ini,編輯php.ini文件來配置php的選項。特別注意的是,安裝完成后register_globals變量默認設置為off,需要將它改成on。否則會出現php讀不到post的數據的現象。
zlib.output_compression=on
register_globals=on
其它php的選項請參考相關文檔。
3.測試
可以寫一個簡單的php文件來測試安裝,文件包含下列一行:
將其保存為/usr/local/apache2/htdocs/info.php,啟動apache,然后在瀏覽器中瀏覽。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 安陆市| 齐齐哈尔市| 竹北市| 城口县| 胶南市| 磐石市| 栾城县| 乐都县| 景德镇市| 宁阳县| 浦江县| 西安市| 齐河县| 岳池县| 牡丹江市| 鹿泉市| 太谷县| 江津市| 罗平县| 康马县| 张家界市| 枞阳县| 乐平市| 广灵县| 广南县| 陈巴尔虎旗| 新田县| 原阳县| 土默特右旗| 出国| 务川| 娱乐| 绍兴县| 界首市| 临夏市| 邢台县| 吉安县| 高阳县| 金川县| 平度市| 凯里市|