1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| # 依赖安装 yum install epel-release gcc automake autoconf libtool make gcc gcc-c++ glibc-y
# MySQL yum install mysql-server -y /etc/init.d/mysqld restart /usr/bin/mysql_secure_installation # 初始化设置数据库
# Nginx yum install nginx -y /etc/init.d/nginx start
# PHP add-apt-repository universe && apt-get install php-fpm php-mysql # for ubuntu yum install php-fpm php-mysql # for centos vim /etc/php.ini,将cgi.fix_pathinfo=1改为cgi.fix_pathinfo=0 vim /etc/php-fpm.d/www.conf将apache用户更改为nginx用户 user = nginx group = nginx
service php-fpm restart # 如果php-fpm: unrecognized service,可以在/usr/lib/systemd/system/目录下看具体的服务名 service nginx restart
# 开机启动 systemctl enable mysqld systemctl enable php-fpm systemctl enable nginx
# 老版本使用这个命令 chkconfig --levels 235 mysqld on chkconfig --levels 235 nginx on chkconfig --levels 235 php-fpm on
|