[PHP-DEV] [PHP4] Logging native PHP function calls
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I've this very very special problems and would ask for some hints, any helpful response is very appreciated :) The usual story: old system, big, clunky, legacy, PHP4, can't upgrade. We're having serious problems with MySQL and too many connections and so on, but we can't find out where the problematic cases are. We've gone already through lengthy auditing and logging sessions without real success. So my next idea: I go into the PHP source, in my case specifically into ext/mysql/php_mysql.c, reactive my old C skills and inject the logging of connects and queries directly into the source. Because, as ironic as it sounds, with the HUGE amount of code we have we still were not able to identify all places where mysql_(p)connect/mysql_query is used, because of using variable variables and other nice [tm] tricks. I understand my attempt is brute force and I'm pretty alone out there. So, actually I would start hacking away this very moment. But, if anyone has other suggestion how to go for this, it would be very very much appreciated. thanks for reading, - - Markus -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGb5Yj1nS0RcInK9ARAq75AJ95JT3BqFblyfd+FUG2EsKbN8TAdgCfQ0c/ YNTYC8qTPHgzIQPxiJsGJW0= =4wNf -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] FW: php fastcgi
Hi, Current time most PHP instalations use setting 'display_error=0'. This setting hides errors from user but may send to him just a blank page. The proposed patch sends HTTP 500 response on errors instead of blank pages. The pages that already wrote something are not affectd. Any objections or additions? Thanks. Dmitry. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FW: php fastcgi
I think that's a good idea. But wouldn't letting this be controlled in userland via set_error_handler / set_exception_handler be just as good? On 13/06/07, Dmitry Stogov [EMAIL PROTECTED] wrote: Hi, Current time most PHP instalations use setting 'display_error=0'. This setting hides errors from user but may send to him just a blank page. The proposed patch sends HTTP 500 response on errors instead of blank pages. The pages that already wrote something are not affectd. Any objections or additions? Thanks. Dmitry. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PHP4] Logging native PHP function calls
http://xdebug.org/ On 6/13/07, Markus Fischer [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I've this very very special problems and would ask for some hints, any helpful response is very appreciated :) The usual story: old system, big, clunky, legacy, PHP4, can't upgrade. We're having serious problems with MySQL and too many connections and so on, but we can't find out where the problematic cases are. We've gone already through lengthy auditing and logging sessions without real success. So my next idea: I go into the PHP source, in my case specifically into ext/mysql/php_mysql.c, reactive my old C skills and inject the logging of connects and queries directly into the source. Because, as ironic as it sounds, with the HUGE amount of code we have we still were not able to identify all places where mysql_(p)connect/mysql_query is used, because of using variable variables and other nice [tm] tricks. I understand my attempt is brute force and I'm pretty alone out there. So, actually I would start hacking away this very moment. But, if anyone has other suggestion how to go for this, it would be very very much appreciated. thanks for reading, - - Markus -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGb5Yj1nS0RcInK9ARAq75AJ95JT3BqFblyfd+FUG2EsKbN8TAdgCfQ0c/ YNTYC8qTPHgzIQPxiJsGJW0= =4wNf -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- Alexey Zakhlestin http://blog.milkfarmsoft.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PHP4] Logging native PHP function calls
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Alexey, Stefan, first thanks for the replies! Actually I'm in general aware of xdebug, however I didn't know it met my criteria. The thing is: I need to know specific information of the mysql operations: 1) host,user,pass of connects/pconnects (and which type of connect), count of connects this very request already had 2) sql statement on query, execution time, count of how many statements this very request already had Additional to that I need information like: * server ip (multiple servers) * remote ip * http host (zillions of vhosts) * uri * user agent string This is what we currently log for debugging, but we're unable to fully coverage all sources. As can be seen, my idea was to have a single place where to log things from all servers/vhosts/applications, because they also make use of the single mysql.so driver. Is this possible with xdebug in this manner? With my current information I really need this information and to my knowledge (falsely?) I can't this out of xdebug. Probably important to note, I've been using xdebug in the past, profiling things, but I don't see this possible in production environment running and getting out the the information I need. thank you, - - Markus Alexey Zakhlestin wrote: http://xdebug.org/ On 6/13/07, Markus Fischer [EMAIL PROTECTED] wrote: Hi, I've this very very special problems and would ask for some hints, any helpful response is very appreciated :) The usual story: old system, big, clunky, legacy, PHP4, can't upgrade. We're having serious problems with MySQL and too many connections and so on, but we can't find out where the problematic cases are. We've gone already through lengthy auditing and logging sessions without real success. So my next idea: I go into the PHP source, in my case specifically into ext/mysql/php_mysql.c, reactive my old C skills and inject the logging of connects and queries directly into the source. Because, as ironic as it sounds, with the HUGE amount of code we have we still were not able to identify all places where mysql_(p)connect/mysql_query is used, because of using variable variables and other nice [tm] tricks. I understand my attempt is brute force and I'm pretty alone out there. So, actually I would start hacking away this very moment. But, if anyone has other suggestion how to go for this, it would be very very much appreciated. thanks for reading, - Markus - -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGb8eB1nS0RcInK9ARAoi7AJ0THIJ3VH/43Glq7VuxgpFPqlKieQCdHc8/ VLK3Jox+9AfcNzN4bLf/n7E= =VYuh -END PGP SIGNATURE- -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] [PHP4] Logging native PHP function calls
Hi Markus, The thing is: I need to know specific information of the mysql operations: 1) host,user,pass of connects/pconnects (and which type of connect), count of connects this very request already had 2) sql statement on query, execution time, count of how many statements this very request already had You can configure xdebug to create a trace log showing the parameters passed to the called functions. This could be a basis for what you need. Additional to that I need information like: * server ip (multiple servers) * remote ip * http host (zillions of vhosts) * uri * user agent string A quick and maybe dirty idea that comes to my mind is to add a function call in your application that has these parameter (easy to gather from $_SERVER etc.) so they show up in the trace logs. Then it's a matter of processing a gazillion lines of trace log to get out the information you need, but at least it should be there. in the past, profiling things, but I don't see this possible in production environment running and getting out the the information I need. Trace logging in a production environment *absolutely* kills your performance, so if you have to dedicated test environment, hmmm. But would you actually create a patched PHP and deploy this in your production environment. Then I personally would rather opt for running an xdebug-based trace Sunday morning at 4 am. Kind regards, Stefan -- e-novative - We make IT work for you. e-novative GmbH - HR: Amtsgericht München HRB 139407 Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch http://www.e-novative.de -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Windows and Memory Limit of -1
Hi. Are there any special concerns for setting memory_limit to -1 in PHP.INI on Windows (using Sambar Server, not IIS/Apache). I'm getting Out of memory errors recently. Memory is good. Admittedly the code is trying to add a 12MG file as an attachment (using htmlmimemail5 from phpguru.org). 5MG attachments are OK, but the 12MG isn't. The server is internal so the limit is not required. Confused. -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Building on Windows
Hi Has anyone built PHP6 using Visual C++ Express Edition V8? The symptoms I get are pretty well described in http://bugs.php.net/bug.php?id=39130 and I'm just wondering if this was fixed for PHP5 and not PHP6? Zoe Slattery IBM UK -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] apache_child_terminate on Apache 2.x
So, Gentoo has removed Apache 1.3 from Portage. RedHat and others has not installed it for years. Frankly, the only reason we have for sticking with 1.3 is the lack of apache_child_terminate support in PHP for Apache 2. Does Apache 2 simply not provide this anymore? Was it left out for a philosophical reason? Was it just over looked? Like it or not, PHP is gonna have to work well on Apache 2 at some point. I don't like it, but its reality. AFAIK, this is the only apache function that does not work in Apache 2. -- Brian Moon Senior Developer -- http://dealnews.com/ It's good to be cheap =) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FW: php fastcgi
On Wed, June 13, 2007 2:07 am, Dmitry Stogov wrote: Current time most PHP instalations use setting 'display_error=0'. This setting hides errors from user but may send to him just a blank page. The proposed patch sends HTTP 500 response on errors instead of blank pages. The pages that already wrote something are not affectd. Any objections or additions? This sounds perfectly reasonable... But I suspect some users might prefer a 404 or a customizable response of some type... At the risk of incurring the wrath of list members, perhaps yet another php.ini configuration switch could be considered?... I wouldn't hold up the 500 patch for long with this kind of discussion, but it's worth taking a few minutes to consider, I think. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Windows and Memory Limit of -1
It's an intranet server. I rebooted and it is working. It IS saying out of memory [13-Jun-2007 11:38:51] PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 12729537 bytes) in C:\PHP\PHP5\Includes\htmlMimeMail5\htmlMimeMail5.php on line 940 [13-Jun-2007 11:40:02] PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 12728784 bytes) in C:\PHP\PHP5\Includes\htmlMimeMail5\htmlMimeMail5.php on line 940 [13-Jun-2007 11:42:04] PHP Fatal error: Out of memory (allocated 1572864) (tried to allocate 12735907 bytes) in C:\PHP\PHP5\Includes\htmlMimeMail5\htmlMimeMail5.php on line 940 and phpinfo() does show -1 for memory limit. I must admit it hadn't been rebooted for nearly 2 months. Wait and see time I think. On 13/06/07, Richard Lynch [EMAIL PROTECTED] wrote: On Wed, June 13, 2007 7:09 am, Richard Quadling wrote: Hi. Are there any special concerns for setting memory_limit to -1 in PHP.INI on Windows (using Sambar Server, not IIS/Apache). I'm getting Out of memory errors recently. Memory is good. Admittedly the code is trying to add a 12MG file as an attachment (using htmlmimemail5 from phpguru.org). 5MG attachments are OK, but the 12MG isn't. The server is internal so the limit is not required. Confused. Is this a production server which might literally be running out of RAM?... If so, not much can be done to fix that... :-v Does the error actually say out of memory or memory limit reached? I *think* you get different error if you are triggering the memory_limit than, say, really running out of RAM. Also double-check phpinfo() to be sure your memory_limit setting is what you think it is. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- - Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 Standing on the shoulders of some very clever giants! -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] FW: php fastcgi
Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. Thanks. Dmitry. -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 8:17 PM To: Dmitry Stogov Cc: 'internals Mailing List'; Stanislav Malyshev; Andrei Nigmatulin Subject: Re: [PHP-DEV] FW: php fastcgi On Wed, June 13, 2007 2:07 am, Dmitry Stogov wrote: Current time most PHP instalations use setting 'display_error=0'. This setting hides errors from user but may send to him just a blank page. The proposed patch sends HTTP 500 response on errors instead of blank pages. The pages that already wrote something are not affectd. Any objections or additions? This sounds perfectly reasonable... But I suspect some users might prefer a 404 or a customizable response of some type... At the risk of incurring the wrath of list members, perhaps yet another php.ini configuration switch could be considered?... I wouldn't hold up the 500 patch for long with this kind of discussion, but it's worth taking a few minutes to consider, I think. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Windows and Memory Limit of -1
On Wed, June 13, 2007 7:09 am, Richard Quadling wrote: Hi. Are there any special concerns for setting memory_limit to -1 in PHP.INI on Windows (using Sambar Server, not IIS/Apache). I'm getting Out of memory errors recently. Memory is good. Admittedly the code is trying to add a 12MG file as an attachment (using htmlmimemail5 from phpguru.org). 5MG attachments are OK, but the 12MG isn't. The server is internal so the limit is not required. Confused. Is this a production server which might literally be running out of RAM?... If so, not much can be done to fix that... :-v Does the error actually say out of memory or memory limit reached? I *think* you get different error if you are triggering the memory_limit than, say, really running out of RAM. Also double-check phpinfo() to be sure your memory_limit setting is what you think it is. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FW: php fastcgi
Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. set_error_code(500) (or set_error_code(404)) might help? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] FW: php fastcgi
Where is the propsed patch? I was thinking about a (not SAPI specific the subject indicates) modification to the php-output parts that sends a HTTP status 500 when a fatal error occurs and no output was yet send (SAPI did not start the response). I think there is no need for a configuration setting. A CGI program that crashes on startup creates error 500, a servlet/JSP that does not startup creates error 500,... In principle SAPI should return a FAILURE to the webserver from the handler function and set the status code before. The webserver then generates the default error page. - Uwe Schindler [EMAIL PROTECTED] - http://www.php.net NSAPI SAPI developer Bremen, Germany -Original Message- From: Dmitry Stogov [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 6:54 PM To: [EMAIL PROTECTED] Cc: 'internals Mailing List'; 'Stanislav Malyshev'; 'Andrei Nigmatulin' Subject: RE: [PHP-DEV] FW: php fastcgi Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. Thanks. Dmitry. -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 8:17 PM To: Dmitry Stogov Cc: 'internals Mailing List'; Stanislav Malyshev; Andrei Nigmatulin Subject: Re: [PHP-DEV] FW: php fastcgi On Wed, June 13, 2007 2:07 am, Dmitry Stogov wrote: Current time most PHP instalations use setting 'display_error=0'. This setting hides errors from user but may send to him just a blank page. The proposed patch sends HTTP 500 response on errors instead of blank pages. The pages that already wrote something are not affectd. Any objections or additions? This sounds perfectly reasonable... But I suspect some users might prefer a 404 or a customizable response of some type... At the risk of incurring the wrath of list members, perhaps yet another php.ini configuration switch could be considered?... I wouldn't hold up the 500 patch for long with this kind of discussion, but it's worth taking a few minutes to consider, I think. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FW: php fastcgi
On 6/13/07, Stanislav Malyshev [EMAIL PROTECTED] wrote: Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. set_error_code(500) (or set_error_code(404)) might help? -- I am with set_error_code +1 Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- David Coallier, Founder Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FW: php fastcgi
Returning 404 (or any other code other than 500) does not make sense. If an user sees a Page not found error, he probably won't bother and won't come back / delete his bookmark. On the other hand, if a search engine bot stumbles upon one of these, the page is automatically erased from the index, no questions asked. Off-hand, I can see these two consequences, on top of not respecting the HTTP standard. This seems obvious but am I missing something ? On 6/13/07, David Coallier [EMAIL PROTECTED] wrote: On 6/13/07, Stanislav Malyshev [EMAIL PROTECTED] wrote: Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. set_error_code(500) (or set_error_code(404)) might help? -- I am with set_error_code +1 Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- David Coallier, Founder Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- Nicolas Bérard-Nault ([EMAIL PROTECTED]) Étudiant D.E.C. Sciences, Lettres Arts Cégep de Sherbrooke Homepage: http://nicobn.googlepages.com
Re: [PHP-DEV] FW: php fastcgi
On Wednesday 13 June 2007 21:45, Nicolas Bérard-Nault wrote: Returning 404 (or any other code other than 500) does not make sense. If an user sees a Page not found error, he probably won't bother and won't come back / delete his bookmark. On the other hand, if a search engine bot stumbles upon one of these, the page is automatically erased from the index, no questions asked. Off-hand, I can see these two consequences, on top of not respecting the HTTP standard. At least for fastcgi SAPI code other than 500 does make sense, since most web servers use 500 as Backend unavailable (connection refused). What if people need to distinguish these two ? This seems obvious but am I missing something ? On 6/13/07, David Coallier [EMAIL PROTECTED] wrote: On 6/13/07, Stanislav Malyshev [EMAIL PROTECTED] wrote: Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. set_error_code(500) (or set_error_code(404)) might help? -- I am with set_error_code +1 Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- David Coallier, Founder Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- Andrei Nigmatulin GPG PUB KEY 6449830D Now I lay me down to sleep(3) Pray the OS my core to keep If I die before I wake Pray the Disk my core to take -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FW: php fastcgi
Hmm, maybe you're talking about 503, which is not exactly the same thing as 500. Take a look at RFC 2616, section 10. On 6/13/07, Andrei Nigmatulin [EMAIL PROTECTED] wrote: On Wednesday 13 June 2007 21:45, Nicolas Bérard-Nault wrote: Returning 404 (or any other code other than 500) does not make sense. If an user sees a Page not found error, he probably won't bother and won't come back / delete his bookmark. On the other hand, if a search engine bot stumbles upon one of these, the page is automatically erased from the index, no questions asked. Off-hand, I can see these two consequences, on top of not respecting the HTTP standard. At least for fastcgi SAPI code other than 500 does make sense, since most web servers use 500 as Backend unavailable (connection refused). What if people need to distinguish these two ? This seems obvious but am I missing something ? On 6/13/07, David Coallier [EMAIL PROTECTED] wrote: On 6/13/07, Stanislav Malyshev [EMAIL PROTECTED] wrote: Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. set_error_code(500) (or set_error_code(404)) might help? -- I am with set_error_code +1 Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- David Coallier, Founder Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- Andrei Nigmatulin GPG PUB KEY 6449830D Now I lay me down to sleep(3) Pray the OS my core to keep If I die before I wake Pray the Disk my core to take -- Nicolas Bérard-Nault ([EMAIL PROTECTED]) Étudiant D.E.C. Sciences, Lettres Arts Cégep de Sherbrooke Homepage: http://nicobn.googlepages.com
Re: [PHP-DEV] FW: php fastcgi
On Wednesday 13 June 2007 22:17, Nicolas Bérard-Nault wrote: Hmm, maybe you're talking about 503, which is not exactly the same thing as 500. Take a look at RFC 2616, section 10. 10.5.4 503 Service Unavailable The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. This error have nothing to do with backend (gateway). On 6/13/07, Andrei Nigmatulin [EMAIL PROTECTED] wrote: On Wednesday 13 June 2007 21:45, Nicolas Bérard-Nault wrote: Returning 404 (or any other code other than 500) does not make sense. If an user sees a Page not found error, he probably won't bother and won't come back / delete his bookmark. On the other hand, if a search engine bot stumbles upon one of these, the page is automatically erased from the index, no questions asked. Off-hand, I can see these two consequences, on top of not respecting the HTTP standard. At least for fastcgi SAPI code other than 500 does make sense, since most web servers use 500 as Backend unavailable (connection refused). What if people need to distinguish these two ? This seems obvious but am I missing something ? On 6/13/07, David Coallier [EMAIL PROTECTED] wrote: On 6/13/07, Stanislav Malyshev [EMAIL PROTECTED] wrote: Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. set_error_code(500) (or set_error_code(404)) might help? -- I am with set_error_code +1 Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- David Coallier, Founder Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- Andrei Nigmatulin GPG PUB KEY 6449830D Now I lay me down to sleep(3) Pray the OS my core to keep If I die before I wake Pray the Disk my core to take -- Andrei Nigmatulin GPG PUB KEY 6449830D Now I lay me down to sleep(3) Pray the OS my core to keep If I die before I wake Pray the Disk my core to take -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] FW: php fastcgi
Oh, sorry. The patch was filtered :) I am sendig it again. It is sapi independent. Thanks. Dmitry. -Original Message- From: Uwe Schindler [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 9:08 PM To: 'Dmitry Stogov'; [EMAIL PROTECTED] Cc: 'internals Mailing List'; 'Stanislav Malyshev'; 'Andrei Nigmatulin' Subject: RE: [PHP-DEV] FW: php fastcgi Where is the propsed patch? I was thinking about a (not SAPI specific the subject indicates) modification to the php-output parts that sends a HTTP status 500 when a fatal error occurs and no output was yet send (SAPI did not start the response). I think there is no need for a configuration setting. A CGI program that crashes on startup creates error 500, a servlet/JSP that does not startup creates error 500,... In principle SAPI should return a FAILURE to the webserver from the handler function and set the status code before. The webserver then generates the default error page. - Uwe Schindler [EMAIL PROTECTED] - http://www.php.net NSAPI SAPI developer Bremen, Germany -Original Message- From: Dmitry Stogov [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 6:54 PM To: [EMAIL PROTECTED] Cc: 'internals Mailing List'; 'Stanislav Malyshev'; 'Andrei Nigmatulin' Subject: RE: [PHP-DEV] FW: php fastcgi Configuaratin option make sense, but PHP already has too many configuration options especialliy for error reprting. I would like to avoid new ones. Thanks. Dmitry. -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 8:17 PM To: Dmitry Stogov Cc: 'internals Mailing List'; Stanislav Malyshev; Andrei Nigmatulin Subject: Re: [PHP-DEV] FW: php fastcgi On Wed, June 13, 2007 2:07 am, Dmitry Stogov wrote: Current time most PHP instalations use setting 'display_error=0'. This setting hides errors from user but may send to him just a blank page. The proposed patch sends HTTP 500 response on errors instead of blank pages. The pages that already wrote something are not affectd. Any objections or additions? This sounds perfectly reasonable... But I suspect some users might prefer a 404 or a customizable response of some type... At the risk of incurring the wrath of list members, perhaps yet another php.ini configuration switch could be considered?... I wouldn't hold up the 500 patch for long with this kind of discussion, but it's worth taking a few minutes to consider, I think. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php Index: main/main.c === RCS file: /repository/php-src/main/main.c,v retrieving revision 1.640.2.23.2.35 diff -u -p -d -r1.640.2.23.2.35 main.c --- main/main.c 18 Apr 2007 09:38:56 - 1.640.2.23.2.35 +++ main/main.c 21 May 2007 10:39:01 - @@ -834,17 +834,29 @@ static void php_error_cb(int type, const /* no break - intentionally */ case E_ERROR: case E_RECOVERABLE_ERROR: - /* case E_PARSE: the parser would return 1 (failure), we can bail out nicely */ + case E_PARSE: case E_COMPILE_ERROR: case E_USER_ERROR: EG(exit_status) = 255; if (module_initialized) { - /* restore memory limit */ - zend_set_memory_limit(PG(memory_limit)); - efree(buffer); - zend_objects_store_mark_destructed(EG(objects_store) TSRMLS_CC); - zend_bailout(); - return; + if (!PG(display_errors) + !SG(headers_sent) + SG(sapi_headers).http_response_code == 200) { + sapi_header_line ctr = {0}; + + ctr.line = HTTP/1.0 500 Internal Server Error; + ctr.line_len = strlen(ctr.line); + sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC); + } + /* the parser would return 1 (failure), we can bail out nicely */ + if (type != E_PARSE) { + /* restore memory limit */ +
Re: [PHP-DEV] FW: php fastcgi
Oh, sorry. The patch was filtered :) I am sendig it again. It is sapi independent. I think we could extend it by allowing people to specify the error code (and maybe also error string - though not sure it's needed) - something like set_error_code() function. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] FW: php fastcgi
I thought the goal of the patch was to display an error page on things like syntax errors? Sure, one of. in that case, set_error_code() would never be called..., even if it Why not? PHP scripts often consist of dozens of files, and the fatal error could happen in any of them beofre any outpus is produced, but some code already had chance to run. would be called, why would you want to change the error code and into what? I wouldn't. :) But I see some people here have some things they would like to change there, so why not to help them? -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php