目前系统centos7版本,默认源php5.4
关闭firewalld和SELinux
systemctl stop firewalld
systemctl disable firewalld
vim /etc/selinux/config
把第7行 SELINUX=enforcing 修改为
SELINUX=disabled
reboot
1,apache(httpd)
yum install httpd
查看下载版本
httpd -v
vim /etc/httpd/conf/httpd.conf
修改文件第95行为:ServerName localhost:80 #指定服务器主机名和端口号,静态ip也可
systemctl start httpd
systemctl enable httpd
浏览器可访问本机ip即A(appach)配置完成
几个目录需要理解:
/etc/httpd/conf.modules.d
![[Pasted image 20230926193743.png]]
/var/www/html
![[Pasted image 20230926185546.png]]
2,PHP
php下载后会在/etc/httpd/conf.modules.d目录下放一个php.conf的文件,该文件用于加载 PHP 模块的配置文件,用于与 Apache 集成。
1)换源
wget https://mirrors.aliyun.com/remi/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm
下载后:
cd /etc/yum.repos.d
该目录下即yum工具下载或者检索的源存放地