PHPParseError: syntaxerror, unexpected $ end error solution

Source: Internet
Author: User
Tags apache error log
PHPParseError: syntaxerror, unexpected $ end error solution

Configure the server and prompt php Parse Error: syntax error, unexpected $ end Error when accessing PHP. share my solution.

Writing php programs over the past few days, I feel like asp, asp.net, and jsp are not doing well. for example, session uses session_start ();, which is inconvenient to use for file jump headers ....

Maybe it's some of the unfamiliar php features, but if I write too much, I will gradually adapt to it .....

Compile and debug a code with the following errors: Parse error: syntax error, unexpected $ end in D: \ xampp \ htdocs \ guestBook. php on line 330

Check the program's 330 lines and the last line of code. what is the error? Google search: 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 invocations:

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 shoshould look line:

Short_open_tag = On

The short tag is used when an error occurs. you can set short_open_tag = On in php. ini.

The original Parse error prompt is generally a syntax error. an open label is used, and the statement is not terminated, that is, some basic programming errors. for example, if () or () {...} I forgot "}"; Forgot "?> ". Check the code carefully. The "}" is missing, and the modification program runs normally.

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.