Hello/Hi/Greetings,
My name is George and I am having trouble with installing Piwigo on my remote server. I have already installed Piwigo on my local PC running under Apache and everything is working perfectly. However, on my remote site attempts to install Piwigo, I am always getting an error message that says "Cannot connect to server". I have checked my database and the table for Piwigo has been inserted properly. Also on the installation page with the various parameters that must be filled into the fields with the proper information - they have all been filled out properly. Nonetheless, I am always getting an error message that indicates line 52is causing an error in /piwigo/include/dblayer/functions_mysqli.inc.php
Here are the lines of code where the error is coming
50 $dbname = '';
51
52 $mysqli = new mysqli($host, $user, $password, $dbname, $port, $socket);
53 if (mysqli_connect_error())
54 {
55 throw new Exception("Can't connect to server");
56 }
I cannot understand why line 50 shows $dbname = ''; - i.e. the database name is blanked out before the SQL connection is even tried in line 52:
My remote server environment is run on Linux.
Can you help me?
Thank you,
George
Offline
In that step only the connection to the database server is tried without attempting to access a database yet, hence $dbname is empty. The database is selected in the next line 57 you omitted:
if (!$mysqli->select_db($database))
You could temporarily insert a statement before line 55 to error_log() the actual $mysqli->connect_error to maybe shed some light. See https://www.php.net/manual/en/mysqli.connect-error.php
Offline