|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-24 03:57 UTC] sander@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
Maybe this is the way it's supposed to work, but it doesn't make a whole lot of sense to me. When processing a HEAD request, mod_php executes the script as if it were a normal GET request. This is unexpected (at least to me) and can lead to unexpected results, such as duplicate execution when dealing with browsers that use a HEAD request prior to a GET request. For example, test script test.php: <?php $fp = fopen("test.out", "a"); fputs($fp, "I'm hit!"); fclose($fp); ?> and assuming test.out exists and is world-writable. HEAD /test.php HTTP/1.0 causes the file test.out to be appended to. This is not what I would expect, but maybe it's unavoidable. A workaround is to look at $_SERVER['REQUEST_METHOD'] and do nothing if it's a HEAD request. './configure' '--with-apxs=/usr/local/sbin/apxs' '--with-config-file-path=/usr/local/etc' '--enable-versioning' '--with-system-regex' '--disable-debug' '--enable-track-vars' '--without-gd' '--without-mysql' '--with-zlib' '--with-mcrypt=/usr/local' '--with-mysql=/usr/local' '--prefix=/usr/local' 'i386--freebsd4.5'