tp5上传至服务器中出现各类错误的解决方法

1.连接Mysql提示1045 access denied for user 'root'@'localhost' using password yes解决方法

检查上传至服务器中的tp5中的database.php中的连接数据库的密码是否正确



2.连接Mysql提示Can’t connect to local MySQL server through socket的解决方法

a.展示出所有的mysql的进程:ps -ef | grep mysql;

b.随后清除掉所有的mysql进程:killall mysql;

c.最后重新开启mysql服务



3.连接Mysql提示500错误的解决方法

a.进入/var/www/html/项目名/runtime/,进入之后,其中有temp,log两个文件夹

[root@localhost runtime]# rm -rf log
[root@localhost runtime]# rm -rf temp

b.将两个文件夹删除掉,随后重新创建

[root@localhost runtime]# rm -rf log

[root@localhost runtime]# rm -rf temp

c.为两个文件夹赋予权限

[root@localhost runtime]# rm -rf log

[root@localhost runtime]# rm -rf temp

(另外,如果项目中含有图片会出现一样的错误,用同样的操作方法即可)

[root@localhost runtime]# cd /var/www/html/tp5/public
[root@localhost public]# ls
favicon.ico  index.php  robots.txt  router.php  static  uploads
[root@localhost public]# rm -rf uploads
[root@localhost public]# mkdir uploads

[root@localhost public]# chmod 777 uploads

d.最后重启一下apache服务

systemctl restart httpd.service






猜你喜欢

转载自blog.csdn.net/qq1719448063/article/details/80778453