Linux 安装apache php

yum install libxml2

yum install php

 

yum install httpd httpd-devel 

 

安装完成后,用/etc/init.d/httpd start 启动apache 或者  service httpd start

设为开机启动:chkconfig httpd on 

 

配置 httpd.conf 让apache支持PHP:

  # vi /etc/httpd/conf/httpd.conf

 

  找到 AddType application/x-gzip .gz .tgz 在其下添加如下内容

 

  AddType application/x-httpd-php .php      (.前面有空格)

 

  AddType application/x-httpd-php-source .phps        (.前面有空格)

 

修改端口

   找到Listen 80 

   修改 Listen 8081

猜你喜欢

转载自friping.iteye.com/blog/1842016