PHP Parse Error: syntax error, unexpected $end PHP的解析錯誤:語法錯誤,意想不到的$結束

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:在PHP 5中,以下錯誤可能出現的錯誤在Apache進入錯誤日誌或只是顯示PHP的網頁,即使通話PHP腳本與php_info ( )的作品完美,並成功地傳回的資料PHP的配置:

Parse Error: syntax error, unexpected $end in …..解析錯誤:語法錯誤,意想不到的$結束... .. scripts.php on line … scripts.php線...

The error may caused by a missing curly bracket in PHP script coding.這個錯誤可能造成的失踪捲曲的支架在PHP腳本編碼。 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.旁邊,但也可能造成的誤差在PHP編碼的類定義,因為在PHP中,一個類定義不能被打破,並分發到多個文件,或到多個PHP的區塊,除非是在打破一種宣言。

But more commonly, the error is often caused by the use of Short Open tags in PHP,但更常見的,錯誤往往是因為使用短公開賽在PHP標籤,

To use short open tags, it must be enabled in PHP.INI.使用短開放標籤,必須在php.ini中啟用。 Search for short_open_tag in PHP.INI, and change the value to On.搜索short_open_tag在php.ini中,改變價值論。 The line should look line:該生產線看起來應該行:

short_open_tag = On short_open_tag =論

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明:這是一台機器翻譯網頁這是“原樣”提供,無保修。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原文的文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at共享和貢獻或獲得技術支持和幫助 My Digital Life Forums 我的數字生活論壇 .



14 Responses to “PHP Parse Error: syntax error, unexpected $end” 14日的答复“的PHP解析錯誤:語法錯誤,意想不到的$結束”

  1. drwael
    May 14th, 2006 23:30 06年5月14號23:30
    1

    thanks a lot,多謝,
    short_open_tag = On solved that problem for me short_open_tag =在解決這個問題對我來說

  2. Paul保羅
    August 22nd, 2006 22:49二零零六年八月22號22:49
    2

    Thanks for this post…saved me a lot of time!感謝這個職位...救了我很多時間!

  3. ike耐克
    December 20th, 2006 04:57 06年12月20日4時五十七分
    3

    I saw your posting and made the change to the php.ini file and I’m still getting the error the is being run with Fedora Core 5 with MySql 5.我看見您的留言並提出了修改php.ini文件和我仍然讓錯誤的正在運行的Fedora Core 5與MySQL 5 。
    Can someone please help是否有人可以幫助

    0) 0 )
    {
    while ($row = mysql_fetch_assoc($result))而( $行= mysql_fetch_assoc ( $結果) )
    {
    print $row(’cust_id’) .打印$行( ' cust_id ' ) 。 ‘-’ . ' -' 。 $row(’cust_url_desc’) ; $行( ' cust_url_desc ' ) ;

    }
    }
    else其他的
    {

    echo ‘No rows found!’;迴聲'沒有發現行! ' ;
    }

    mysql_free_result($result); mysql_free_result ( $結果) ;

    mysql_close($connection); mysql_close ( $連接) ;

    ?> ? “

  4. Bruno布魯諾
    February 5th, 2007 07:41 07年2月5日7時41分
    4

    Hello.餵。 I have a problem with a PHP file that shows the “PHP Parse Error: syntax error, unexpected $end” error and I followed the instructions in this page and corrected the php.ini from OFF to ON.我有一個問題, PHP文件,顯示“ PHP的解析錯誤:語法錯誤,意想不到的$結束”的錯誤,我遵循的指示, 2007年06月和糾正在php.ini從關為ON 。
    Now, the file don’t give any feedback when I open it.現在,檔案不給任何反饋當我打開它。 It only gives me a blank page and no info!它不僅給了我一個空白頁,沒有信息! O_o
    It’s strange… Can you help me please?很奇怪...你能幫助我嗎? Thanks.謝謝。

  5. phpcoder
    March 29th, 2007 22:29 2007年三月二十九日22點29分
    5

    This might be due to a missing quote also這可能是由於缺少報價也

  6. Shawn肖恩
    August 30th, 2007 19:39 07年八月30日19:39
    6 6日

    Thanks a ton, I’ve been trying to figure this out for the last few hours.由於一噸,我一直在嘗試這一數字是在去年幾個小時。

  7. gilbert吉爾伯特
    September 15th, 2007 20:20 07年9月十五日20:20
    7 7日

    thhanx a lot short_open_tag = On solved my problem. thhanx了很多short_open_tag =在解決我的問題。 ypu are helpful ypu是有益的

  8. Hamed哈米德
    September 30th, 2007 12:07 07年9月30日12:07
    8 8日

    wow!哇! thanks for your useful guidance…感謝您了有益的指導...

  9. Guy傢伙
    October 23rd, 2007 18:52 07年10月23日18:52
    9 9日

    Very useful, thanks.非常有用的,謝謝。 I just upgraded to openSuse 10.3 from 10.2 which had reset my php.ini.我只是升級到10.3 , openSUSE當中從10.2重置了我的php.ini 。

  10. Rana林蛙
    February 27th, 2008 20:22 2008年2月27號20:22
    10 10個

    Thanks for your time, But for me Its really didfficult to find a missing curly bracket.感謝您的時間,但對我來說它真的didfficult找到失踪的大括號。

    Is there any easiest way to findout with MISSING CURLY BRACKET.是否有任何簡單的方式findout失踪捲曲的支架。 Any editor can do it for us.任何編輯器可以做到這一點對我們來說。

    Please Help.請幫助。
    Rana林蛙

  11. sugi
    March 8th, 2008 14:27 2008年3月8號14:27
    11 11日

    syntax error, unexpected $end in C:\wamp\www\login.php on line 49語法錯誤,意想不到的$年底在C : \ wamp \的www \ login.php線49

  12. Richard理查德
    March 17th, 2008 00:32 2008年3月十七日00:32
    12 12日

    Thank you,謝謝您,

    Been searching for ages for solution to this.一直在尋找年齡為解決這一點。

    short_open_tag = On solved that problem for me. short_open_tag =在解決這個問題對我來說。

    Finally I can open templates最後,我可以打開模板

  13. Raghavendra
    May 10th, 2008 14:10 08年五月10日14:10
    13

    Thank you very much …..非常感謝您... ..

  14. COMALite J COMALite J
    September 12th, 2008 23:57 08年九月12日23:57
    14

    Rana, any source code editor that supports Find / Replace with Regular Expressions can help you balance braces.林蛙,任何源代碼編輯器,支持查找/替換與正則表達式可以幫助你平衡支撐。

    Example: in Macrodobe Dreamweaver (any non-absolutely-ancient version), do [Ctrl]+[F] to activate Find/Replace, tell it:例如:在Macrodobe網頁(任何非絕對,古老的版本) ,這樣做[按Ctrl ] + [法]激活查找/替換,告訴它:

    Find in: Current Document查找:當前文檔
    Search: Source Code搜索:源代碼
    Find: [{}]查找: [ ( ) ]
    Replace: (leave blank)改為: (留空)
    Options: “Use Regular Expression” checked, all others unchecked.選項: “使用正則表達式”檢查,所有其他聽之任之。

    Then simply do Find Next.然後,根本查找下一個。 This will find both opening and closing braces.這將找到既開啟和關閉括號。 For each opening brace you find, count them starting at 1.對於每一個開放支撐您查找,指望他們從1開始。 For each closing brace, subtract 1 from the current count.對於每個閉幕振奮,減去1當前計數。 You should wind up at 0 just before it wraps around back to the beginning (also in any specific function, block, etc. ).您應該清盤0剛剛收到環繞回到起點(也在任何特定的功能,塊 ) 。

    Eg 例如:
    foreach ($array as $value) { // 1
    if ($value > 100) { // 2
    echo "$value too big!\n";
    } // 1
    } // 0

Leave a Reply留下一個回复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用這些標籤: href="" title="">的<a <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> “刪除日期時間= “ ” “的<em> <i> <q cite=""> <strike>的<strong>

Subscribe without commenting訂閱沒有評論


