PHP C++ extension on Windows: setting the working directory the same as PHP
| From: | O'Neil Delpratt | Date: | Wed, 02 Apr 2014 13:14:54 +0000 |
| Subject: | PHP C++ extension on Windows: setting the working directory the same as PHP | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-73517@lists.php.net to get a copy of this message | ||
Hi,
I am having trouble getting the correct working directory in the C/C++ code of my PHP extension. It
should be the same as the PHP working directory, but it is not.
I have tried looking this on the web, but with not much joy. I found a blog which describes my
problem:
https://www.ibm.com/developerworks/community/blogs/phpblog/entry/comparing_windows_and_php_working?lang=en
In linux the C function getcwd() does as expected. It is the same as the PHP cwd, but on windows it
always uses the “C:\Program Files\Apache software Foundation\Apache2.2”,
whereas in my php script the call ‘echo getcwd();’ returns “C:\www\html” as expected.
Please may someone point me in the write direction of how to get to the PHP current working
directory in a C/C++ PHP extension.
Thanks in advance,
-------------------------------
O'Neil Delpratt
Software Developer, Saxonica Limited Email: oneil@saxonica.com
Tel: +44 118 946 5894
Web: http://www.saxonica.com
Saxonica Community site: http://dev.saxonica.com
Bug tracking site: https://saxonica.plan.io/