php
配置epel源:
yum install -y epel-release
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
配置remi源:
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
安装php:
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof
安装php-fpm:
yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
配置开机启动服务:
systemctl restart php-fpm
systemctl enable php-frm
确认是否成功:
ps -ef | grep php
netstat -anp | grep 9000
php7安装请参考:YDOOK : CentOS7 8 安装 PHP7 完全详细教程 亲试可用!_centos8 部署php7.0.12-CSDN博客
nginx
yum install nginx
service nginx start
配置文件在 /etc/nginx/conf.d/
mysql
方案一:
# yum install mariadb-server mariadb # systemctl start mariadb
方案二:
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server
先安装mysql rpm包 centos7: rpm -ivh https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm centos6: rpm -ivh https://repo.mysql.com//mysql57-community-release-el6-11.noarch.rpm
再执行安装命令
yum install mysql-server
启动
service mysqld start
service mysqld stop
service mysqld restart
登录
mysql