搜ijsio 发表于 2018-11-22 09:21:09

Centos 7 Apache解析PHP

  1、源码安装
# yum install -y gcc gcc-c++ httpd php-xml php-pear php-mbstring php-cliphp-odbc php-pecl php-pdo php-gd php-xmlrpc php-devel php-mysql php-commonphp-process php-ldap php-bcmath rrdtool-php php-soap vim-X11 vim-commonvim-enhanced vim-filesystem vim-minimal
  

  2、配置防火墙
  # yum install iptables-services
  # systemctl stop firewalld.service   #停止firewall
  # systemctl disable firewalld.service#禁止firewall开机启动
  

  3、修改APACHE配置文件

  # vim /etc/httpd/conf/httpd.conf
  
      DirectoryIndex index.php index.html
  
  
      AddType application/x-compress .Z
      AddType application/x-gzip .gz .tgz
      AddTypeapplication/x-httpd-php .php
  

  4、启动APACHE服务

  # systemctl start httpd.service
  # ps -ef | grep httpd
  root   16122   11 10:18 ?      00:00:00 /usr/sbin/httpd -DFOREGROUND
  apache   16124 161220 10:18 ?      00:00:00 /usr/sbin/httpd -DFOREGROUND
  apache   16125 161220 10:18 ?      00:00:00 /usr/sbin/httpd -DFOREGROUND
  apache   16126 161220 10:18 ?      00:00:00 /usr/sbin/httpd -DFOREGROUND
  apache   16127 161220 10:18 ?      00:00:00 /usr/sbin/httpd -DFOREGROUND
  apache   16128 161220 10:18 ?      00:00:00 /usr/sbin/httpd -DFOREGROUND
  

  5、编写PHP测试页
  # vi /var/www/html/index.php

  :wq! #保存退出
  

  在客户端浏览器输入服务器IP地址,可以看到如下图所示相关的配置信息!

  http://ip地址/index.php
  

  

  




页: [1]
查看完整版本: Centos 7 Apache解析PHP