久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

    1. <legend id='a6ViG'><style id='a6ViG'><dir id='a6ViG'><q id='a6ViG'></q></dir></style></legend>

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

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

        命令行 php mysqli 失敗,但可通過 Web 服務(wù)器運(yùn)行并

        Command line php mysqli fails but works via web server and works in local(命令行 php mysqli 失敗,但可通過 Web 服務(wù)器運(yùn)行并在本地運(yùn)行)
        <tfoot id='ptISX'></tfoot>

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

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

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

                <tbody id='ptISX'></tbody>
                  本文介紹了命令行 php mysqli 失敗,但可通過 Web 服務(wù)器運(yùn)行并在本地運(yùn)行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個 shell 腳本,它調(diào)用一個 php 腳本在解析文本文件后在數(shù)據(jù)庫中插入記錄.當(dāng)它調(diào)用 PHP 腳本時,我收到找不到 mysqli 的錯誤:

                  I have a shell script that calls a php script to insert records in database after parsing text file. When it calls the PHP script I get errors that it cannot find mysqli:

                  PHP Fatal error:  Class 'mysqli' not found in /path/to/php/file.php on line 5
                  

                  這在使用 Nginx 和 PHP-FPM 以及 Mysql 5.5.x 的 Macbook Pro 本地失敗,在我將套接字參數(shù)添加到 mysqli 調(diào)用后,它在本地工作.這適用于本地數(shù)據(jù)庫!

                  This failed in local on Macbook Pro with Nginx and PHP-FPM and Mysql 5.5.x and after I added the socket param to mysqli call, it worked in local. This worked with local db!

                  $mysqli = new mysqli("localhost", "user", "pass", "mydb", 3306, "/tmp/mysql.sock");
                  

                  我部署到 Linux 服務(wù)器(安裝了yum install php"和 PHP 5.3.x 的 CentOS6).我更改了與遠(yuǎn)程數(shù)據(jù)庫服務(wù)器的連接,因此刪除了/tmp/mysql.sock",因為數(shù)據(jù)庫未在此服務(wù)器上運(yùn)行.

                  I deployed to Linux server (CentOS6 that has 'yum install php' with PHP 5.3.x) installed. I changed the connection to a remote db server so dropped the "/tmp/mysql.sock" because db not running on this server.

                  shell腳本調(diào)用php執(zhí)行腳本:

                  Shell script calling php to execute script:

                  php -c "/etc/php.ini" -f "/path/to/php/file.php"
                  

                  鑒于我沒有在本地運(yùn)行 mysql,如何讓它識別 mysqli 庫并執(zhí)行.它在 CentOS6 上.我什至嘗試將 mysqli.so 添加到 php.ini 文件并得到以下錯誤:

                  Given I am not running mysql locally, how do I get it to recognize the mysqli lib and execute. It's on CentOS6. I even tried adding mysqli.so to php.ini file and got following error:

                  [mike@app2 myapp]# php -version
                  PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysqli.so' - /usr/lib64/php/modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
                  PHP 5.3.3 (cli) (built: Feb  2 2012 23:47:49) 
                  Copyright (c) 1997-2010 The PHP Group
                  Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
                  

                  感謝您幫助解決此問題.通常我會使用 mysql(query) 但需要 mysqli() 來處理一些準(zhǔn)備好的語句和腳本中的其他位.

                  Thanks for any help resolving this. Normally I'd use mysql(query) but need mysqli() for some prepared statements and other bits in the script.

                  推薦答案

                  發(fā)現(xiàn)mysqli沒有安裝php,運(yùn)行如下命令:

                  I found that mysqli was not installed with PHP and ran the following command:

                  >php -i
                  

                  這返回了 phpinfo() 并沒有發(fā)現(xiàn) mysqli.然后我運(yùn)行'yum'命令來安裝php-mysqli:

                  This returned the phpinfo() and found no mention of mysqli. I then ran the 'yum' command to install php-mysqli:

                  >yum install php-mysqli
                  

                  此后腳本成功運(yùn)行.希望這能幫助其他可能遇到類似問題的人.

                  After this the script worked successfully. Hope this helps others that might run into similar.

                  這篇關(guān)于命令行 php mysqli 失敗,但可通過 Web 服務(wù)器運(yùn)行并在本地運(yùn)行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調(diào)用未定義的函數(shù) mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準(zhǔn)備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結(jié)果)
                  PHP MySQLi Multiple Inserts(PHP MySQLi 多次插入)
                  How do I make sure that values from MySQL keep their type in PHP?(如何確保 MySQL 中的值在 PHP 中保持其類型?)
                    <tbody id='ud0LZ'></tbody>

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

                        <i id='ud0LZ'><tr id='ud0LZ'><dt id='ud0LZ'><q id='ud0LZ'><span id='ud0LZ'><b id='ud0LZ'><form id='ud0LZ'><ins id='ud0LZ'></ins><ul id='ud0LZ'></ul><sub id='ud0LZ'></sub></form><legend id='ud0LZ'></legend><bdo id='ud0LZ'><pre id='ud0LZ'><center id='ud0LZ'></center></pre></bdo></b><th id='ud0LZ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ud0LZ'><tfoot id='ud0LZ'></tfoot><dl id='ud0LZ'><fieldset id='ud0LZ'></fieldset></dl></div>
                      1. <legend id='ud0LZ'><style id='ud0LZ'><dir id='ud0LZ'><q id='ud0LZ'></q></dir></style></legend>

                        <tfoot id='ud0LZ'></tfoot>
                        • <bdo id='ud0LZ'></bdo><ul id='ud0LZ'></ul>

                          • 主站蜘蛛池模板: av一级| 91亚洲一区 | jav成人av免费播放 | 欧美一区二区三区在线观看 | a级在线免费 | 国产91在线播放 | 日本电影免费完整观看 | 中文字幕国产精品 | 成人小视频在线观看 | 国产在线观看不卡一区二区三区 | 精品视频在线观看 | 九九热精品视频在线观看 | 亚洲一区网站 | 国产高清性xxxxxxxx | 91网视频 | 羞羞的视频在线 | 中文字幕一级毛片视频 | 99综合 | 国产视频中文字幕 | 天天爱爱网 | 国产精品视频久久久 | 黑人巨大精品欧美一区二区免费 | 黄色视频a级毛片 | 成年人视频在线免费观看 | 日日综合 | 国产真实精品久久二三区 | 99在线免费视频 | 三级成人在线 | 国产欧美精品一区二区色综合朱莉 | 亚洲精品一区二区 | 日韩视频一区二区 | 日韩在线免费 | 中文字幕 亚洲一区 | 亚洲 中文 欧美 日韩 在线观看 | 天堂va在线| 91福利网| 国产不卡视频在线 | 日韩精品一区二区三区在线播放 | 91在线视频观看免费 | 亚洲视频免费在线看 | 国产一区二区 |