{"id":306,"date":"2006-12-20T09:20:37","date_gmt":"2006-12-20T09:20:37","guid":{"rendered":"http:\/\/neosmart.net\/blog\/archives\/306"},"modified":"2013-08-26T18:14:13","modified_gmt":"2013-08-26T23:14:13","slug":"why-is-_server-considered-a-class","status":"publish","type":"post","link":"https:\/\/neosmart.net\/blog\/why-is-_server-considered-a-class\/","title":{"rendered":"Why is $_SERVER[] Considered a &ldquo;Class?&rdquo;"},"content":{"rendered":"<p>There seems to be a minor bug\/glitch in our <a href=\"https:\/\/neosmart.net\/IISRequestURI\/\" rel=\"follow\">Request_URI for Windows<\/a>\u00a0that we can&#8217;t figure out, so if anyone has any idea, please <a href=\"mailto:coding@neosmart.net\">give us a holler<\/a>, or post below if you like. Under times of high load (and sometimes without), PHP completely crashes and dies until the worker process is restarted with <code>Using $this not in object context<\/code> as the &#8220;die message&#8221; that shows up for all requests. However, our script <em>doesn&#8217;t use<\/em> a class, and makes no calls to one either.<\/p>\n<p><!--more--><\/p>\n<p>The actual line in question is<\/p>\n<pre>if (isset($_SERVER['HTTP_REQUEST_URI'])){<\/pre>\n<p>And there doesn&#8217;t seem to be any real reason for this to error out. <code>isset<\/code> is a global function, and <code>$_SERVER['HTTP_REQUEST_URI']<\/code> is a global variable. It&#8217;s an illogical error that shouldn&#8217;t happen; especially seeing as it will work for days on end, then suddenly die. The fact that it totally kills PHP on the server should be a clue that a bug is indeed present, but there&#8217;s a little problem: it&#8217;s not reproducible.<\/p>\n<p>If you can&#8217;t reproduce a bug and you&#8217;re not the developer, you might as well forget about getting it fixed. If it&#8217;s not reproducible, it&#8217;s unfixable. There&#8217;s a possibility however, that this is related to <a href=\"https:\/\/bugs.php.net\/bug.php?id=39819\" rel=\"follow\">PHP Bug #39819<\/a> which discusses a segfault under NetBSD when this error occurs &#8211; but it&#8217;s not the same. A listing of <a href=\"https:\/\/bugs.php.net\/search.php?cmd=display&amp;search_for=%2522Using+%2524this+outside+of+an+object+context%2522\" rel=\"follow\">all similar bugs<\/a>\u00a0doesn&#8217;t seem to turn anything up. We&#8217;re experiencing it on a Windows Server 2003 SP1 + IIS 6 + PHP 5.20, and have had reports from users on similar setups.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There seems to be a minor bug\/glitch in our Request_URI for Windows\u00a0that we can&#8217;t figure out, so if anyone has any idea, please give us a holler, or post below if you like. Under times of high load (and sometimes &hellip; <a href=\"https:\/\/neosmart.net\/blog\/why-is-_server-considered-a-class\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[71,124,54],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-software","tag-completerss","tag-php","tag-wordpress"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4xDa-4W","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":4,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":2213,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/posts\/306\/revisions\/2213"}],"wp:attachment":[{"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neosmart.net\/blog\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}