Web page does not prompt for PHP file syntax error

Source: Internet
Author: User
Tags derick pear phpinfo
PHP php.ini error_reporting display_errors

I set Display_errors=on and Error_reportinge_all & ~e_notice in php.ini, and httpd.conf php_flag on in display_errors
Php_value error_reporting 2039
These two parameters, run phpinfo.php, can display these parameters normally, but it is not possible to display syntax errors on the Web page ... have been thinking, the reason may be that the php.ini file is not executed at all, and then wrote a file such as:
Ini_set ("Display_errors", "on");
Error_reporting (E_all);
Include ("test.php");
?>
Where test.php is a grammatical error of the file, so, certainly can, the result is not yet ...
Who is the great God to save me ...


Reply to discussion (solution)

What does that show?
Try this and show what?

 
  

In Phpinfo (); See if the php.ini in effect is the one you modified.

If it's test.php, then stick it out.

In Phpinfo (); See if the php.ini in effect is the one you modified.

If it's test.php, then stick it out.
The contents of the test.php file are:
echo "Hello"
echo "World";
?>
That is, the first echo statement is followed by a semicolon.


In Phpinfo (); See if the php.ini in effect is the one you modified.

If it's test.php, then stick it out.
The contents of the test.php file are:
echo "Hello"
echo "World";
?>
That is, the first echo statement is followed by a semicolon.

The php.ini that came into effect was actually the one I modified.

What does that show?
Try this and show what?

 
  


Run the code you posted above, the effect is to break the net effect, without any hint, my php file as long as there is a mistake, is the effect of the network break.

Through Phpinfo ();
See if your configuration is successful!

Through Phpinfo ();
See if your configuration is successful!
Yes, well, the right configuration is fully visible.

Display_startup_errors

I have a guess, whether the server translates all the language errors to 500 errors, and then the client uses the "friendly" hint, it looks like a net-off sensation.

When an application error occurs, an error number is usually returned. The Web server is not a fairy, and it is impossible to do error handling for any application.
So as long as you do not return 0, I will send back to the user HTTP 500 (reject response)

Open PHP error display function display_errors = On
Although the PHP program is wrong, it is correct for the Web server. Because the application PHP produces the output, although it is a PHP error message. But the Web server doesn't care what the output

Display_startup_errors

I tried, no.

I have a guess, whether the server translates all the language errors to 500 errors, and then the client uses the "friendly" hint, it looks like a net-off sensation.
The 500 error appears to be an error with IIS, I'm using Apache, and I don't have any account passwords or anything like that.

When an application error occurs, an error number is usually returned. The Web server is not a fairy, and it is impossible to do error handling for any application.
So as long as you do not return 0, I will send back to the user HTTP 500 (reject response)

Open PHP error display function display_errors = On
Although the PHP program is wrong, it is correct for the Web server. Because the application PHP produces the output, although it is a PHP error message. But the Web server doesn't care what the output

Amount, do not understand Ah, can be described in detail how to solve this problem, I configured the lamp environment can be normal display, with appserv why not ...

To post the results of a phpinfo


I have a guess, whether the server translates all the language errors to 500 errors, and then the client uses the "friendly" hint, it looks like a net-off sensation.
The 500 error appears to be an error with IIS, I'm using Apache, and I don't have any account passwords or anything like that.


I have a guess, whether the server translates all the language errors to 500 errors, and then the client uses the "friendly" hint, it looks like a net-off sensation.
The 500 error appears to be an error with IIS, I'm using Apache, and I don't have any account passwords or anything like that.

Well, just a mistake, Apache can also have 500 errors, the question is how to verify the idea?

To post the results of a phpinfo

PHP Version 5.2.6


