linux 下用yum安装 php\mysql\apache

来源:互联网 发布:gentoo linux 乱码 编辑:程序博客网 时间:2024/05/16 06:16

把linux的防火墙关闭   service iptables stop


1、安装apache服务

[root@localhost]#yum install httpd httpd-devel
httpd-manual
查看apache扩展模块
[root@localhost]#yum list mod_*


可以选择性的安装
[root@localhost]#yum -y listall httpd-manual
mod_ss mod_perl mod_auth_mysql
开启服务
[root@localhost]#service httpd start
设为开机启动
[root@localhost]#chkconfig httpd on


2、安装mysql服务
[root@localhost]#yum install mysql mysql-servermysql-devel
启动mysql服务
[root@localhost]#service mysqld start
启动mysql控制台:
[root@localhost]#mysql
设为开机启动
[root@localhost]#chkconfig mysqld on


3、安装PHP
查看PHP相关信息
[root@localhost]#yum list php*
可以有选择性的安装扩展
[root@localhost]#yum install php
*选择全部装


重启httd服务
[root@localhost]#service httpd restart


这样安装就完成了 去
/var/www/html 目录下创建一个PHP文件测下




4、配置文件存放路径
apache 的配置文件/etc/httpd/conf下
modules放在/usr/lib/httpd下
php 的配置文件在/etc/下和/etc/
php 的modules放在/usr/lib/php/modules下
0 0