From:             giorgio dot liscio at email dot it
Operating system: any
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:provide a way to handle "in Unknown on line 0" errors

Description:
------------
please read carefully! I really think this is important

when an error happens before the actual script execution (main(), "unknown
on line 0") it is not possible to handle and gracefully display the 
error in the user space

errors may be: "post content-length exceeded", "file upload size exceeded",
"max input time"... or the equivalent apache errors 
(LimitRequestBody for instance)

note that I'm not sure, or I don't remember, what exactly happens when some
of these errors happen, but --some of them don't block the php's 
execution--, like "post_max_size". But when the php's execution isn't
blocked I should be able to handle startup errors: nowadays I can't.

for example, a big file is uploaded on the server and the post data is
limited by some of the above.

now, the php page executes anyway because the "startup warning" doesn't
block the execution. But, as I said, in the user space, there is no way 
what exactly happened and what caused the error, the only way to handle
this is (I suppose) parsing error_get_last().

when the big file is sent to the server i may not have the complete form
data and in the user space I can't get the proof that is complete.

the only thing i can do is if(error_get_last()) throw new
Exception("Something went wrong with your request (???)");

then something must be done here to fix this problem. I don't have the
complete view of the problem but I hope to have been clear so you can fix 
this.

Some functions may be needed:

get_startup_errors();

that returns something like this:

    [0][message] => Post content data limit excedeed ...
    [0][startupErrType] => STARTUP_ERR_PARTIAL_POST

    [1][message] => Module 'ssh2' blah blah blah
    [1][startupErrType] => STARTUP_ERR_SERVER

    [2]...


where startupErrType consists in constants like these:

STARTUP_ERR_PARTIAL_POST          // partial data sent
STARTUP_ERR_EXCEDEED_INPUT_TIME   // excedeed input time
STARTUP_ERR_EXTENSION             // an extension caused the error
STARTUP_ERR_SERVER                // server caused the startup error


I hope to have been clear, my English isn't good.

have a happy new year!





-- 
Edit bug report at https://bugs.php.net/bug.php?id=63875&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63875&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63875&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63875&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63875&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63875&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63875&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63875&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63875&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63875&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63875&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63875&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63875&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63875&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63875&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63875&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63875&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63875&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63875&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63875&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63875&r=mysqlcfg

Reply via email to