Docker + WordPress – get this error “Fatal error: Uncaught Error: Call to undefined function mysql_connect()”

Home / Uncategorized / Docker + WordPress – get this error “Fatal error: Uncaught Error: Call to undefined function mysql_connect()”

Question:
I am using Docker to run my old WordPress project. After migrating on Docker i get this error:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/wp-includes/wp-db.php:1570 Stack trace: #0 /var/www/html/wp-includes/wp-db.php(658): wpdb->db_connect() #1 /var/www/html/wp-includes/load.php(404): wpdb->__construct(‘wordpress_user’, ‘secret’, ‘wordpress_acade…’, ‘academy-mysql:3…’) #2 /var/www/html/wp-settings.php(106): require_wp_db() #3 /var/www/html/wp-config.php(122): require_once(‘/var/www/html/w…’) #4 /var/www/html/wp-load.php(37): require_once(‘/var/www/html/w…’) #5 /var/www/html/wp-blog-header.php(13): require_once(‘/var/www/html/w…’) #6 /var/www/html/index.php(17): require(‘/var/www/html/w…’) #7 {main} thrown in /var/www/html/wp-includes/wp-db.php on line 1570

I tried following things: – add mysql extensions to Dockerfile – remove plugins – change theme But without success.

Can someone help me?


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *