手记

php服务器的塔建

1、获取安装包php.i686;

2、安装php.i686

rpm -ivh php.i686

3、配置apache让其支持php

vi

#

# AddType allows you to add to or override the MIME configuration

# file mime.types for specific file types.

#

#AddType application/x-tar .tgz

AddType application/x-httpd-php .php             \\新添加语句(前面有空格)

AddType application/x-httpd-php-source .phps     \\新添加语句(前面有空格)


4、配置PHP服务器

vi /etc/php.ini

; Whether or not to register the EGPCS variables as global variables.  You may

; want to turn this off if you don't want to clutter your scripts' global scope

; with user data.  This makes most sense when coupled with track_vars - in which

; case you can access all of the GPC variables through the $HTTP_*_VARS[],

; variables.

; You should do your best to write your scripts so that they do not require

; register_globals to be on;  Using form variables as globals can easily lead

; to possible security problems, if the code is not very well thought of.

; http://www.php.net/manual/en/ini.core.php#ini.register-globals

register_globals = On    \\把register_globalsA的值改为on


5、启重apache

service httpd restart


6、测试PHP是否安装成功

写一个php测试页面info.php,放在apache的根目录/var/www/html下,其内容如下

<?php

 phpinfo();

?>

在浏览器上输入127.0.0.1/info.php,如果能正常显示出php信息,则说明PHP安装成功!



0人推荐
随时随地看视频
慕课网APP