I have restarted the database and the app,
but unfortunately i now get a new error:
Connections using insecure transport are prohibited while --require_secure_transport=ON.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to transfer a wordpress webiste to Azure App service.
I have run an App Service plan containing: Azure Database for MySQL flexible server and the App service.
After that, I had moved all files of my website into the Azure FTP and I was able to import the old database via : webiste.azurwebsite.net/phpmyadmin (this only after I had increased the max upload size modifying the file /usr/local/etc/php/conf.d/uploads.ini from
https://yoursitename.scm.azurewebsites.net/webssh/host).
I have then updated the wp-config with the right table_prefix, db name,user,password,host.
I still get this error: Error establishing a database connection
Warning
: mysqli_real_connect(): php_network_getaddresses: getaddrinfo for webiste-ec46456440-pdbserver.mysql.database.azure.com failed: Name or service not known in
/var/www/wordpress/wp-includes/class-wpdb.php
on line
1982
Warning
: mysqli_real_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo for website-ec46456440-pdbserver.mysql.database.azure.com failed: Name or service not known in
/var/www/wordpress/wp-includes/class-wpdb.php
on line
1982
php_network_getaddresses: getaddrinfo for
nottebland-ec46456440-pdbserver.mysql.database.azure.com failed: Name or
service not known
I have restarted the database and the app,
but unfortunately i now get a new error:
Connections using insecure transport are prohibited while --require_secure_transport=ON.
Hello MagoMerlino,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you are having issue with your Azure App service and Azure database while migrating.
Regarding the information provided, the below are the steps you can use to resolve the issue:
<server-name>.mysql.database.azure.com
wpdbserver
vs. pdbserver
).https://<app-name>.scm.azurewebsites.net/webssh/host
).nslookup <db-hostname>
to verify DNS resolution.telnet <db-hostname> 3306
to check if port 3306 is reachable.In this step 2:
DigiCertGlobalRootCA.crt.pem
)./home/site/wwwroot/ssl/
(create the ssl
directory if needed). // Database settings
define('DB_HOST', 'correct-hostname.mysql.database.azure.com');
define('DB_USER', 'user@mysql-server-name'); // Format: 'user@server-name'
define('DB_PASSWORD', 'password');
define('DB_NAME', 'database-name');
// SSL Configuration
define('MYSQL_CLIENT_FLAGS', MYSQLI_CLIENT_SSL);
define('MYSQL_SSL_CA', '/home/site/wwwroot/ssl/DigiCertGlobalRootCA.crt.pem');
mysql
CLI:
ALTER USER 'wp_user'@'%' REQUIRE SSL;
FLUSH PRIVILEGES;
This is the third step:
require_secure_transport=ON
. Instead, enforce SSL as above.If you can follow the steps above, the hostname typo and DNS resolution issues will be resolved, SSL is correctly configured using the Azure CA certificate, and the MySQL user is now required to use SSL in accordance with require_secure_transport=ON
, ensuring that the WordPress site connects to the database securely and without errors.
I hope this is helpful! Do not hesitate to let me know if you have any other questions.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.