最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

PHP Parse Error: syntax error, unexpected $end 錯(cuò)誤的解決辦法

 更新時(shí)間:2012年06月05日 10:35:11   作者:  
今天幫客戶配置服務(wù)器,訪問(wèn)php的時(shí)候提示PHP Parse Error: syntax error, unexpected $end 錯(cuò)誤,通過(guò)查找找到了問(wèn)題,特分享下
這幾天寫(xiě)php程序,感覺(jué)很多地方不如asp,asp.Net,jsp順手,比如session使用先得session_start();,文件跳轉(zhuǎn)header用的也不方便....

也許是不熟悉的php的一些特性吧,不過(guò)寫(xiě)多了,也就慢慢適應(yīng)將就了.....

這里就整理一個(gè)代碼編寫(xiě)調(diào)試問(wèn)題,錯(cuò)誤如下:

Parse error: syntax error, unexpected $end in D:\xampp\htdocs\guestBook\guestBook.php on line 330

看看程序 330行,代碼最后一行,這有什么錯(cuò)誤?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

欺我英文不好啊?看看其它幾條搜索,都沒(méi)說(shuō)到點(diǎn)子上,那就看看英文了,雖不能如數(shù)翻譯,大致意思是瞧明白了:

錯(cuò)誤發(fā)生是使用了短標(biāo)簽,可以在php.ini中設(shè)置short_open_tag = On

原來(lái)Parse error 提示一般是 語(yǔ)法錯(cuò)誤,使用了開(kāi)放的標(biāo)簽,語(yǔ)句沒(méi)有結(jié)束 也就是編程基本的一些錯(cuò), 比如沒(méi)注意 語(yǔ)句結(jié)束加 ";" 或者 if(){...} 后面忘了"}" ;<?php...?>忘了"?>"。仔細(xì)檢查代碼,果然是一處漏掉了"}",修改程序正常運(yùn)行

相關(guān)文章

最新評(píng)論

潼南县| 富锦市| 大庆市| 华安县| 桂林市| 泰兴市| 阿克苏市| 翼城县| 都匀市| 安顺市| 石棉县| 岳普湖县| 汝南县| 集贤县| 香港| 丰原市| 中江县| 黔江区| 临清市| 浪卡子县| 井冈山市| 芒康县| 乐至县| 丰县| 门头沟区| 榆中县| 丰都县| 和顺县| 丘北县| 游戏| 璧山县| 大石桥市| 保亭| 台江县| 青州市| 白银市| 靖安县| 新建县| 德昌县| 山阴县| 濮阳市|