centos7 nginx+php5.6+mysql安装与配置

安装与配置

php 56的安装

php的配置写在 php.ini,可在phpinfo()中查看

//查找已安装
yum list installed | grep php
// php卸载
yum -y remove php56*
yum remove httpd* php*

可用的资源:
centos 安装php56+nginx

nginx + php-fpm

nginx安装

sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
sudo yum install -y nginx
sudo systemctl start nginx.service
// 开机启动
sudo systemctl enable nginx.service
  • nginx 配置
location ~ \.php$ {
   fastcgi_pass   127.0.0.1:9000;
   fastcgi_index  index.php;
   fastcgi_param  SCRIPT_FILENAM  $document_root$fastcgi_script_name;
   include        fastcgi_params;
}
  • php-fpm (使用php-fpm -t 可以看到其配置所在)
sudo service php-fpm reload
sudo service php-fpm restart 

php重启

重启php-fpm即可

sudo service php-fpm reload
sudo service php-fpm restart 

mysql

参考 https://juejin.im/post/5c088b066fb9a049d4419985

mysql启动

systemctl start  mysqld.service

tip

初始密码获取:

cat /var/log/mysqld.log | grep -i 'temporary password'

posted @ 2019-05-12 09:15  ViCanary  阅读(1748)  评论(0编辑  收藏  举报