相關資訊
本類常用軟件
-
福建農(nóng)村信用社手機銀行客戶端下載下載量:584204
-
Windows優(yōu)化大師下載量:416896
-
90美女秀(視頻聊天軟件)下載量:366961
-
廣西農(nóng)村信用社手機銀行客戶端下載下載量:365699
-
快播手機版下載量:325855
本文章提供給大家的是一個小經(jīng)驗分享,關于遇到PHP Parse Error: syntax error, unexpected $end 錯誤的解決辦法,希望能夠幫助到各位。
這幾天寫php程序,感覺很多地方不如asp,asp.Net,jsp順手,比如session使用先得session_start();,文件跳轉header用的也不方便....
也許是不熟悉的php的一些特性吧,不過寫多了,也就慢慢適應將就了.....
這里就整理一個代碼編寫調試問題,錯誤如下:
Parse error: syntax error, unexpected $end in D:\xampp\htdocs\guestBook\guestBook.php on line 330 |
看看程序 330行,代碼最后一行,這有什么錯誤?google搜,找到了:
In PHP 5, the following error may appears as an error entry in Apache error log or simply displays on PHP web page, even if calling to php scripts with php_info() works perfectly and successfully returns information on PHP configurations: Parse Error: syntax error, unexpected $end in ….. scripts.php on line … The error may caused by a missing curly bracket in PHP script coding. Beside, it may also caused by error in PHP coding in class definition, as in PHP, a class definition cannot be broke up and distributed into multiple files, or into multiple PHP blocks, unless the break is within a method declaration. But more commonly, the error is often caused by the use of Short Open tags in PHP, To use short open tags, it must be enabled in PHP.INI. Search for short_open_tag in PHP.INI, and change the value to On. The line should look line: short_open_tag = On |
欺我英文不好啊?看看其它幾條搜索,都沒說到點子上,那就看看英文了,雖不能如數(shù)翻譯,大致意思是瞧明白了:
錯誤發(fā)生是使用了短標簽,可以在php.ini中設置short_open_tag = On |
原來Parse error 提示一般是 語法錯誤,使用了開放的標簽,語句沒有結束 也就是編程基本的一些錯, 比如沒注意 語句結束加 ";" 或者 if(){...} 后面忘了"}" ;〈?php...?〉忘了“?〉”。仔細檢查代碼,果然是一處漏掉了“}”,修改程序正常運行
熱門評論
最新評論