運行php程序出現Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in xxxxxxxx on line 6的解決辦法

今天測試php程序的時候,剛開始一切都正常的,可是突然出現下面的錯誤

Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in xxxxxxxxx on line 6

其中xxxxxxxxx代表文件路徑

運行php程序出現Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in xxxxxxxx on line 6的解決辦法

發現問題:

<?php  開始前面不能有空行或者其他語句

解決辦法:

<?php移動到最頂部去,成功解決

到此為止。

發布者:彬彬筆記,轉載請註明出處:https://www.binbinbiji.com/zh-hant/php/2849.html

(0)
彬彬筆記彬彬筆記
上一篇 2022年9月24日
下一篇 2022年10月7日

相關推薦

發表回復

登錄後才能評論
蜀ICP備14017386號-13