centos7.4安装php5.6套件
程序员文章站
2022-07-13 14:35:57
...
本文不包括清理系统原有环境里的nginx,php,mysql
所谓套件,就是nginx,php5.6,mysql5.7,redis
# 操作系统 centos7.4
yum install -y wget epel-release
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
注意:如果是centos6,则
yum install -y http://rpms.remirepo.net/enterprise/remi-release-6.rpm
yum install -y yum-utils
yum-config-manager --enable remi-php56
yum install -y nginx php56 redis
yum install -y php56-php-devel php56-php-fpm php56-php-mbstring php56-php-memcache php56-php-redis php56-php-mysqli php56-php-mysqlnd php56-php-pdo php56-php-bcmath php56-php-dom php56-php-gd php56-php-gmp php56-php-igbinary php56-php-imagick php56-php-mcrypt php56-php-pdo_mysql php56-php-posix php56-php-simplexml php56-php-opcache php56-php-xsl php56-php-xmlwriter php56-php-xmlreader php56-php-xml php56-php-swoole php56-php-zip
ln -s /usr/bin/php56 /usr/bin/php
ln -s /opt/remi/php56/root/sbin/php-fpm /usr/bin/php-fpm
vi /etc/opt/remi/php56/php-fpm.d/www.conf
~~~
# user=apche, group=apache改成
user = nginx
group = nginx
~~~
vi /etc/nginx/default.d/default.conf
~~~
## enable php support ##
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
~~~
vi /usr/share/nginx/html/phpinfo.php
~~~
<?php
phpinfo();
~~~
systemctl enable php56-php-fpm.service
systemctl start php56-php-fpm
systemctl start nginx
# 打开浏览器
http://127.0.0.1/phpinfo.php
# 下面一大段 mysql 5.7
wget http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm
rpm -Uvh mysql57-community-release-el7-7.noarch.rpm
yum install mysql-server
systemctl start mysqld
# 这一步查看到初始密码
grep "password" /var/log/mysqld.log
# 这一步输入刚才的初始密码
mysql -uroot -p
# 以下语句在mysql的shell里执行,最后一句是设置密码
set global validate_password_policy=0;
set global validate_password_mixed_case_count=0;
set global validate_password_number_count=3;
set global validate_password_special_char_count=0;
set global validate_password_length=3;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');
# 下面这句话去除 mysql在yum仓库的记录,避免每次更新。
yum -y remove mysql57-community-release-el7-7.noarch
# 这句话查看mysql的安装配置
# mysql_config
systemctl stop mysqld
systemctl start mysqld
所谓套件,就是nginx,php5.6,mysql5.7,redis
# 操作系统 centos7.4
yum install -y wget epel-release
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
注意:如果是centos6,则
yum install -y http://rpms.remirepo.net/enterprise/remi-release-6.rpm
yum install -y yum-utils
yum-config-manager --enable remi-php56
yum install -y nginx php56 redis
yum install -y php56-php-devel php56-php-fpm php56-php-mbstring php56-php-memcache php56-php-redis php56-php-mysqli php56-php-mysqlnd php56-php-pdo php56-php-bcmath php56-php-dom php56-php-gd php56-php-gmp php56-php-igbinary php56-php-imagick php56-php-mcrypt php56-php-pdo_mysql php56-php-posix php56-php-simplexml php56-php-opcache php56-php-xsl php56-php-xmlwriter php56-php-xmlreader php56-php-xml php56-php-swoole php56-php-zip
ln -s /usr/bin/php56 /usr/bin/php
ln -s /opt/remi/php56/root/sbin/php-fpm /usr/bin/php-fpm
vi /etc/opt/remi/php56/php-fpm.d/www.conf
~~~
# user=apche, group=apache改成
user = nginx
group = nginx
~~~
vi /etc/nginx/default.d/default.conf
~~~
## enable php support ##
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
~~~
vi /usr/share/nginx/html/phpinfo.php
~~~
<?php
phpinfo();
~~~
systemctl enable php56-php-fpm.service
systemctl start php56-php-fpm
systemctl start nginx
# 打开浏览器
http://127.0.0.1/phpinfo.php
# 下面一大段 mysql 5.7
wget http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm
rpm -Uvh mysql57-community-release-el7-7.noarch.rpm
yum install mysql-server
systemctl start mysqld
# 这一步查看到初始密码
grep "password" /var/log/mysqld.log
# 这一步输入刚才的初始密码
mysql -uroot -p
# 以下语句在mysql的shell里执行,最后一句是设置密码
set global validate_password_policy=0;
set global validate_password_mixed_case_count=0;
set global validate_password_number_count=3;
set global validate_password_special_char_count=0;
set global validate_password_length=3;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');
# 下面这句话去除 mysql在yum仓库的记录,避免每次更新。
yum -y remove mysql57-community-release-el7-7.noarch
# 这句话查看mysql的安装配置
# mysql_config
systemctl stop mysqld
systemctl start mysqld
推荐阅读
-
Centos7.4服务器安装apache及安装过程出现的问题解决方法
-
centos7.4安装mysql的步骤和常用语句详解
-
记录阿里云ECS(Centos7.4)安装mysql 8.0.X服务
-
Centos7.4 zabbix3.4.7源码安装的方法步骤
-
CentOS7.4 源码安装MySQL8.0
-
movavi video suite 17套件 中文注册激活破解安装教程(附破解补丁下载)
-
在Apache中安装php5.6 & php7.3
-
开发套件Altova MissionKit Enterprise 2019中文企业激活+安装教程(附下载)
-
使用官方软件 三星手机PC套件怎么安装
-
Centos7:yum安装apache,编译安装php5.6,apache不解析php的解决方法