Custom Search

New Articles新文章

Incoming Search Terms for the Article收到的搜索字詞的文章

Parse error: syntax error, unexpected $end 解析錯誤:語法錯誤,意想不到的$結束 - - php unexpected $end PHP的意外$結束 - - Parse error: syntax error, unexpected $end in 解析錯誤:語法錯誤,意想不到的$結束 - - unexpected $end 意想不到的$結束 - - Parse error: syntax error, unexpected $end 解析錯誤:語法錯誤,意想不到的$結束 - - Parse error: syntax error, unexpected $end in 解析錯誤:語法錯誤,意想不到的$結束 - - syntax error, unexpected $end 語法錯誤,意想不到的$結束 - - unexpected $end php 意想不到的$結束的PHP - - php unexpected end PHP的意外結尾 - - PHP Parse error: syntax error, unexpected $end PHP的解析錯誤:語法錯誤,意想不到的$結束 - - PHP Parse error: syntax error, unexpected $end PHP的解析錯誤:語法錯誤,意想不到的$結束 - - php unexpected $end PHP的意外$結束 - - unexpected $end in php 意想不到的$在PHP結束 - - php "unexpected $end" PHP的“意外$結束” - - php unexpected $end in PHP的意外$結束 - - syntax error, unexpected $end in 語法錯誤,意想不到的$結束 - - syntax error, unexpected $end 語法錯誤,意想不到的$結束 - - $end php $結束的PHP - - unexpected $end 意想不到的$結束 - - unexpected $end in 意想不到的$結束 - - PHP Parse error: syntax error, unexpected $end PHP的解析錯誤:語法錯誤,意想不到的$結束 - - syntax error, unexpected $end in 語法錯誤,意想不到的$結束 - - Parse error: syntax error, unexpected $end php 解析錯誤:語法錯誤,意想不到的$結束的PHP - - "Parse error: syntax error, unexpected $end in" “解析錯誤:語法錯誤,意想不到的$結束” - - "Parse error: syntax error, unexpected $end" “解析錯誤:語法錯誤,意想不到的$結束” - - Parse error: syntax error, unexpected $end i 剖析錯誤:語法錯誤,意想不到的$最後,我 - - syntax error, unexpected $end php 語法錯誤,意想不到的$結束的PHP - - PHP Parse error: syntax error, unexpected $end in PHP的解析錯誤:語法錯誤,意想不到的$結束 - - syntax error, unexpected $end i 語法錯誤,意想不到的$最後,我 - - syntax error, unexpected $end in php 語法錯誤,意想不到的$在PHP結束 - - $end error php $結束錯誤的PHP - - php error $end PHP的錯誤$結束 - - "PHP Parse error: syntax error, unexpected $end" “ PHP的解析錯誤:語法錯誤,意想不到的$結束” - - php parse error: syntax error, unexpected $end in PHP的解析錯誤:語法錯誤,意想不到的$結束 - - Parse error: syntax error, unexpected $end in 解析錯誤:語法錯誤,意想不到的$結束 - - Parse error: syntax error 解析錯誤:語法錯誤 - - php $end PHP的$結束 - - php unexpected $end in PHP的意外$結束 - - Parse error: syntax error, unexpected $end 解析錯誤:語法錯誤,意想不到的$結束 - - PHP Parse error: parse error, unexpected $end PHP的解析錯誤:剖析錯誤,意想不到的$結束 - - unexpected end php 意外結尾的PHP - - $end error in php $年底在PHP錯誤 - - $end php error $結束PHP的錯誤 - - unexpected end in php 意外在PHP結束 - - php unexpected $end PHP的意外$結束 - - end() php 結束( )的PHP - - parse error $end 解析錯誤$結束 - - Parse error: syntax error, unexpected $end +php 解析錯誤:語法錯誤,意想不到的$ + PHP的結束 - - PHP Parse error: parse error, unexpected $end PHP的解析錯誤:剖析錯誤,意想不到的$結束 - - "Parse error: syntax error, unexpected ';' in" php5 “解析錯誤:語法錯誤,意想不到的' ; '在” php5 - -