您的位置:首页 > 运维架构 > Linux

linux如何部署php+mysql项目

2018-04-04 16:57 441 查看
大概是两周前弄的吧,一直忘记记录下来了,现在记录只能根据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 *
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: