Re: Totally blank page served up when any major PHP errors occur



Gary Hasler wrote:
Jerry Stuckle wrote:
Gary Hasler wrote:
When I have a major PHP error, I get a totally blank page (no html at all), just the header.
"HTTP/1.x 500 Internal Server Error..." etc.
In the apache error log, it reads something like:
"PHP Parse error: parse error in C:\\www\\inprogress_project.php on line 26..."

This is our in-house server used for testing, so I have all error reporting turned on full (I think). EG in php.ini, I have: "error_reporting = E_ALL" and "display_errors = On". Why am I just getting a blank page?

[Apache 2.0.55; PHP 5.2.99; Windows XP Pro SP3]

You may not be using the php.ini file you think you are. Set up a page with just:

<?php
phpinfo();
?>

Also - are you running PHP as an Apache module or a CGI?

Always running as Apache module.
According to phpinfo:
Loaded Configuration File: "C:\Program Files\PHP\php.ini"
which contains the following (commented lines removed):
----
[PHP]
engine = On
zend.ze1_compatibility_mode = Off
short_open_tag = Off
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = Off
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
variables_order = "GPCS"
register_globals = Off
register_long_arrays = Off
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
extension_dir = "./"
enable_dl = On
file_uploads = On
upload_max_filesize = 2M
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
upload_tmp_dir="C:\WINDOWS\Temp"
session.save_path="C:\WINDOWS\Temp"
etc...

But what does phpinfo() show for those settings? They can be overridden, i.e in your Apache configuration or .htaccess file.

Also,what is the failing line in your code? A parse error *should* be displayed, but it looks like it's such a severe error that the web server is crashing.

I am curious where you got the php-5.2.99 - or is that just a typo?

Also - check your phpinfo() for the extensions you have loaded, and what you should have loaded.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: write with cURL
    ... execute permissions. ... This is assuming that the PHP script runs ... of potential security risks from other users on the same server. ... Apache as the global web server user and thus needs world write ...
    (alt.php)
  • Re: Apache vs IIS
    ... Windows Server not on my Linux Server so there for I would chose IIS. ... Not that Apache is bad but ASP.NET is far easier and faster to create good web forms in. ... PHP on a IIS server is rather easy to run once you install PHP on a PC but if you only use PHP why not use Apache for Windows. ...
    (alt.php)
  • Re: Apache vs IIS
    ... my Windows Server not on my Linux Server so there for I would ... IIS is designed for ASP, ... can run asp on Apache, ... in running php from IIS vs Apache. ...
    (alt.php)
  • RE: Virtual hosts and PHP "downloads": php5 and apache22 on FreeBSD6.1-STABLE
    ... Apache web server. ... Subject: Virtual hosts and PHP "downloads": php5 and apache22 on ...
    (freebsd-questions)
  • Re: Virtual hosts and PHP "downloads": php5 and apache22 on FreeBSD6.1-STABLE
    ... Apache web server. ... Subject: Virtual hosts and PHP "downloads": php5 and apache22 on ...
    (freebsd-questions)