linux如何部署php+mysql项目

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_37681914/article/details/79819720

大概是两周前弄的吧,一直忘记记录下来了,现在记录只能根据history来粘贴一些了,没太多精力再去弄一遍,就简要记录一下吧。

#安装apache服务器
yum install httpd -y
/etc/init.d/iptables status
#启动
systemctl start httpd.service
#设置开机启动
systemctl enable httpd.service
#安装php
yum install php php-devel
systemctl restart httpd.service
systemctl start mariadb.service
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc


#列出旧的mysql
yum list installed | grep mysql
#删除旧的mysql
yum -y remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
whereis mysql
rm -rf /usr/lib64/mysql
rm –rf /usr/my.cnf
rm -rf /root/.mysql_sercret
rm -rf /var/lib/mysql
rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm

#安装新的mysql
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
mv mysql57-community-release-el7-8.noarch.rpm home/
cd home/
mkdir zouweijun
mv mysql57-community-release-el7-8.noarch.rpm  ./zouweijun/
cd zouweijun
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum install mysql-community-server
systemctl status mysqld
systemctl enable mysqld
systemctl daemon-reload

yum install mysql-community-server
yum install -y mysql-server mysql mysql-devel
#启动mysql
service mysql start
#开机启动
systemctl enable mysql.service


#php项目部署到/var/www/html 下,重启服务后,遇到了缓存文件写入失败,/App/Runtime/Cache,一般都是权限问题,把该文件的权限设置为777
chmod -R 777 *

猜你喜欢

转载自blog.csdn.net/m0_37681914/article/details/79819720