2015-02-23 134 views
1

我嘗試了所有在互聯網上的解決方案,但仍然無法解決它。Opencart禁用Mysql/Php錯誤顯示

Problem- Opencart的顯示PHP/MySQL的誤差(其也示出了用於連接到MySQL密碼)

當Opencart的面向連接MySQL數據庫或由於過多的連接PHP的任何問題是無法連接到數據庫時,以下列格式顯示錯誤。

Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'indiaran_admin'@'localhost' (using password: YES) in /home3/indiaran/public_html/system/database/mysqli.php on line 6

Fatal error: Uncaught exception 'ErrorException' with message 'Error: Could not make a database link' in /home3/indiaran/public_html/system/database/mysqli.php:9 Stack trace:#0 /home3/indiaran/public_html/vqmod/vqcache/vq2-system_library_db.php(13): DBMySQLi->__construct('localhost', 'indiaran_admin', 'PASSWORD', 'indiaran_db') #1 /home3/indiaran/public_html/index.php(44): DB->__construct('mysqli', 'localhost', 'indiaran_admin', 'PASSWORD', 'indiaran_db') #2 {main} thrown in /home3/indiaran/public_html/system/database/mysqli.php on line 9

預期的解決方案: - (任何將盡)

  • Opencart的停止顯示任何錯誤MySQL的/ PHP
  • 誤差不顯示我的數據庫ID和密碼顯示。
  • 其停止顯示所有的錯誤(包括mysqli的連接錯誤)

解決方案沒有嘗試過任何解決方案: -

首先

php.ini has 
display_errors = Off; 
error_reporting = 0; 

htaccess has 
php_value error_reporting 0 

There is a setting within the OpenCart dashboard that allows you to turn on (or off) error reporting and logging.  
Log into your dashboard 
    In the menu, go to "System" and select "Settings" 
    In the list of stores, click "Edit" for your store 
    Click the "Server" tab. 
    Scroll down, and there's two settings: 
    a. Log Errors - set this as desired 
    b. Display Errors - set this to "No" 

Commenting Out set_error_handler('error_handler'); in index.php 

Using Php Try-Catch Phrase, which i dont know exactly how to use in opencart. 

希望我能解釋一下,有人將能夠helpme。

PS: - 我的網站託管Hostgator作爲共享主機。

鏈接到無法解決我的問題的類似問題。

http://stackoverflow.com/questions/16935473/cant-disable-error-reporting-in-opencart-php 

http://stackoverflow.com/questions/5040048/php-mysql-too-many-connections-to-database-error 

http://stackoverflow.com/questions/25957024/warning-mysqlimysqli-mysqli-mysqli-08004-1040-too-many-connections-in 

http://stackoverflow.com/questions/28591394/mysqli-connect-error-shows-password/28591455#28591455 
+0

什麼是再次詢問你是否已經接受你在這裏關於同一主題的問題的答案的原因:HTTPS:/ /stackoverflow.com/questions/28591394/mysqli-connect-error-shows-password ??? – shadyyx 2015-02-23 13:49:12

+0

我接受了這個答案,因爲這幫助我解決了問題,但在opencart方面卻沒有解決問題,因爲當涉及到opencart時似乎沒有任何工作: – 2015-02-24 05:55:36

回答

0

首個解決方案是正確的,應該做要緊任何php.ini中所作的更改會來採取行動重新啓動您的服務器(時代的99%,按我的後經驗)。

我知道您目前正在使用共享服務器,因此您無法重新啓動服務器以解決此問題。我使用PHP Rintime配置(PHPRC)當我遇到與Dreamhost Web類似的問題時託管提供商。

您也可以聯繫您的託管服務提供商,瞭解如何實施PHPRC。如果你想看看它是如何在Dreamhost的完成,這裏是鏈接:

PHPRC in Dreamhost.