Hey gang! Hope everyone is well. I'm experiencing a strange issue during a server migration. Let's begin with the specs:
Centos 8 stream
three other elk installations migrated flawlessly and continue operating perfectly. The migrated domain serves static files and simple php files fine. For example, a test.php containing the phpinfo() function displays the information one would expect. Also, phpmyadmin is operational through the domain.
The domain in question returns a 500 error accessing index.php. No errors show in the server logs. Attempting repair_settings.php use returns a 503 error and this in the server error log:
[font=Consolas, "Courier New", monospace]thrown in /home/name/sources/database/Db-mysql.class.php on line 77" while reading response header from upstream, client: 22.214.171.124, server: name.com, request: "GET /repair_settings.php HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "www.name.com"
2021/10/26 02:07:42 [error] 330265#330265: *16 FastCGI sent in stderr: "PHP message: PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/name/repair_settings.php on line 68PHP message: PHP Fatal error: Uncaught Error: Class 'Errors' not found in /home/name/sources/database/Db-mysql.class.php:77
#0 /home/name/sources/database/Database.subs.php(33): Database_MySQL::initiate()
#1 /home/name/repair_settings.php(120): elk_db_initiate()
#2 /home/name/repair_settings.php(21): initialize_inputs()
thrown in /home/name/sources/database/Db-mysql.class.php on line 77" while reading response header from upstream, client: xxxxxx, server: name.com, request: "GET /repair_settings.php HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "www.name.com"
[/font][/size][/color]It's as though elk is not connecting to the database? I"ve verified the information in settings.php time and again. I reset the database user and password in phpmyadmin. I even dropped the database and user, recreated, and still no dice. Am I way off base? I'm stumped! Anyone have ideas? Thanks!
That would indicate its not connecting to the database (setting aside the rest of the errors).
You can try a simple script to connect and maybe capture the error.
$db_server = "localhost";
$db_user = "username";
$db_passwd = "password";
$db_name = "elkarte";
$db_port = 0;
$connection = mysqli_connect($db_server, $db_user, $db_passwd, $db_name, $db_port);
Thanks spuds! It's good and bad news. The good news is the script works, and the file successfully connects to the database. So that's working. The bad news is I still don't know the problem. I reuploaded freshly transferred sources and themes directories along with top level files from the formerly working installation. File ownership and permissions have all be set (again). What else is there?
Humm ... what happens when you try to bring up yoursite/ssi_examples.php ?
OK, I got this sorted. Here's the lowdown, lest it helps anyone else. The sites migrating easily/successfully had Simple Portal in Integration Mode. Transferring files then importing the database worked without issue. The problematic domain had SP disabled.
Solution? On the old server SP reenabled, export the database, import the db on the new server, point the DNS, run repair_settings.php, and voila!! No problem. Disable SP again and everything is up and running.
Thanks for your help @Spuds
Thanks for posting the fix, glad things are back up :D
Thanks man. Admittedly it was a bit maddening. Hours of WTH is wrong!?!?!? followed by questioning sanity. OK, the last part is untrue. There's nothing left to question. :D :D But it's fixed. 8)