国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > PHP > 正文

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

2024-05-04 23:15:00
字體:
供稿:網(wǎng)友
這幾天寫php程序,感覺很多地方不如asp,asp.Net,jsp順手,比如session使用先得session_start();,文件跳轉(zhuǎn)header用的也不方便....

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

這里就整理一個(gè)代碼編寫調(diào)試問題,錯(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

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

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

原來Parse error 提示一般是 語法錯(cuò)誤,使用了開放的標(biāo)簽,語句沒有結(jié)束 也就是編程基本的一些錯(cuò), 比如沒注意 語句結(jié)束加 ";" 或者 if(){...} 后面忘了"}" ;<?php...?>忘了"?>"。仔細(xì)檢查代碼,果然是一處漏掉了"}",修改程序正常運(yùn)行
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 剑阁县| 无极县| 松阳县| 广宁县| 遂平县| 夏邑县| 兴山县| 凤山县| 文水县| 绍兴市| 巢湖市| 阳春市| 郁南县| 海宁市| 乌兰浩特市| 夹江县| 望城县| 开原市| 子洲县| 怀来县| 当阳市| 乌拉特中旗| 丹东市| 年辖:市辖区| 兰州市| 仁布县| 伊宁县| 鄂伦春自治旗| 恩平市| 同德县| 秀山| 缙云县| 鄢陵县| 周宁县| 铁力市| 安新县| 淮安市| 宜昌市| 凯里市| 甘肃省| 札达县|