mod-php

Detect browser connection closed in PHP

假装没事ソ 提交于 2019-12-01 04:51:16
Does anyone know if it is possible to detect whether the browser has closed the connection during the execution of a long PHP script, when using apache and mod_php ? For example, in Java , the HttpOutputStream will throw an exception if one attempts to write to it after the browser has closed it -- Or will respond negatively to checkError() . Use connection_aborted() In at least PHP4, connection_aborted and connection_status only worked after the script sent any output to the browser (using: flush() | ob_flush()). Also don't expect accurately timed results. It's mostly useful to check if there

Disable HTML stack traces by Xdebug

夙愿已清 提交于 2019-11-27 15:56:14
问题 The administrator has installed Xdebug 2.1.1 in our shared PHP 5.3.0 server in order to use its debugger. Now, I can hardly read the stack traces of uncatched exceptions because they are formatted by Xdebug with annoying colours that interact badly with the site's CSS: Since PHP runs as Apache module, I've tried to disable this feature in an .htaccess file but I can't make it go: php_flag xdebug.default_enable Off php_flag xdebug.overload_var_dump Off php_flag xdebug.show_exception_trace Off

Call PHP from virtual/custom “web server”

家住魔仙堡 提交于 2019-11-27 04:55:49
Basically, I'm trying to figure out how PHP can be called from a "web server". I've read the documentation, but it didn't help much. As far as I can tell, there are three ways to invoke PHP: via command line (eg: php -f "/path/to/script.php" ) via CGI(??) / via FastCGI (???) via a web server (eg: Apache) module So let's start with CGI . Maybe I'm just blind, but the spec doesn't mention how on Earth the web server passes data (headers & callbacks) to the thing implementing CGI. The situation is even worse with FastCGI . Next up, we have server-specific modules, which, I don't even know what to

Call PHP from virtual/custom “web server”

ⅰ亾dé卋堺 提交于 2019-11-26 12:46:44
问题 Basically, I\'m trying to figure out how PHP can be called from a \"web server\". I\'ve read the documentation, but it didn\'t help much. As far as I can tell, there are three ways to invoke PHP: via command line (eg: php -f \"/path/to/script.php\" ) via CGI(??) / via FastCGI (???) via a web server (eg: Apache) module So let\'s start with CGI. Maybe I\'m just blind, but the spec doesn\'t mention how on Earth the web server passes data (headers & callbacks) to the thing implementing CGI. The