[PHP-BUG] Bug #61148 [NEW]: auto_prepend_file and auto_append_file seemingly load on favicon request
From: Operating system: FreeBSD7.3 (amd64) PHP version: 5.3.10 Package: *General Issues Bug Type: Bug Bug description:auto_prepend_file and auto_append_file seemingly load on favicon request Description: Pages that are loaded with auto_prepend_file and auto_append_file load multiple times per page request if there is no favicon.ico located in the root directory. I believe this only happens with chrome and IE, have not been able to replicate the issue with firefox. You will see using this configuration, if you load index.php your database will get at least 2 entries, one for '/index.php', and one for and one for '/favicon.ico/' This might just be a matter of appending the documentation if this is deemed "not a bug" because according the php.net manual auto_prepend_file and auto_append_file should function exactly as the require() function. However if this code was put in index.php as "require('prepend.php')" instead of being autoloaded it would always only load once. Test script: --- .htaccess: php_value auto_prepend_file /path_to_file/prepend.php prepend.php: query("INSERT INTO uri_test (uri, time) VALUES ('$_SERVER[REQUEST_URI]',now())"); ?> Expected result: expected result is that the prepend.php file only runs once per page load. Actual result: -- prepend.php loads when the browser is seemingly requesting the URI for the favicon.ico -- Edit bug report at https://bugs.php.net/bug.php?id=61148&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61148&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61148&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61148&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61148&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61148&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61148&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61148&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61148&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61148&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61148&r=support Expected behavior: https://bugs.php.net/fix.php?id=61148&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61148&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61148&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61148&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61148&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=61148&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61148&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61148&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61148&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61148&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61148&r=mysqlcfg
Bug #61148 [Opn]: auto_prepend_file and auto_append_file seemingly load on favicon request
Edit report at https://bugs.php.net/bug.php?id=61148&edit=1 ID: 61148 User updated by:khaos337 at gmail dot com Reported by:khaos337 at gmail dot com Summary:auto_prepend_file and auto_append_file seemingly load on favicon request Status: Open Type: Bug Package:*General Issues Operating System: FreeBSD7.3 (amd64) PHP Version:5.3.10 Block user comment: N Private report: N New Comment: I was able to confirm the issue occurs across all browsers including firefox Previous Comments: [2012-02-20 19:55:19] khaos337 at gmail dot com Description: Pages that are loaded with auto_prepend_file and auto_append_file load multiple times per page request if there is no favicon.ico located in the root directory. I believe this only happens with chrome and IE, have not been able to replicate the issue with firefox. You will see using this configuration, if you load index.php your database will get at least 2 entries, one for '/index.php', and one for and one for '/favicon.ico/' This might just be a matter of appending the documentation if this is deemed "not a bug" because according the php.net manual auto_prepend_file and auto_append_file should function exactly as the require() function. However if this code was put in index.php as "require('prepend.php')" instead of being autoloaded it would always only load once. Test script: --- .htaccess: php_value auto_prepend_file /path_to_file/prepend.php prepend.php: query("INSERT INTO uri_test (uri, time) VALUES ('$_SERVER[REQUEST_URI]',now())"); ?> Expected result: expected result is that the prepend.php file only runs once per page load. Actual result: -- prepend.php loads when the browser is seemingly requesting the URI for the favicon.ico -- Edit this bug report at https://bugs.php.net/bug.php?id=61148&edit=1
Bug #61148 [Fbk->Opn]: auto_prepend_file and auto_append_file seemingly load on favicon request
Edit report at https://bugs.php.net/bug.php?id=61148&edit=1 ID: 61148 User updated by:khaos337 at gmail dot com Reported by:khaos337 at gmail dot com Summary:auto_prepend_file and auto_append_file seemingly load on favicon request -Status: Feedback +Status: Open Type: Bug Package:*General Issues Operating System: FreeBSD7.3 (amd64) PHP Version:5.3.10 Block user comment: N Private report: N New Comment: I do have a 404 handler pointed at a .php script but I didn't even think of that because I didn't think it had anything to do with a favicon. As for how the web server is configure I'm not sure because I'm on a managed server so I don't have that access. I will test it with out the 404 redirect and get back to you. Previous Comments: [2012-02-20 20:26:09] ras...@php.net Wouldn't this only happen if you have your web server configured to send favicon.ico request through PHP? Or, perhaps if you have a 404 handler pointed at a PHP script? In a normally configured web server I don't see this happening. ---- [2012-02-20 20:23:34] khaos337 at gmail dot com I was able to confirm the issue occurs across all browsers including firefox ---- [2012-02-20 19:55:19] khaos337 at gmail dot com Description: Pages that are loaded with auto_prepend_file and auto_append_file load multiple times per page request if there is no favicon.ico located in the root directory. I believe this only happens with chrome and IE, have not been able to replicate the issue with firefox. You will see using this configuration, if you load index.php your database will get at least 2 entries, one for '/index.php', and one for and one for '/favicon.ico/' This might just be a matter of appending the documentation if this is deemed "not a bug" because according the php.net manual auto_prepend_file and auto_append_file should function exactly as the require() function. However if this code was put in index.php as "require('prepend.php')" instead of being autoloaded it would always only load once. Test script: --- .htaccess: php_value auto_prepend_file /path_to_file/prepend.php prepend.php: query("INSERT INTO uri_test (uri, time) VALUES ('$_SERVER[REQUEST_URI]',now())"); ?> Expected result: expected result is that the prepend.php file only runs once per page load. Actual result: -- prepend.php loads when the browser is seemingly requesting the URI for the favicon.ico -- Edit this bug report at https://bugs.php.net/bug.php?id=61148&edit=1
Bug #61148 [Nab]: auto_prepend_file and auto_append_file seemingly load on favicon request
Edit report at https://bugs.php.net/bug.php?id=61148&edit=1 ID: 61148 User updated by:khaos337 at gmail dot com Reported by:khaos337 at gmail dot com Summary:auto_prepend_file and auto_append_file seemingly load on favicon request Status: Not a bug Type: Bug Package:*General Issues Operating System: FreeBSD7.3 (amd64) PHP Version:5.3.10 Block user comment: N Private report: N New Comment: Understood, just one more quick question though. If the 404 page is the one causing the file to fire again, which would make sense because it is a php page, why wouldn't the $_SERVER['REQUEST_URI'] kick back the 404 page '/error404.php/' instead of '/favicon.ico/'? Previous Comments: [2012-02-20 20:34:36] ras...@php.net A favicon request is a request like any other. If the favicon.ico file doesn't exist the request will trigger a 404 and your 404 handler will be run. The same will happen if your main request tries to load images/css/js that don't exist, so you either need to make sure your main requests never generate a 404 or you need to make your 404 handler/prepend script smarter. You can have it check the requested URI and skip doing whatever it is you don't want it doing multiple times per page load. This isn't something we can fix at the PHP level. PHP is doing what you are asking it to do here. ---------------- [2012-02-20 20:30:49] khaos337 at gmail dot com I do have a 404 handler pointed at a .php script but I didn't even think of that because I didn't think it had anything to do with a favicon. As for how the web server is configure I'm not sure because I'm on a managed server so I don't have that access. I will test it with out the 404 redirect and get back to you. [2012-02-20 20:26:09] ras...@php.net Wouldn't this only happen if you have your web server configured to send favicon.ico request through PHP? Or, perhaps if you have a 404 handler pointed at a PHP script? In a normally configured web server I don't see this happening. ---------------- [2012-02-20 20:23:34] khaos337 at gmail dot com I was able to confirm the issue occurs across all browsers including firefox ---------------- [2012-02-20 19:55:19] khaos337 at gmail dot com Description: Pages that are loaded with auto_prepend_file and auto_append_file load multiple times per page request if there is no favicon.ico located in the root directory. I believe this only happens with chrome and IE, have not been able to replicate the issue with firefox. You will see using this configuration, if you load index.php your database will get at least 2 entries, one for '/index.php', and one for and one for '/favicon.ico/' This might just be a matter of appending the documentation if this is deemed "not a bug" because according the php.net manual auto_prepend_file and auto_append_file should function exactly as the require() function. However if this code was put in index.php as "require('prepend.php')" instead of being autoloaded it would always only load once. Test script: --- .htaccess: php_value auto_prepend_file /path_to_file/prepend.php prepend.php: query("INSERT INTO uri_test (uri, time) VALUES ('$_SERVER[REQUEST_URI]',now())"); ?> Expected result: expected result is that the prepend.php file only runs once per page load. Actual result: -- prepend.php loads when the browser is seemingly requesting the URI for the favicon.ico -- Edit this bug report at https://bugs.php.net/bug.php?id=61148&edit=1
Bug #61148 [Nab]: auto_prepend_file and auto_append_file seemingly load on favicon request
Edit report at https://bugs.php.net/bug.php?id=61148&edit=1 ID: 61148 User updated by:khaos337 at gmail dot com Reported by:khaos337 at gmail dot com Summary:auto_prepend_file and auto_append_file seemingly load on favicon request Status: Not a bug Type: Bug Package:*General Issues Operating System: FreeBSD7.3 (amd64) PHP Version:5.3.10 Block user comment: N Private report: N New Comment: redirect is done through htaccess ErrorDocument 404 /error404/ Previous Comments: [2012-02-20 20:44:18] ras...@php.net Because that wan't the requested uri? Depends on how you are doing the 404 redirect, I guess. [2012-02-20 20:39:08] khaos337 at gmail dot com Understood, just one more quick question though. If the 404 page is the one causing the file to fire again, which would make sense because it is a php page, why wouldn't the $_SERVER['REQUEST_URI'] kick back the 404 page '/error404.php/' instead of '/favicon.ico/'? [2012-02-20 20:34:36] ras...@php.net A favicon request is a request like any other. If the favicon.ico file doesn't exist the request will trigger a 404 and your 404 handler will be run. The same will happen if your main request tries to load images/css/js that don't exist, so you either need to make sure your main requests never generate a 404 or you need to make your 404 handler/prepend script smarter. You can have it check the requested URI and skip doing whatever it is you don't want it doing multiple times per page load. This isn't something we can fix at the PHP level. PHP is doing what you are asking it to do here. ---------------- [2012-02-20 20:30:49] khaos337 at gmail dot com I do have a 404 handler pointed at a .php script but I didn't even think of that because I didn't think it had anything to do with a favicon. As for how the web server is configure I'm not sure because I'm on a managed server so I don't have that access. I will test it with out the 404 redirect and get back to you. [2012-02-20 20:26:09] ras...@php.net Wouldn't this only happen if you have your web server configured to send favicon.ico request through PHP? Or, perhaps if you have a 404 handler pointed at a PHP script? In a normally configured web server I don't see this happening. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=61148 -- Edit this bug report at https://bugs.php.net/bug.php?id=61148&edit=1
[PHP-BUG] Bug #61180 [NEW]: $mysqli object created in auto_prepend_file closes before auto_append_file
From: Operating system: Free BSD PHP version: 5.3.10 Package: *General Issues Bug Type: Bug Bug description:$mysqli object created in auto_prepend_file closes before auto_append_file Description: If you initialize a $mysqli object in an auto_prepend_file it is unavailable in and auto_append_file, even though auto_prepend_file and auto_append_file Test script: --- .htaccess: php_value auto_prepend_file /path/to/file/prepend.php php_value auto_append_file /path/to/file/append.php prepend.php: $mysqli = new mysqli('localhost', 'user', 'pass', 'DBASE'); append.php: $mysqli->close(); (or any mysqli method) Expected result: No Errors Actual result: -- Warning: mysqli::close() [mysqli.close]: Couldn't fetch mysqli in /path/to/file/append.php -- Edit bug report at https://bugs.php.net/bug.php?id=61180&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61180&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61180&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61180&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61180&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61180&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61180&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61180&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61180&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61180&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61180&r=support Expected behavior: https://bugs.php.net/fix.php?id=61180&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61180&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61180&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61180&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61180&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=61180&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61180&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61180&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61180&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61180&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61180&r=mysqlcfg