新手求助一些錯誤信息

edited 九月 2014 in PHP新手區
最近用XAMPP發現這個站點會報錯,大約是三年前做的,查了一下好像是PHP版本問題,請問各位先進該如何解決呢,或可提供關鍵字讓小弟有方向可循。

Warning: Creating default object from empty value in D:\xampp\htdocs\www.onemall.com.tw\config.php on line 23

Strict Standards: Non-static method DB::connect() should not be called statically in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 14

Strict Standards: Non-static method DB::parseDSN() should not be called statically in D:\xampp\php\pear\DB.php on line 520

Strict Standards: Non-static method DB::errorMessage() should not be called statically, assuming $this from incompatible context in D:\xampp\php\pear\DB.php on line 965

Strict Standards: Non-static method DB::isError() should not be called statically, assuming $this from incompatible context in D:\xampp\php\pear\DB.php on line 688

Strict Standards: Non-static method DB::isError() should not be called statically in D:\xampp\php\pear\DB.php on line 557

Strict Standards: Non-static method DB::isError() should not be called statically in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 15
can't conncect: DB Error: connect failed

評論

  • edited 九月 2014
    找到你的 php.ini ,把 error_reporting 改為 E_ALL & ~E_DEPRECATED & ~E_STRICT ,同時 display_errors = Off

    然後其實最後一行才是真的錯誤訊息,檢查一下資料庫設定吧
  • 感謝回復,已經找到設定中的HOST改成本機127.0.0.1,旦出現白畫面,打開錯誤報告顯示如下

    Warning: Creating default object from empty value in D:\xampp\htdocs\www.onemall.com.tw\config.php on line 23

    Strict Standards: Non-static method DB::connect() should not be called statically in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 14

    Strict Standards: Non-static method DB::parseDSN() should not be called statically in D:\xampp\php\pear\DB.php on line 520

    Strict Standards: Non-static method DB::isError() should not be called statically in D:\xampp\php\pear\DB.php on line 557

    Strict Standards: Non-static method DB::isError() should not be called statically in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 15

    Strict Standards: Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context in D:\xampp\php\pear\DB\common.php on line 2200

    Strict Standards: Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context in D:\xampp\php\pear\DB\common.php on line 2200

    Strict Standards: Non-static method DB::isManip() should not be called statically, assuming $this from incompatible context in D:\xampp\php\pear\DB\common.php on line 2200

    Warning: require_once(Smarty/Smarty.class.php): failed to open stream: No such file or directory in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 21

    Fatal error: require_once(): Failed opening required 'Smarty/Smarty.class.php' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 21

    還請大師解惑
  • 應該是 Smarty 沒裝好吧,你確定要自己繼續裝嗎?這些都是基本的東西,不熟悉這些就開始處理對外的網站會蠻危險的
  • 謝謝K大的關鍵字,已經裝好Smarty ,小弟確實是門外漢一竅不通,不過老闆要求能夠立即看到只好硬著頭皮先讓他正常能秀出來,這次出現如下代碼

    Warning: require_once(DB.php): failed to open stream: No such file or directory in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 11

    Fatal error: require_once(): Failed opening required 'DB.php' (include_path='.;D:\xampp\smarty\libs') in D:\xampp\htdocs\www.onemall.com.tw\main.php on line 11

    還請各位不吝賜教
  • 就少了 DB.php 這個檔案吧
  • 他是說的你檔案位子不正確,無法開啟
Sign In or Register to comment.