久久久久久久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 服務器運行并

        Command line php mysqli fails but works via web server and works in local(命令行 php mysqli 失敗,但可通過 Web 服務器運行并在本地運行)
        <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 服務器運行并在本地運行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個 shell 腳本,它調用一個 php 腳本在解析文本文件后在數據庫中插入記錄.當它調用 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 本地失敗,在我將套接字參數添加到 mysqli 調用后,它在本地工作.這適用于本地數據庫!

                  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 服務器(安裝了yum install php"和 PHP 5.3.x 的 CentOS6).我更改了與遠程數據庫服務器的連接,因此刪除了/tmp/mysql.sock",因為數據庫未在此服務器上運行.

                  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腳本調用php執行腳本:

                  Shell script calling php to execute script:

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

                  鑒于我沒有在本地運行 mysql,如何讓它識別 mysqli 庫并執行.它在 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() 來處理一些準備好的語句和腳本中的其他位.

                  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.

                  推薦答案

                  發現mysqli沒有安裝php,運行如下命令:

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

                  >php -i
                  

                  這返回了 phpinfo() 并沒有發現 mysqli.然后我運行'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
                  

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

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

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

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

                  相關文檔推薦

                  store_result() and get_result() in mysql returns false(mysql 中的 store_result() 和 get_result() 返回 false)
                  Call to undefined function mysqli_result::num_rows()(調用未定義的函數 mysqli_result::num_rows())
                  PHP Prepared Statement Problems(PHP 準備好的語句問題)
                  mysqli_fetch_array returning only one result(mysqli_fetch_array 只返回一個結果)
                  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>

                          • 主站蜘蛛池模板: 久久99精品久久久久久 | 黄色成人免费看 | 国产亚洲一区二区三区 | 欧美日韩国产一区二区三区 | 国产成人精品视频 | 在线视频中文字幕 | 99一级毛片 | 91视频一区 | 欧美在线看片 | 国产精品久久久久无码av | 99精品欧美一区二区蜜桃免费 | 国产高清在线 | 久久综合久久久 | 亚洲精品福利在线 | 国产精品久久久久久一区二区三区 | 成人无遮挡毛片免费看 | 久久久久国产一区二区三区 | 中文字幕乱码一区二区三区 | 涩涩视频网 | 免费亚洲成人 | 亚洲免费在线观看 | 日韩欧美久久 | 精品久| 波多野结衣一区二区三区 | 久久国 | 一级免费毛片 | 神马久久久久久久久久 | 免费一级欧美在线观看视频 | 91色视频在线观看 | 成人中文网 | 在线观看国产h | 午夜免费看 | 日日夜夜91| www.青青草 | 亚洲精品一 | 夜夜爽99久久国产综合精品女不卡 | 久久国产精品久久久久 | 日韩国产精品一区二区三区 | 免费观看羞羞视频网站 | 亚洲成人99 | 精品一区二区久久久久久久网站 |