衡阳的网站建设,南通网站推广公司哪家好,需要优化的网站有哪些,有关做网站项目的毕业答辩laravel线上部署问题 一、Ubuntu远程Mysql 61“Connection refused”二、Ubuntu更新php8三、线上部署Permission denied3.1、部署完之后访问域名出现报错#xff1a;3.2、The /bootstrap/cache directory must be present and writable. 四、图片访问404五、git部署线上文件 一… laravel线上部署问题 一、Ubuntu远程Mysql 61“Connection refused”二、Ubuntu更新php8三、线上部署Permission denied3.1、部署完之后访问域名出现报错3.2、The /bootstrap/cache directory must be present and writable. 四、图片访问404五、git部署线上文件 一、Ubuntu远程Mysql 61“Connection refused”
Ubuntu 20.04.1线上数据库mysql连不上有可能是线上mysql的配置为只本地访问到我们需要修改线上mysql的配置运行命令cd /etc/mysql/mysql.conf.d然后运行命令sudo nano mysqld.cnf 找到bind-address 127.0.0.1 改为bind-address 0.0.0.0 control x保存退出后输入命令sudo systemctl restart mysql.service重启mysql。 如果还是连接不上的话就查看防火墙mysql的端口是否开放。
二、Ubuntu更新php8
运行命令sudo add-apt-repository ppa:ondrej/php sudo apt-get update Tips 有报错请看无报错忽略 报错sudo: add-apt-repository: command not found 解决先运行命令 apt-get -y install software-properties-common再执行命令sudo add-apt-repository ppa:ondrej/php sudo apt-get update提示按enter就按enter。 接着运行sudo apt install php8.2.9具体看你安装哪个版本接着安装相对应的扩展只需将版本号加上即可。例如apt install php8.2.9-curl
三、线上部署Permission denied
3.1、部署完之后访问域名出现报错
UnexpectedValueException
The stream or file /var/www/furniture-maintenance-api/storage/logs/laravel.log could
not be opened in append mode: Failed to open stream: Permission denied The exception
occurred while attempting to log: The stream or file /var/www/furniture-maintenance-
api/storage/logs/laravel.log could not be opened in append mode: Failed to open
stream: Permission denied The exception occurred while attempting to log: The
/var/www/furniture-maintenance-api/bootstrap/cache directory must be present and
writable. Context: {exception:{}} Context: {exception:{}}权限不足我们运行命令chmod -R 777 storage
3.2、The /bootstrap/cache directory must be present and writable.
部署完之后报错The /bootstrap/cache directory must be present and writable. 运行命令php artisan cache:clea
四、图片访问404
如果发现部署线上图片访问404那么我们运行命令php artisan storage:link如果还是不行的话那么将/public下的storage删了重新运行这个命令php artisan storage:link。 如果还是404的话请查看线上storage/app/public是否有文件。
五、git部署线上文件
先将本地代码进行git仓库连接此步骤可以网上搜索。 在终端进行ssh root你的公网ip输入密码进行连接线上服务器后进入到目录/var/www后我们把刚刚本地代码克隆下来 git clone 你本地代码的远程仓库连接这样就完成了git部署线上文件。 在学习php的路上如果你觉得本文对你有所帮助的话那就请关注点赞评论三连吧谢谢你的肯定是我写博的另一个支持。