rpms.famillecollet.com
不用管,程序会自动完成安装及配置.
到此前期的准备工作已完成,下面就要对Apache进行配置
输入命令 pd/conf/httpd.conf //打开Apache配置文件,
找到ServerTokens OS 将"OS"改为"Prod " .//显示服务器运行错误信息.与下图一样,那么Apache你就配置成功了,如果不一样请仔细对比上面的教程是不是那个步骤少了#及字母拼写错了.
到此php运行环境便配置成功啦.
因之前通过网易的 centos 镜像,将阿里云的 centos 升级到最新版了,乘自己的项目尚未开始正式开发,遂将所有的相应环境都升级到最高.
查看 centos 版本:
①.、删除之前的 php 版本:
Loaded plugins: langpacks
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
No Match for argument: php-common
No Packages marked for removal
Retrieving
Preparing... ################################# [100%]
Resolving Dependencies
-- Running transaction check
... 【省略】
Warning: RPMDB altered outside of yum.
Installed:
Dependency Installed:
Complete!
以上显示安装成功!
检查phpinfo:
Virtual Directory Supportdisabled
Configuration File (php.ini) Path/etc
Loaded Configuration File/etc/php.ini
Scan this dir for additional .ini files/etc/php.d
Debug Buildno
Thread Safetydisabled
Zend Signal Handlingdisabled
Zend Memory Managerenabled
Zend Multibyte Supportdisabled
DTrace Supportenabled
This program makes use of the Zend Scripting Language Engine:
Configuration
Server Administratorxxxxxx@xxxxxx.com
Hostname:Portxxxx.xxxxx.xxx:0
Max RequestsPer Child: 0 - Keep Alive: on - Max Per Connection: 100
Virtual ServerYes
Server Root/etc/httpd
①.、yum update 检查一下系统更新 初次安装可能更新的时间会比较长,请耐心等待.
[root@lamp ~]# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
安装好php之后重启httpd : /etc/init.d/httpd restart
设置成开机启动:
chkconfig httpd on
chkconfig mysqld on
整个过程我们不需要修改/etc/httpd/conf/httpd.conf 这就是版本高了的好处~