How to install pdo driver in php docker image?
<p>I am using as a base the <a href="https://hub.docker.com/_/php/" rel="noreferrer">php docker container</a> with the tag:</p>



<pre class="lang-none prettyprint-override"><code>php:5.6-apache
</code></pre>

<p>I linked it with a basic <code>mysql:5.6</code> image which I can reach at the host <code>mysql</code>. I created a DB, and filled a table with basic values.</p>

<p>Yet trying to access my app, I get:</p>

<pre class="lang-none prettyprint-override"><code>Fatal error: Uncaught exception 'PDOException' with message
could not find driver' in /var/www/html/index.php:30 
Stack trace: #0 [internal function]: 
PDO-&gt;__construct('mysql:host=mysq...', 'root', 'root', Array) 
#1 [internal function]: Phalcon\Db\Adapter\Pdo-&gt;connect(Array)
#2 /var/www/html/index.php(30): Phalcon\Db\Adapter\Pdo-__construct(Array)
#3 [internal function]: {closure}()
#4 [internal function]: Phalcon\Di\Service-&gt;resolve(NULL, Object(Phalcon\Di\FactoryDefault))
#5 [internal function]: Phalcon\Di-&gt;get('db', NULL)
#6 [internal function]: Phalcon\Di-&gt;getShared('db')
#7 [internal function]: Phalcon\Mvc\Model\Manager-&gt;_getConnection(Object(Reviews), NULL)
#8 [internal function]: Phalcon\Mvc\Model\Manager-&gt;getReadConnection(Object(Reviews))
#9 [internal function]: Phalcon\Mvc\Model-&gt;getReadConnection()
#10 [internal function]: Phalcon\Mvc\Model\MetaData\Strategy\Introspection-&gt;getMetaData(Object(Reviews), Object(Phalcon\Di\FactoryDefault))
#11 [internal function]: Phalcon\Mvc\Model\MetaData-&gt;_initialize(Object(Rev in /var/www/html/index.php on line 30
</code></pre>

<p>Hence, I thought that the php container was lacking the <code>php-mysql</code> component I installed via:</p>

<pre class="lang-none prettyprint-override"><code>apt-get install php5-mysql
</code></pre>

<p>I also added a mysql.ini at:</p>

<pre class="lang-none prettyprint-override"><code>cat /usr/local/etc/php/conf.d/mysql.ini
; configuration for php MySQL module
; priority=20
extension=pdo_mysql.so
</code></pre>

<p>If I <code>echo phpinfo();die</code> it tells me that:</p>

<pre class="lang-none prettyprint-override"><code>Additional .ini files parsed:
    /usr/local/etc/php/conf.d/mysql.ini,
    /usr/local/etc/php/conf.d/phalcon.ini
</code></pre>

<p>Yet still, the error persists.</p>

<p>Furthermore, when running:</p>

<pre class="lang-none prettyprint-override"><code>php -i|grep PDO
</code></pre>

<p>I get:</p>

<pre class="lang-none prettyprint-override"><code>PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PDO
PDO support =&gt; enabled
PDO drivers =&gt; sqlite
PDO Driver for SQLite 3.x =&gt; enabled
</code></pre>

<p>so it seems the mysql extension isn't even activated.</p>

<p>What am I doing wrong?</p>