Are you accessing this server locally (not really any need for https if that is the case), or using a fully formed domain name address to do it (e.g. your diskstation is being served up to the internet with an https domain name?)
I access the server locally, when I am administering it (with the Synology DSM= DiskStationManager)
I access the server via internet, when I am using several Android Apps which are using an MySQL database on my server (and there I get the message 301 Movement Permanently) The Smartphone uses WLAN or mobile phone network
Hello everybody,
my problem is still unsolved: The access to a mysql-database is no longer working from my apps since I changed the domain from http to https. Meanwhile I could avoid the above mentioned error message (Error 301 Movement Permanently) by changing the URL variable from http to https. But there is still no response from my mysql database hosted on my server.
I think, that the solution should be found in the mysql.php (updated from Taifun and adopted by me):
/CONFIG****/
//DATABSE DETAILS//
//$servername = "localhost:/run/mysqld/mysqld10.sock"; falsch!
$servername = "localhost";
$username = "root";
$password = "1August2";
$dbname = "android";
$port = "3307";
$socket = "/run/mysqld/mysqld10.sock";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname, $port, $socket);// Check connection
if (!$conn) {
die("Die Verbindung hat nicht geklappt: " . mysqli_connect_error());
}
//echo "Die Verbindung war erfolgreich!";
/*
$DB_ADDRESS="";
$DB_USER="";
$DB_PASS="";
$DB_NAME=""; /
//SETTINGS//
//This code is something you set in the APP so random people cant use it.
$SQLKEY="bovistwobist";
/CONFIG***/ Rest of program is untouched
I changed the “http” in this php program into “https”, but was not successful. Perhaps Taifun has any idea??
Thank you in advance/opowoj
Hi Taifun,
thank you for your reply. Meanwhile I changed my Wordpress adress to "https://retslop-subdom5a.synology.me/wp-content/uploads/PHP_SQL-Tests/mysql_neu.php" and indeed, this URL returns "Bad request"... What does this mean?? The adress is correct....
But this does not solve my problem. Before I changed to https, the apps worked with http....
My test app does not report "Bad request". It just does not pick up foto from the database...
In the app blocks I refer to the field "num" which is a key. How shall a change my request? I upload the query block: I use a URL only to define the adress for the php file. In this php file I defined a sqlkey (see above) in the config part.I use this key in the blocks, see upload:
The php script is to be used by your app and not in a Browser... the Browser test is only to check, if the URL is correct... and Bad request means, it is correct... just continue with your tests in your app
Hi Taifun,
meanwhile I continued testing and finally with my simpliest app, I got the following error message:HathaYogaApp_Error_Variables_Block.pdf (1.1 MB) Do you see the wrong detail?
I have no problem in adressing any PHP or HTML file from AI2 (see no 13) , i.e. to open a mysql database. If I continue in PHP, the Select operator works too. So it does not sound logic very much, to be a server problem....
I added "mysqli_set_charset($conn, "utf8");" before the connection statement. But no effect on the query...
Which sounds like a server issue then...
Probably your server is not able to accept Post requests anymore? You might want to ask your Web host support...
the server is my own server (hosted on my Synology NAS called Webstation). It is able to accept Post requests from Windows with HTML and PHP, but no longer from AI2. Please see my remarks beginning with 9/18 from Jul 31.