{"id":2118892,"date":"2011-06-07T03:42:26","date_gmt":"2011-06-07T03:42:26","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-working-directory-wordpress-issues\/"},"modified":"2016-08-20T00:45:18","modified_gmt":"2016-08-20T00:45:18","slug":"php-working-directory-wordpress-issues","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-working-directory-wordpress-issues\/","title":{"rendered":"PHP working directory, WordPress issues"},"content":{"rendered":"<p>Hello everyone, I&#8217;ve been debugging this for hours now, and I think I just need some help from someone that is more experienced with directory coding than myself. I get the following warnings:<\/p>\n<p>Warning: require_once(.\/admin-header.php) [function.require-once]: failed to open stream: No such file or directory in \/home\/mjmfxcom\/public_html\/xsv\/wp-admin\/themes.php on line 57<\/p>\n<p>Fatal error: require_once() [function.require]: Failed opening required &#8216;.\/admin-header.php&#8217; (include_path=&#8217;.:\/usr\/lib\/php:\/usr\/local\/lib\/php&#8217;) in \/home\/mjmfxcom\/public_html\/xsv\/wp-admin\/themes.php on line 57<\/p>\n<p>If I remove the &#8216;.\/&#8217; from the includes it&#8217;s kosher again.<\/p>\n<p>Basically what I&#8217;ve done is write a function that automatically registers and enques stylesheets and js files so I don&#8217;t have to do it manually for every theme I write. Here&#8217;s that function:<\/p>\n<p><em>[Code moderated as per the <a href=\"https:\/\/codex.wordpress.org\/Forum_Welcome\">Forum Rules<\/a>. Please use the <a href=\"http:\/\/wordpress.pastebin.com\/\">pastebin<\/a>]<\/em><\/p>\n<p>I&#8217;m 99% sure it&#8217;s because I&#8217;ve left the working directory as something it&#8217;s not supposed to be, but my understanding was that closedir() reset the working directory. Should I set it to the root WP directory rather than just closing it?<\/p>\n<p>Also, the function is rough by all means, but if you spot ways to improve it I&#8217;m all ears ;).<\/p>\n","protected":false},"template":"","class_list":["post-2118892","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2118892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2118892\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2118892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}