title: PHP and MySQLi on a Ubuntu Nginx Server
body: <p>I have been trying to use php in an Nginx server. I can't use Apache2 server. It's already in production. I have installed all the necessary requirements to run the duplicator (for Wordpress backup installation). But, it kept saying,</p>
  <blockquote>
  <p>Support for the PHP mysqli extension is required. Please contact your hosting provider or server administrator to enable the mysqli extension. The detection for this call uses the function_exists('mysqli_connect') call.</p>
  </blockquote>
  <p>Stack configuration:</p>
  <ul>
  <li>Php: 7.2</li>
  <li>Ubuntu: 18.04 L</li>
  <li>Mysql: 5.7.32-0ubuntu0.18.04.1</li>
  <li>Nginx: 1.14.0 (Ubuntu)</li>
  </ul>
  <p>When I run <code>sudo apt insall php-mysql</code>, the result is</p>
  <p><code>php-mysql is already the newest version (1:7.2+60ubuntu1).</code></p>
  <p>Result of <code>php -m | grep mysqli</code></p>
  <pre><code>PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqlnd.so' (tried: /usr/lib/php/20170718/mysqlnd.so (/usr/lib/php/20170718/mysqlnd.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqlnd.so.so (/usr/lib/php/20170718/mysqlnd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  
  PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so.so (/usr/lib/php/20170718/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  
  PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql.so' (tried: /usr/lib/php/20170718/pdo_mysql.so (/usr/lib/php/20170718/pdo_mysql.so: undefined symbol: mysqlnd_allocator), /usr/lib/php/20170718/pdo_mysql.so.so (/usr/lib/php/20170718/pdo_mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  </code></pre>
  <p>And finally since I am using php-fpm, snippets from php.ini file is</p>
  <pre><code>extension=mysqli  &lt;&lt;&lt; Current Configuration
  ;extension=/etc/php/7.2/mods-available/mysqli.ini  &lt;&lt;&lt; Tried this
  ;extension=mysqli.so &lt;&lt;&lt; Tried This
  </code></pre>
  <h1>Edit 1</h1>
  <p>Information from <code>php info()</code></p>
  <pre><code>PHP Version 7.2.24-0ubuntu0.18.04.7
  </code></pre>
  <pre><code>/etc/php/7.2/fpm/conf.d/20-mysqli.ini, 
  /etc/php/7.2/fpm/conf.d/20-pdo_mysql.ini,
  </code></pre>