1. <tfoot id='IAZCA'></tfoot>

    1. <i id='IAZCA'><tr id='IAZCA'><dt id='IAZCA'><q id='IAZCA'><span id='IAZCA'><b id='IAZCA'><form id='IAZCA'><ins id='IAZCA'></ins><ul id='IAZCA'></ul><sub id='IAZCA'></sub></form><legend id='IAZCA'></legend><bdo id='IAZCA'><pre id='IAZCA'><center id='IAZCA'></center></pre></bdo></b><th id='IAZCA'></th></span></q></dt></tr></i><div id='IAZCA'><tfoot id='IAZCA'></tfoot><dl id='IAZCA'><fieldset id='IAZCA'></fieldset></dl></div>

      <small id='IAZCA'></small><noframes id='IAZCA'>

      <legend id='IAZCA'><style id='IAZCA'><dir id='IAZCA'><q id='IAZCA'></q></dir></style></legend>
        <bdo id='IAZCA'></bdo><ul id='IAZCA'></ul>

      MySQLi 未找到 dockerized php

      时间:2023-09-24
        <tfoot id='aIoed'></tfoot>
        <i id='aIoed'><tr id='aIoed'><dt id='aIoed'><q id='aIoed'><span id='aIoed'><b id='aIoed'><form id='aIoed'><ins id='aIoed'></ins><ul id='aIoed'></ul><sub id='aIoed'></sub></form><legend id='aIoed'></legend><bdo id='aIoed'><pre id='aIoed'><center id='aIoed'></center></pre></bdo></b><th id='aIoed'></th></span></q></dt></tr></i><div id='aIoed'><tfoot id='aIoed'></tfoot><dl id='aIoed'><fieldset id='aIoed'></fieldset></dl></div>
        1. <legend id='aIoed'><style id='aIoed'><dir id='aIoed'><q id='aIoed'></q></dir></style></legend>
          • <bdo id='aIoed'></bdo><ul id='aIoed'></ul>

            <small id='aIoed'></small><noframes id='aIoed'>

              <tbody id='aIoed'></tbody>

              • 本文介绍了MySQLi 未找到 dockerized php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我正在尝试对我的网站进行 dockerize.我已经启动并运行了 Nginx 和 PHP,它正在工作,但我无法连接到数据库.加载页面时出现错误:

                I'm trying to dockerize my website. I've got Nginx and PHP up and running and it's working find except I can't connect to a db. When the page is loaded I get the error:

                Fatal error: Uncaught Error: Class 'MySQLi' not found in /private/conn.php:8 Stack trace: #0 /public_html/index.php(2): require() #1 {main} thrown in /private/conn.php on line 8
                

                我在第 8 行的连接线是:

                My connection line on line 8 is:

                $db = new mysqli("$host", "$user", "$pass", "$db", "$port");
                

                现在这曾经在我的旧设置上运行良好,但自从转移到新设置并安装 php7.1.5 后,我无法运行它.现在,我没有使用过 mysqlnd,所以这可能是我的一个误解,但 mysqlnd 包含 mysqli 驱动程序.

                Now this used to work fine on my old set up but since moving to a new one and installing php7.1.5 I can't get it running. Now, I haven't used the mysqlnd so this may be a misunderstanding on my part but the mysqlnd includes the mysqli driver.

                phpinfo 的输出:

                Output of phpinfo:

                我怎样才能让它运行?还是我现在应该使用不同的驱动程序?

                How can I get this running? Or should I be using a different driver now?

                推荐答案

                您需要在 Dockerfile 中启用 php 扩展:

                You need to enable the php extension in your Dockerfile:

                FROM php:7
                RUN docker-php-ext-install mysqli
                

                无需触摸php.ini.

                这篇关于MySQLi 未找到 dockerized php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:mysql_field_name 到新的 mysqli 下一篇:CREATE TABLE IF NOT EXISTS 失败,表已经存在

                相关文章

                最新文章

              • <legend id='S8XuT'><style id='S8XuT'><dir id='S8XuT'><q id='S8XuT'></q></dir></style></legend>
              • <small id='S8XuT'></small><noframes id='S8XuT'>

                • <bdo id='S8XuT'></bdo><ul id='S8XuT'></ul>
                  1. <tfoot id='S8XuT'></tfoot>

                    <i id='S8XuT'><tr id='S8XuT'><dt id='S8XuT'><q id='S8XuT'><span id='S8XuT'><b id='S8XuT'><form id='S8XuT'><ins id='S8XuT'></ins><ul id='S8XuT'></ul><sub id='S8XuT'></sub></form><legend id='S8XuT'></legend><bdo id='S8XuT'><pre id='S8XuT'><center id='S8XuT'></center></pre></bdo></b><th id='S8XuT'></th></span></q></dt></tr></i><div id='S8XuT'><tfoot id='S8XuT'></tfoot><dl id='S8XuT'><fieldset id='S8XuT'></fieldset></dl></div>