Invision Community 5: A video walkthrough creating a custom theme and homepage By Matt Thursday at 04:02 PM
DonnonGT Posted January 14, 2021 Posted January 14, 2021 (edited) Hello. I recently moved an Invision v4.4.10 site to a new server. I rsync'ed the files over, along with a database dump. I loaded the database on the new server and placed the files in the proper directory. The file path is identical on both servers and the database login info is correct. Whwn I try to view the site though, I get the screen below. No errors are logged anywhere I can find, when I try to view the front end of the site. If I try to view the admin area, I get the same error page, but an error is generated: [14-Jan-2021 20:14:51 UTC] PHP Fatal error: Uncaught IPS\Db\Exception: No such file or directory in /home/thebores/public_html/system/Db/Db.php:262 Stack trace: #0 /home/thebores/public_html/system/Db/Db.php(349): IPS\_Db->_establishConnection(false) #1 /home/thebores/public_html/system/Db/Db.php(480): IPS\_Db->checkConnection(false) #2 /home/thebores/public_html/system/Db/Db.php(968): IPS\_Db->preparedQuery('REPLACE INTO `c...', Array) #3 /home/thebores/public_html/system/Session/Admin.php(123): IPS\_Db->replace('core_sys_cp_ses...', Array) #4 [internal function]: IPS\Session\_Admin->write('v35ujfdism18n54...', '') #5 [internal function]: session_write_close() #6 {main} thrown in /home/thebores/public_html/system/Db/Db.php on line 262 Line 262 of the Db.php file is this: /* Store a log entry so we can track */ $this->log( "Connected to the " . $logDatabase, ( $read and $this->connectionDetails['readDatabase'] ) ? 'read' : 'write' ); /* If the connection failed, throw an exception */ if( $error ) { Line 262 >>> throw new \IPS\Db\Exception( $error, $errno ); } I added the 'Line 262 >>>' part. Anyway, it seems like it can't connect to the database, but everything looks correct in the settings. I installed instance of Invision v4.4.2 that I own on another account on the same server and it runs fine, so the server is properly set up for the software. I ran the compatability test script on the site having problems and got the following: Host: localhost User: *********** Database: ************* $mysql = new mysqli( $INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass'], $INFO['sql_database'], isset( $INFO['sql_port'] ) ? intval( $INFO['sql_port'] ) : NULL, isset( $INFO['sql_socket'] ) ? $INFO['sql_socket'] : NULL ); $installOnly = FALSE; ?> Notice: Undefined variable: mysql in /home/thebores/public_html/iPSTesT.php on line 308 Notice: Trying to get property 'server_info' of non-object in /home/thebores/public_html/iPSTesT.php on line 308 Notice: Undefined variable: mysql in /home/thebores/public_html/iPSTesT.php on line 310 I modified the script to print some of the variables from the config_global.php file, to make sure it was reading and parsing it correctly. The variables were correct. I am stumped. If anyone has any ideas what could be causing this trouble, I would really appreciate some help. Thanks. Edited January 14, 2021 by DonnonGT
CoffeeCake Posted January 14, 2021 Posted January 14, 2021 Is the mysql extension enabled/installed in php?
DonnonGT Posted January 14, 2021 Author Posted January 14, 2021 5 minutes ago, Paul E. said: Is the mysql extension enabled/installed in php? Like I said, there is another Invision site running properly on this server. The server itself seems to be set up ok. The new Invision site installed without a hitch. The problem is with the transferred site. It would be a lot easier if the system were giving me any meaningful (to me) error messages. I am at a loss.
CoffeeCake Posted January 14, 2021 Posted January 14, 2021 (edited) 14 minutes ago, DonnonGT said: The server itself seems to be set up ok. It doesn't seem that way. I think you're getting meaningful messages. It may not tell you exactly what you need to do, but there are a lot of hints here. Connecting to the database is a challenge. You should verify you're using the correct connection information in conf_global.php and verify that mysqli is enabled by taking a look at the output of phpinfo. Create a file on your web server, calling it something like test.php, and make the contents of the file: <?php phpinfo(); Visit that page and confirm that the mysqli extension is enabled and installed. Separately, ensure you can connect via SSH from your server to your database server using the username, host, and password from your conf_global.php file. If you're in an environment where you have sandboxed accounts that you are purchasing from a hosting company, it's entirely possible that your php configuration is separately maintained from that of another account on the same physical server. Verify everything you're assuming to be true, until you get to the place where you've narrowed down things. I'd also verify that your rsync commands preserved permissions and that the ownership of files and directories is correct with what your new server is expecting. The IPS4 testing script you used should tell you if there are issues with directory permissions. Edited January 14, 2021 by Paul E.
DonnonGT Posted January 14, 2021 Author Posted January 14, 2021 2 minutes ago, Paul E. said: It doesn't seem that way. I think you're getting meaningful messages. It may not tell you exactly what you need to do, but there are a lot of hints here. Connecting to the database is a challenge. You should verify you're using the correct connection information in conf_global.php and verify that mysqli is enabled by taking a look at the output of phpinfo. Create a file on your web server, calling it something like test.php, and make the contents of the file: <?php phpinfo(); Visit that page and confirm that the mysqli extension is enabled and installed. Separately, ensure you can connect via SSH from your server to your database server using the username, host, and password from your conf_global.php file. If you're in an environment where you have sandboxed accounts that you are purchasing from a hosting company, it's entirely possible that your php configuration is separately maintained from that of another account on the same physical server. Verify everything you're assuming to be true, until you get to the place where you've narrowed down things. I'd also verify that your rsync commands preserved permissions and that the ownership of files and directories is correct with what your new server is expecting. The IPS4 testing script you used should tell you if there are issues with directory permissions. I checked the phpinfo link on the compatability script and mysqli is loaded. I modified the script to echo the variables from the config_global.php when the script ran and the variables were correct. So, the script could properly read and parse the config file. I've logged in to myswql from the command line, using the variables in the config file. They worked fine. I don't know what else to check.
CoffeeCake Posted January 14, 2021 Posted January 14, 2021 Ensure your php files are not corrupted somehow in the event things did not work as planned with rsync. Back everything up, and replace the files from a fresh copy downloaded from the client area. If php can't connect to your mysql server, then you may need to engage the help of your hosting provider.
Miss_B Posted January 14, 2021 Posted January 14, 2021 1 hour ago, DonnonGT said: Hello. I recently moved an Invision v4.4.10 site to a new server. I rsync'ed the files over, along with a database dump. I loaded the database on the new server and placed the files in the proper directory. The file path is identical on both servers and the database login info is correct. Whwn I try to view the site though, I get the screen below. No errors are logged anywhere I can find, when I try to view the front end of the site. If I try to view the admin area, I get the same error page, but an error is generated: [14-Jan-2021 20:14:51 UTC] PHP Fatal error: Uncaught IPS\Db\Exception: No such file or directory in /home/thebores/public_html/system/Db/Db.php:262 Stack trace: #0 /home/thebores/public_html/system/Db/Db.php(349): IPS\_Db->_establishConnection(false) #1 /home/thebores/public_html/system/Db/Db.php(480): IPS\_Db->checkConnection(false) #2 /home/thebores/public_html/system/Db/Db.php(968): IPS\_Db->preparedQuery('REPLACE INTO `c...', Array) #3 /home/thebores/public_html/system/Session/Admin.php(123): IPS\_Db->replace('core_sys_cp_ses...', Array) #4 [internal function]: IPS\Session\_Admin->write('v35ujfdism18n54...', '') #5 [internal function]: session_write_close() #6 {main} thrown in /home/thebores/public_html/system/Db/Db.php on line 262 The full file paths can not be identical in 2 different server a.f.a.i.k. When you say "I loaded the database on the new server", what does that mean preciesly? Did you create a new database on the new server, restored the backup there and entered the info of the new database at the config file? The very first error points to missing files btw. Can you check and make sure that everything is transferred properly? How did you transfer the forum files? Did you use a ftp client like FileZilla?
DonnonGT Posted January 14, 2021 Author Posted January 14, 2021 I dumped the virtual server container the site was hosted in on the new box and started from scratch. I recreated the container, transferred the data, reloaded the DB, set the config variables and it looks like it is now working. I'm guessing that something got corrupted in the rsync, or there was a glitch in the virtual server. Either way, it is working now. Thanks for everyone's input. It is appreciated. Eric
CoffeeCake Posted January 14, 2021 Posted January 14, 2021 1 hour ago, DonnonGT said: I rsync'ed the files over, along with a database dump. I loaded the database on the new server and placed the files in the proper directory. The file path is identical on both servers and the database login info is correct. Whwn I try to view the site though, I get the screen below. He stated he used rsync, and identical file paths. It's entirely possible that the filepaths are the same (we've had the same file paths across moves on many different servers, but this is an intentional decision we make in provisioning new hardware). Something is loading, so at least some of the files are there. I wonder if some of the files are not there, and if some of the files did not fully copy. Here's interesting discussion on verifying that the files came over intact: https://techblog.jeppson.org/2014/10/verify-backup-integrity-with-rsync-sed-cat-and-tee/ 1 minute ago, DonnonGT said: Either way, it is working now. Great news! DonnonGT 1
DonnonGT Posted January 14, 2021 Author Posted January 14, 2021 1 minute ago, Paul E. said: He stated he used rsync, and identical file paths. It's entirely possible that the filepaths are the same (we've had the same file paths across moves on many different servers, but this is an intentional decision we make in provisioning new hardware). Something is loading, so at least some of the files are there. I wonder if some of the files are not there, and if some of the files did not fully copy. Here's interesting discussion on verifying that the files came over intact: https://techblog.jeppson.org/2014/10/verify-backup-integrity-with-rsync-sed-cat-and-tee/ Great news! I really hate a bug hunt, but it always feels good to resolve it. I've been doing this stuff a long time and I've conquered a lot of bugs, but they keep building better ones. Eric
bfarber Posted January 15, 2021 Posted January 15, 2021 This is related to an inability to connect to MySQL for some reason. I'm glad you got it resolved. For reference, this may be of help to anyone else who hits this in the future: https://stackoverflow.com/questions/1676688/mysql-connection-not-working-2002-no-such-file-or-directory
Rob Coldwell Posted October 11, 2022 Posted October 11, 2022 I'm a little late to this thread, but just wanted to confirm that I too had the same problem. Couldn't connect to MySQL. This was solved by changing from 'localhost' to '127.0.0.1' in the conf_global.php file. Mike G. and DSystem 2
Marc Posted October 11, 2022 Posted October 11, 2022 That is a server setup issue, rather than than anything else. localhost simply isnt set up to point to 127.0.0.1
Recommended Posts