失敗我有一個這樣的腳本:爲什麼是兩個錯誤報告包括()和require()時,在PHP
<html>
<body>
<?php
require("wrongFile.php");
echo "Hello World!";
?>
</body>
</html>
現在如果wrongfile不存在兩個以下錯誤會報告:
Warning: require(wrongFile.php) [function.require]: failed to open stream: No such file or directory in C:\home\website\test.php on line 5
Fatal error: require() [function.require]:Failed opening required 'wrongFile.php' (include_path='.;C:\php5\pear') in C:\home\website\test.php on line 5
我知道,如果不存在require()函數中的文件顯示致命錯誤,導致腳本執行停止,但不明白什麼是第一個錯誤
使用include()函數的第一個錯誤顯示o
您還可以警告,關閉所有在一起,http://stackoverflow.com/questions/1645661/turn-off-warnings-and-errors-on-php-mysql – locrizak
...但不這樣做。 –
@everyone:不要將錯誤消息格式化爲代碼。你使它們比純文本更糟糕。 –