PHP Parse error:syntax error, unexpected $end wrong solution _php Tutorial

Source: Internet
Author: User
Tags apache error log parse error
These days to write PHP program, feel a lot of places than asp,asp.net,jsp handy, such as session use first get Session_Start (), file jump header with not convenient ....

May be unfamiliar with some features of PHP, but write more, also slowly adapt to the will ...

Here is a code to write debugging problems, the error is as follows:

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

Look at the program line 330, the last line of code, what's wrong with that? Google search, found:

In PHP 5, the following error could appears as an error entry in Apache error log or simply displays on PHP Web page, even I F 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 to 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 is broke up an D distributed into multiple files, or to multiple PHP blocks, unless the break is within a method declaration.

But more commonly, the error was often caused by the use of the short Open tags in PHP,

To use the short open tags, it must is enabled in PHP. Ini. Search for Short_open_tag in PHP. INI, and change the value to on. The line should:

Short_open_tag = On

Is it bad for me to cheat my english? Look at a few other searches, did not mention the point, then look at English, although not as translated, the general meaning is to see understand:

Error occurs when a short label is used and can be set in php.ini Short_open_tag = On

The original parse error hint is usually a syntax error, using an open tag, the statement is not the end of the programming basic errors, such as the end of the sentence without notice ";" or if () {...} after forgetting "}"; Forget the "?>". Check the code carefully, sure enough is a missing "}", modify the program to run properly

http://www.bkjia.com/PHPjc/325397.html www.bkjia.com true http://www.bkjia.com/PHPjc/325397.html techarticle these days to write PHP program, feel a lot of places than asp,asp.net,jsp handy, such as session use first get Session_Start (), file jump header with not convenient .... Maybe it's not familiar .

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.