System Windows NT yanyaozhen-d1 6.1 Build 7600
Build Date May 2 2008 18:01:20
Configure Command Cscript/nologo configure.js "--enable-snapshot-build" "--with-gd=shared" "--with-extra-includes=c : \program Files (x86) \microsoft Sdk\include; C:\progra~2\micros~2\vc98\atl\include; C:\progra~2\micros~2\vc98\include; C:\progra~2\micros~2\vc98\mfc\include ""--with-extra-libs=c:\program Files (x86) \microsoft SDK\Lib; C:\progra~2\micros~2\vc98\lib; C:\progra~2\micros~2\vc98\mfc\lib "
Server API Apache 2.0 Handler
Virtual Directory Support Enabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\Windows\php.ini
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build No
Thread Safety Enabled
Zend Memory Manager Enabled
IPV6 Support Enabled
Registered PHP Streams PHP, file, data, HTTP, FTP, Compress.zlib
Registered Stream Socket transports TCP, UDP
Registered Stream Filters convert.iconv.*, string.rot13, String.ToUpper, String.ToLower, String.strip_tags, convert.*, Consumed, zlib.*

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
With Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

PHP Credits

Configuration

PHP Core

Directive Local Value Master value
Allow_call_time_pass_reference on
Allow_url_fopen on
Allow_url_include off off
Always_populate_raw_post_data off off
Arg_separator.input & &
Arg_separator.output & &
Asp_tags off off
Auto_append_file No value No value
Auto_globals_jit on
Auto_prepend_file No value No value
Browscap No value No value
Default_charset No value No value
Default_mimetype text/html text/html
Define_syslog_variables off off
Disable_classes No value No value
Disable_functions No value No value
Display_errors on
Display_startup_errors off off
Doc_root No value No value
Docref_ext No value No value
Docref_root No value No value
ENABLE_DL on
Error_append_string No value No value
Error_log No value No value
Error_prepend_string No value No value
Error_reporting 2039 6135
expose_php on
Extension_dir C:/appserv\php5\ext C:/appserv\php5\ext
File_uploads on
highlight.bg #FFFFFF #FFFFFF
Highlight.comment #FF8000 #FF8000
Highlight.default #0000BB #0000BB
highlight.html #000000 #000000
Highlight.keyword #007700 #007700
Highlight.string #DD0000 #DD0000
Html_errors on
Ignore_repeated_errors off off
Ignore_repeated_source off off
Ignore_user_abort off off
Implicit_flush off off
Include_path.; C:\AppServ\php5\pear.; C:\AppServ\php5\pear
Log_errors off off
Log_errors_max_len 1024 1024
MAGIC_QUOTES_GPC on
Magic_quotes_runtime off off
Magic_quotes_sybase off off
Mail.force_extra_parameters No value No value
Max_execution_time 30 30
Max_input_nesting_level 64 64
Max_input_time 60 60
Memory_limit 24M 24M
Open_basedir No value No value
Output_buffering No value No value
Output_handler No value No value
Post_max_size 80M 80M
Precision 12 12
Realpath_cache_size 16K 16K
Realpath_cache_ttl 120 120
REGISTER_ARGC_ARGV on
Register_globals on
Register_long_arrays on
Report_memleaks on
Report_zend_debug on
Safe_mode off off
Safe_mode_exec_dir No value No value
Safe_mode_gid off off
Safe_mode_include_dir No value No value
Sendmail_from No value No value
Sendmail_path No value No value
Serialize_precision 100 100
Short_open_tag on
SMTP localhost localhost
Smtp_port 25 25
Sql.safe_mode off off
Track_errors off off
Unserialize_callback_func No value No value
Upload_max_filesize 200M 200M
Upload_tmp_dir No value No value
User_dir No value No value
Variables_order Egpcs Egpcs
Xmlrpc_error_number 0 0
Xmlrpc_errors off off
Y2k_compliance on
Zend.ze1_compatibility_mode off off


To post the results of a phpinfo

PHP Version 5.2.6


