title: How can I connect php-apache and MySQL using Docker?
body: <p>I have a Wordpress site on live server and I want to create a LAMP stack locally with Docker to test things.</p>
  
  <p>I pull the images of <code>php:7.0-apache</code> and <code>mysql:5.7</code>, the same versions on live.</p>
  
  <p>I create a MySQL container:</p>
  
  <pre><code>docker run -d --name achi-mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
  </code></pre>
  
  <p>I create a php &amp; apache container and link it with MySQL:</p>
  
  <pre><code>docker run -d --name achi-php-apache --link achi-mysql:mysql -p 8080:80 -v /home/achi/workspace/web/wordpress-template/:/var/www/html php:7.0-apache
  </code></pre>
  
  <p>I get the following error on localhost:8080:</p>
  
  <p><code>Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/wp-includes/wp-db.php:1564 [...]</code></p>
  
  <p>Do I link these two containers the wrong way?</p>