PHP嚴重致命錯誤 Fatal error 處理
記得在PHP5就遇過這樣的錯誤訊息,在ecshop裡都是重複定義了某函數,或是同一個函數被載入了兩次
Fatal error: Cannot redeclare auction_info() (previously declared in *****includes\lib_goods.php:1159) in ******\includes\lib_clips.php on line 955錯誤訊息顯示了第一次從 includes\lib_goods.php 的 1159 行已經載入該函數,includes\lib_clips.php 的 955 行又定義一次同名的函數導致錯誤,解決的方法就是在第二次載入前先做判斷,如下:
if(function_exists('auction_info') != true){ function auction_info($act_id, $config = false) { ..... } }
