简体   繁体   中英

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

The website is in Laravel 5.2.45 with Postgres.

The old VPS configuration is CentOs 7 with 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

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. 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.

Successfully updated composer, done with firewall-cmd, SeLinux setup

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

[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

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.

-> 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

bootstrap/cache

for any data mismatch and old data from old server. you can easily update config.php to current new state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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