简体   繁体   English

更改 laravel vps 托管导致提交 [$_POST] 登录/注册页面时出现 HTTP 错误 500

[英]changing laravel vps hosting caused HTTP ERROR 500 on submitting [$_POST] login/signup page

The website is in Laravel 5.2.45 with Postgres.该网站位于 Laravel 5.2.45,带有 Postgres。

The old VPS configuration is CentOs 7 with PHP 7.0, nginx/1.20.1, Composer version 1.9.0, PostgreSQL旧的VPS配置是CentOs 7 和PHP 7.0, nginx/1.20.1, Composer version 1.9.0, PostgreSQL

psql --version
psql (PostgreSQL) 9.2.24

. .

The new VPS configuration is CentOs 7 with PHP 7.1, nginx/1.20.1, Composer version 2.2.12, PostgreSQL新的VPS配置是CentOs 7和PHP 7.1,nginx/1.20.1,Composer版本2.2.12,PostgreSQL

psql --version
psql (PostgreSQL) 14.2

After making a transfer of the files using ()使用 () 传输文件后

rsync -avz /srv/www/ root@host:/srv/www 

For the database transfer, " pg_dump " is used to back up the old database, and " pg_restore " is used to restore to the new database.对于数据库传输,“ pg_dump ”用于备份旧数据库,“ pg_restore ”用于恢复到新数据库。 The scripts are脚本是

pg_dump -F t old_db > old_db.tar 
pg_restore --dbname=new_db --verbose old_db.tar

I dare to upgrade from PostgreSQL version 9 to 14 based on this article: The pg_restore can take a database backed up in the older version and restore it in the newer version.我敢于从 PostgreSQL 版本 9 升级到 14 基于这篇文章: pg_restore can take a database backup in the older version and restore it in the newer version。

Successfully updated composer, done with firewall-cmd, SeLinux setup成功更新 composer,完成 firewall-cmd,SeLinux 设置

semanage fcontext -a -t httpd_sys_content_t '/srv/www(/.*)?'
restorecon -Rv /srv/www

after these setups, the website is accessible fine.完成这些设置后,网站就可以正常访问了。 But when I try to log in (admin or user) or sign up, I'm getting但是当我尝试登录(管理员或用户)或注册时,我得到了

This page isn’t working
www.domain.com is currently unable to handle this request.
HTTP ERROR 500

In the Nginx access_log, getting the following response在Nginx access_log中,得到如下响应

[19/Apr/2022:06:52:35 +0000] "POST /login HTTP/2.0" 500 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"

There is neither entry for this event in Nginx error_log, nor anything in the Laravel_log Nginx error_log 中既没有此事件的条目,也没有 Laravel_log 中的任何内容

If anyone knows the reason behind this behavior.如果有人知道这种行为背后的原因。 Please, I need your appreciable guide to solve this.拜托,我需要您的指导来解决这个问题。

Appendix:附录:

-> I have also installed and set the pgadmin4 with apache on a distinct port xxxxxx on the new VPS. -> 我还在新 VPS 上的不同端口 xxxxxx 上安装并设置了带有 apache 的 pgadmin4。

-> The old server is still intact and is able to get the website fine for all things. ->旧服务器仍然完好无损,能够使网站正常运行。

-> Don't think composer version mismatch could be the reason. -> 不要认为作曲家版本不匹配可能是原因。

Check your config.php in检查你的config.php

bootstrap/cache引导程序/缓存

for any data mismatch and old data from old server.对于任何数据不匹配和来自旧服务器的旧数据。 you can easily update config.php to current new state.您可以轻松地将 config.php 更新为当前新的 state。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM