Php prompts Parseerror: syntaxerror, unexpectedT_ENDWHILEin. When writing a simple program, you will encounter the Parseerror: syntaxerror, unexpectedT_ENDWHILEinwww.111cn.net.php file. I will analyze the causes and solutions for you. The problem occurs when you write a simple program with the Parse error: syntax error, unexpected T_ENDWHILE in www. bKjia. c0m. php file. I will analyze the cause and solution for you.
Symptom:
1. the same code runs normally on some machines, but an error is reported when running on specific machines.
2. some pages of the same site are displayed normally (for example ), But when you open some pages, phpxx_errors.log or the page displays the error message "Parse error: syntax error, unexpected T_ENDWHILE in xx. php on line xx ".
Error cause:
This error may be caused by the loss of a curly braces ("}") when writing a PHP script, but the more common cause is that the short_open_tag value in the php. ini file is Off.
Determine whether to allow the abbreviated form of the start sign of the PHP code ( ). If you want to use PHP with XML, disable this option for embedded use. . Otherwise, it can be output through PHP, for example: . If disabled, you must use the complete form of the PHP code start flag ( ).
Note: this command also affects the abbreviated form. It is the standard method, but this short label is used for a long time (for historical reasons). to be compatible with the old code, this feature is saved.
Solution:
Set the short_open_tag value in the php. ini file to On.
Related Knowledge: PHP short label short_open_tag
| Name |
Default |
Modifiable range |
Update Log |
| Short_open_tag |
"1" |
PHP_INI_ALL |
PHP 4.0.0 is PHP_INI_ALL. PHP_INI_PERDIR is used in PHP <5.3.0. |
| Asp_tags |
"0" |
PHP_INI_PERDIR |
PHP 4.0.0 is PHP_INI_ALL. |
| 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 from PHP 5.4.0. |
| Allow_call_time_pass_reference |
"1" |
PHP_INI_PERDIR |
PHP 4.0.0 is PHP_INI_ALL. Remove this option from 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. zemo-compatibility_mode |
"0" |
PHP_INI_ALL |
Available from PHP 5.0.0. Remove this option from PHP 5.3.0 |
| Detect_unicode |
"1" |
PHP_INI_ALL |
Available from PHP 5.1.0. Outdated featuresSetWill beRemove. |
Warning error: syntax error, unexpected T_ENDWHILE in www.111cn.net. php file. I will analyze the cause and solution for you. SYMPTOM...