{"id":5695,"date":"2014-04-05T05:32:29","date_gmt":"2014-04-05T05:32:29","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/05\/problem-about-document-root-collection-of-common-programming-errors\/"},"modified":"2014-04-05T05:32:29","modified_gmt":"2014-04-05T05:32:29","slug":"problem-about-document-root-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/05\/problem-about-document-root-collection-of-common-programming-errors\/","title":{"rendered":"problem about document-root-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6beddf83604db885e4f17b317840d0fa?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndoitmyway<br \/>\napache document-root trailing-slash<br \/>\nI&#8217;ve got a framework I need to work with and the server configuration file for the live version (the working one) specifies the document root like this:define(&#8216;DOCUMENT_ROOT&#8217;, $_SERVER[&#8216;DOCUMENT_ROOT&#8217;]);Now if I try running the framework on my localhost machine I keep getting a server error.HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.It doesn&#8217;t work unless I do this:define(&#8216;DOCUMENT_ROOT&#8217;, $_SERVER[&#8216;DOCUME<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/70dec572279b4d9d364921287dc528c6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1481563<br \/>\nphp document-root<br \/>\nNot sure if I&#8217;m using this the right way&#8230;include $_SERVER[&#8216;DOCUMENT_ROOT&#8217;].&#8221;\/includes\/overall\/header.php&#8221;My page is in a subdirectory, and I want to include elements from other directories with a path based on the root.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/37451dee68129266dfc1560b581a2e36?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nsomething13<br \/>\nactionscript-3 removechild document-root<br \/>\nI&#8217;ve created 4 instances of Notes and I have them moving to the right until their x value is greater than 100. Once they&#8217;re there, how do I remove them? I ran a trace statement and confirmed that the parent of these instances is root (root1 to be exact). If I typeroot.removeChild(this); I get an error saying &#8220;call to a possibly undefined method removeChild&#8221; If I typeremoveChild(this); I get an error saying &#8220;The supplied DisplayObject must be a child of the caller&#8221;. Full code is posted below. Th<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3b6c0b47a0c430a0b141baee7ea845be?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBrad Werth<br \/>\nphp file-exists document-root<br \/>\nI tried the following code to check existence of file in root.if($res[&#8216;profile_picture&#8217;]!=&#8221;&#8221; &amp;&amp; file_exists(&#8220;images\/&#8221;.$res[&#8216;users_id&#8217;].&#8221;\/thumnails\/&#8221;.$res[&#8216;profile_picture&#8217;])){$photo_p=&#8221;images\/&#8221;.$res[&#8216;users_id&#8217;].&#8221;\/thumnails\/&#8221;.$res[&#8216;profile_picture&#8217;]; }It works only on root directory not sub directory. I&#8217;m not sure whether function file_exist checks for both absolute and relative paths so I tried adding ROOT and $_SERVER[&#8216;DOCUMENT_ROOT&#8217;]. But still it didn&#8217;t worked out. Any Help?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/MGhY2.png?s=32&amp;g=1\" \/><br \/>\nhakre<br \/>\nphp function include absolute-path document-root<br \/>\nindex.php&lt;?php require_once(&#8216;fr.php&#8217;); header(&#8216;Location:&#8217;.abspath().directory()); ?&gt;fr.php&lt;?php require_once(&#8216;functions.php&#8217;); ?&gt;functions.phpfunction abspath() { return $_SERVER[&#8216;DOCUMENT_ROOT&#8217;]; }Now when i go to index.php, it gives me this error:-Fatal error: Call to undefined function abspath() in C:\\xampp\\htdocs\\index.php on line 3<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>doitmyway apache document-root trailing-slash I&#8217;ve got a framework I need to work with and the server configuration file for the live version (the working one) specifies the document root like this:define(&#8216;DOCUMENT_ROOT&#8217;, $_SERVER[&#8216;DOCUMENT_ROOT&#8217;]);Now if I try running the framework on my localhost machine I keep getting a server error.HTTP Error 500 (Internal Server Error): An unexpected [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5695","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5695"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5695\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}