eirinikos Posted July 10, 2006 Share Posted July 10, 2006 Hi.. I'm having a strange problem where the current working directory is showing one folder up from where it should be.Im running the latest apache (2.2) and PHP 5 on windowsXPMy doc root is "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"Whenever I run a php script in the htdocs folder and echo getcwd() I get:C:\Program Files\Apache Software Foundation\Apache2.2I dont get it..the include path is set to "." for relative paths.. I tried setting the doc root in the php.ini file alsoI dont know what else the problem can be. Quote Link to comment https://forums.phpfreaks.com/topic/14183-getcwd-shows-that-php-thinks-its-in-the-wrong-folder/ Share on other sites More sharing options...
willfitch Posted July 10, 2006 Share Posted July 10, 2006 Would you mind posting your script? Quote Link to comment https://forums.phpfreaks.com/topic/14183-getcwd-shows-that-php-thinks-its-in-the-wrong-folder/#findComment-55726 Share on other sites More sharing options...
eirinikos Posted July 12, 2006 Author Share Posted July 12, 2006 sure..[code]<?phpecho getcwd():?>[/code][b]Output:[/b][code]C:\Program Files\Apache Software Foundation\Apache2.2[/code]the location of the file is C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.phpthe doc root of the web server is C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ Quote Link to comment https://forums.phpfreaks.com/topic/14183-getcwd-shows-that-php-thinks-its-in-the-wrong-folder/#findComment-56582 Share on other sites More sharing options...
keeB Posted July 12, 2006 Share Posted July 12, 2006 Hmmmmmmmmmm...[code=php:0]echo $_SERVER["DOCUMENT_ROOT"];echo " - " . $_SERVER["SCRIPT_FILENAME"];[/code] Quote Link to comment https://forums.phpfreaks.com/topic/14183-getcwd-shows-that-php-thinks-its-in-the-wrong-folder/#findComment-56612 Share on other sites More sharing options...
Daniel0 Posted July 12, 2006 Share Posted July 12, 2006 Is it the you using PHP as an Apache module, or are you using the CGI version? Quote Link to comment https://forums.phpfreaks.com/topic/14183-getcwd-shows-that-php-thinks-its-in-the-wrong-folder/#findComment-56623 Share on other sites More sharing options...
eirinikos Posted July 12, 2006 Author Share Posted July 12, 2006 New script:[code]<script language="php">echo getcwd();echo "<BR><BR>";echo $_SERVER["DOCUMENT_ROOT"];echo " <BR><BR> " . $_SERVER["SCRIPT_FILENAME"];</script>[/code]Output:[code]C:\Program Files\Apache Software Foundation\Apache2.2C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/info.php[/code]I am using the apache module. Quote Link to comment https://forums.phpfreaks.com/topic/14183-getcwd-shows-that-php-thinks-its-in-the-wrong-folder/#findComment-57004 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.