Scalable-WordPress-deployment-on-Kubernetes icon indicating copy to clipboard operation
Scalable-WordPress-deployment-on-Kubernetes copied to clipboard

Error establishing a database connection

Open ghost opened this issue 6 years ago • 3 comments
trafficstars

I deployed this per the instruction on a new cluster as well as on minikube. But in both cases, when I access wordpress deployed, I got the the following displayed on the browser screen:

Warning: A non-numeric value encountered in /var/www/html/wp-config.php on line 29 Warning: A non-numeric value encountered in /var/www/html/wp-config.php on line 29 Warning: A non-numeric value encountered in /var/www/html/wp-config.php on line 29 Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-config.php:29) in /var/www/html/wp-includes/functions.php on line 3790 Error establishing a database connection

How to fix it?

ghost avatar Dec 13 '18 15:12 ghost

Can you post your wp-config.php? Seems like a config error rather than something wrong with your approach.

robalaban avatar Nov 06 '19 21:11 robalaban

Hello, maybe old issue but: 1. try create on mysql pod: mysql -u root -p mysql> CREATE DATABASE wordpress;

  1. Add in wordpress-deployment.yaml additional env with user for DB env: - name: WORDPRESS_DB_USER value: "root"

for me worked

Regards

Sarvatus avatar Mar 28 '21 13:03 Sarvatus

The comment above worked for me.

ericmbb avatar Apr 07 '21 00:04 ericmbb