System Windows NT yanyaozhen-d1 6.1 Build 7600
Build Date May 2 2008 18:01:20
Configure Command Cscript/nologo configure.js "--enable-snapshot-build" "--with-gd=shared" "--with-extra-includes=c : \program Files (x86) \microsoft Sdk\include; C:\progra~2\micros~2\vc98\atl\include; C:\progra~2\micros~2\vc98\include; C:\progra~2\micros~2\vc98\mfc\include ""--with-extra-libs=c:\program Files (x86) \microsoft SDK\Lib; C:\progra~2\micros~2\vc98\lib; C:\progra~2\micros~2\vc98\mfc\lib "
Server API Apache 2.0 Handler
Virtual Directory Support Enabled
Configuration File (php.ini) Path C:\Windows
Loaded Configuration File C:\Windows\php.ini
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build No
Thread Safety Enabled
Zend Memory Manager Enabled
IPV6 Support Enabled
Registered PHP Streams PHP, file, data, HTTP, FTP, Compress.zlib
Registered Stream Socket transports TCP, UDP
Registered Stream Filters convert.iconv.*, string.rot13, String.ToUpper, String.ToLower, String.strip_tags, convert.*, Consumed, zlib.*

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
With Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

PHP Credits

Configuration

PHP Core

Directive Local Value Master value
Allow_call_time_pass_reference on
Allow_url_fopen on
Allow_url_include off off
Always_populate_raw_post_data off off
Arg_separator.input & &
Arg_separator.output & &
Asp_tags off off
Auto_append_file No value No value
Auto_globals_jit on
Auto_prepend_file No value No value
Browscap No value No value
Default_charset No value No value
Default_mimetype text/html text/html
Define_syslog_variables off off
Disable_classes No value No value
Disable_functions No value No value
Display_errors on
Display_startup_errors off off
Doc_root No value No value
Docref_ext No value No value
Docref_root No value No value
ENABLE_DL on
Error_append_string No value No value
Error_log No value No value
Error_prepend_string No value No value
Error_reporting 2039 6135
expose_php on
Extension_dir C:/appserv\php5\ext C:/appserv\php5\ext
File_uploads on
highlight.bg #FFFFFF #FFFFFF
Highlight.comment #FF8000 #FF8000
Highlight.default #0000BB #0000BB
highlight.html #000000 #000000
Highlight.keyword #007700 #007700
Highlight.string #DD0000 #DD0000
Html_errors on
Ignore_repeated_errors off off
Ignore_repeated_source off off
Ignore_user_abort off off
Implicit_flush off off
Include_path.; C:\AppServ\php5\pear.; C:\AppServ\php5\pear
Log_errors off off
Log_errors_max_len 1024 1024
MAGIC_QUOTES_GPC on
Magic_quotes_runtime off off
Magic_quotes_sybase off off
Mail.force_extra_parameters No value No value
Max_execution_time 30 30
Max_input_nesting_level 64 64
Max_input_time 60 60
Memory_limit 24M 24M
Open_basedir No value No value
Output_buffering No value No value
Output_handler No value No value
Post_max_size 80M 80M
Precision 12 12
Realpath_cache_size 16K 16K
Realpath_cache_ttl 120 120
REGISTER_ARGC_ARGV on
Register_globals on
Register_long_arrays on
Report_memleaks on
Report_zend_debug on
Safe_mode off off
Safe_mode_exec_dir No value No value
Safe_mode_gid off off
Safe_mode_include_dir No value No value
Sendmail_from No value No value
Sendmail_path No value No value
Serialize_precision 100 100
Short_open_tag on
SMTP localhost localhost
Smtp_port 25 25
Sql.safe_mode off off
Track_errors off off
Unserialize_callback_func No value No value
Upload_max_filesize 200M 200M
Upload_tmp_dir No value No value
User_dir No value No value
Variables_order Egpcs Egpcs
Xmlrpc_error_number 0 0
Xmlrpc_errors off off
Y2k_compliance on
Zend.ze1_compatibility_mode off off

This is the upper part of the phpinfo, too long, so just post this part and see what the problem is

Set the httpd.conf in the
Php_flag display_errors on
Php_value error_reporting 2039

Cut them out!

Set the httpd.conf in the
Php_flag display_errors on
Php_value error_reporting 2039

Cut them out!
In fact, there is no such, but because the page does not show errors, it is said in the httpd.conf set two parameters can overwrite the relevant configuration in the php.ini, so later added so two lines, now removed, restart the server after the wrong PHP program, or not

It is recommended to reinstall and try again.

It is recommended to reinstall and try again.
All right...


It is recommended to reinstall and try again.
All right...

Sometimes, reloading is really the most effective way to do this without knowing what the reason is.

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