PHP Tips for parse error:syntax error, unexpected t_endwhile in_php tutorial

Source: Internet
Author: User
When writing a simple program that encountered the parse Error:syntax error, unexpected t_endwhile in www.bKjia.c0m. php file, let me give you an analysis of the reasons and solutions.

Problem phenomenon:

1, the same code, on some machines run normally, but on a specific machine run error.

2, the same site part of the page display normal (for example ), but open some pages, Phpxx_errors.log or page display error "Parse error:syntax error, unexpected t_endwhile in xx.php on line xx ".

Cause of Error:

This error may be due to the loss of a curly brace ("}") when writing PHP scripts, but the more common reason is that the Short_open_tag value is off in the php.ini file.

Determines whether to allow the use of the PHP code to start the abbreviation of the flag ( ). If you want to use PHP in conjunction with XML, you can disable this option for embedding purposes . Otherwise, it can be output via PHP, for example: . If disabled, you must use the full form of the PHP Code start flag ( ).

Note: This directive also affects the way that abbreviations are standardized, but because this short label is used for a long time (historical reason), this feature is preserved for compatibility with old code.

Solution:

Set the Short_open_tag value in the php.ini file to ON.

Related knowledge: PHP short tag Short_open_tag

name default Modifiable Range Update Log
Short_open_tag "1" Php_ini_all It is php_ini_all when PHP 4.0.0. PHP < 5.3.0 is php_ini_perdir.
Asp_tags "0" Php_ini_perdir It is php_ini_all when PHP 4.0.0.
Precision "14" Php_ini_all
Serialize_precision "17" Php_ini_all Available from PHP 4.3.2. Before PHP 5.3.5, the default value is 100
Y2k_compliance "1" Php_ini_all Remove this option in PHP 5.4.0.
Allow_call_time_pass_reference "1" Php_ini_perdir It is php_ini_all when PHP 4.0.0. Remove this option in PHP 5.4.0.
Disable_functions "" php.iniOnly Available from PHP 4.0.1.
Disable_classes "" php.iniOnly Available from PHP 4.3.2.
Exit_on_timeout "" Php_ini_all Available from PHP 5.3.0.
expose_php "1" php.iniOnly
Zend.multibyte "0" Php_ini_all Available from PHP 5.4.0
Zend.script_encoding Null Php_ini_all Available from PHP 5.4.0
Zend.signal_check "0" Php_ini_system Available from PHP 5.4.0
Zend.ze1_compatibility_mode "0" Php_ini_all Available from PHP 5.0.0. Remove this option in PHP 5.3.0
Detect_unicode "1" Php_ini_all Available from PHP 5.1.0. This outdated feature will definitely be removed in the future.

http://www.bkjia.com/PHPjc/633178.html www.bkjia.com true http://www.bkjia.com/PHPjc/633178.html techarticle when writing a simple program that encountered the parse Error:syntax error, unexpected t_endwhile in www.111cn.net. php file, let me give you an analysis of the reasons and solutions. Problem Phenomenon ...

  • 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.