All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
php论坛服务器架构_[PHP教程]

Writer: 归海一刀 Article type: Programming skills(编程技巧) Time: 2014/2/10 6:50:16 Browse times: 374 Comment times: 0

php论坛服务器架构_[PHP教程]


Head photo

Go homepage
Upload pictures
Write articles

php论坛服务器架构_[PHP教程] 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,然后在浏览器中浏览。 来源:http://blog.csdn.net/lixiaolong_blog/archive/2007/01/31/1498698.aspx




There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.