我的PHP知識是有限的,我試圖將http://www.tutorialchip.com/php-download-file-script/這個腳本實現到我的網站。我已經在這裏推出了他們的文件http://brooksmemories.com/test/。如果點擊一個文件,我得到了以下錯誤用PHP強制下載文件
Strict Standards: main() [function.main]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/inspire/public_html/brooksmemories.com/test/download.php on line 16
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /home/inspire/public_html/brooksmemories.com/test/download.php on line 16
我不知道如何糾正這些錯誤得到它的工作。任何幫助將不勝感激。謝謝。
PHP中不存在'__DIR__'常量<= 5.2;在其位置使用'dirname(__ FILE __)'。時區警告[由Google解釋](http://www.google.de/search?q=Strict+Standards:+main()+%5Bfunction.main%5D:+ It + is + not + safe +到+靠+上+的+系統+時區+設置。+請+使用+的+ date.timezone +設置+的+ TZ +環境+變量+或+的+ date_default_timezone_set()+功能)。 – mario 2012-04-27 17:32:39
@mario:據我所知,時區警告是由此通知引起的。出於某種原因,即使錯誤也會導致PHP中的錯誤。奇怪,但這是它的工作原理。我會修改配置,所以這個警告不會發生,但在這種情況下,它根本就沒有任何意義。 – xfix 2012-04-27 17:36:19