<p>I'm doing some PHP stuff on an Ubuntu server.</p>

<p>The path I'm working in is <strong>/mnt/dev-windows-data/Staging/mbiek/test_list</strong> but the PHP call <code>getcwd()</code> is returning <strong>/mnt/dev-windows/Staging/mbiek/test_list</strong> (notice how it's dev-windows instead of dev-windows-data).</p>

<p>There aren't any symbolic links anywhere. </p>

<p>Are there any other causes for <code>getcwd()</code> returning a different path from a local <code>pwd</code> call?</p>

<p><strong><em>Edit</em></strong>  </p>

<p>I figured it out.  The <strong>DOCUMENT_ROOT</strong> in PHP is set to <strong>/mnt/dev-windows</strong> which throws everything off.</p>

[{'answer_id': 30313, 'author': 'Ross', 'author_id': 2025, 'author_profile': 'https://Stackoverflow.com/users/2025', 'pm_score': 2, 'selected': True, 'text': "<p>Which file are you calling the getcwd() in and is that file is included into the one you are running (e.g. running index.php, including startup.php which contains gwtcwd()).</p>\n\n<p>Is the file you are running in /dev-windows/ or /dev-windows-data/? It works on the file you are actually running.</p>\n\n<hr>\n\n<p>Here's an example of my current project:</p>\n\n<p><strong>index.php</strong></p>\n\n<pre><code>&lt;?php\n    require_once('./includes/construct.php');\n    //snip\n?&gt;\n</code></pre>\n\n<p><strong>includes/construct.php</strong></p>\n\n<pre><code>&lt;?php\n    //snip\n    (!defined('DIR')) ? define('DIR', getcwd()) : NULL;\n\n    require_once(DIR . '/includes/functions.php');\n    //snip\n?&gt;\n</code></pre>\n"}, {'answer_id': 30351, 'author': 'Mark Biek', 'author_id': 305, 'author_profile': 'https://Stackoverflow.com/users/305', 'pm_score': 0, 'selected': False, 'text': '<p><a href="https://stackoverflow.com/questions/30307/why-would-getcwd-return-a-different-directory-than-a-local-pwd#30313">@Ross</a></p>\n\n<p>I thought that getcwd() was returning a filesystem path rather than a relative url path.</p>\n\n<p>Either way, the fact remains that the path /mnt/dev-windows <strong>doesn\'t</strong> exist while /mnt/dev-windows-data does.</p>\n'}, {'answer_id': 30363, 'author': 'Ross', 'author_id': 2025, 'author_profile': 'https://Stackoverflow.com/users/2025', 'pm_score': 0, 'selected': False, 'text': "<p>@Mark</p>\n\n<p>Well that's just plain weird!  What's your <code>include_path</code> - that could be messing thigns around. I've personally ditched it in favour of contants as it's just so temperamental (or I've never learned how to do it justice).</p>\n"}, {'answer_id': 30375, 'author': 'Mark Biek', 'author_id': 305, 'author_profile': 'https://Stackoverflow.com/users/305', 'pm_score': 0, 'selected': False, 'text': '<p><a href="https://stackoverflow.com/questions/30307/why-would-getcwd-return-a-different-directory-than-a-local-pwd#30363">@Ross</a></p>\n\n<p>I figured it out and updated the OP with the solution.</p>\n'}]
['https://Stackoverflow.com/questions/30307', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/305/']