PHP Wintel: different CWP depending on user permissions
Posted: Mon Dec 28, 2009 12:36 pm
This is most likely Windows specific. Here is my config:
I installed a fairly complex system I have been writing locally on my PC. I am an admin on the server and when I load the start page everything works great. Just like it does in my development environment.
I use several common files that are included in the early part of the php file as it is executed:
I have set everyone else up in my environment with read and execute permissions to the folder where the code is executed through an AD group (it was not enough to simply use the anonymous IIS user - although I have enabled anonymous access and given rights to that user).
When executed as admin the paths are resolved correctly, but as any other user the paths are not reliable and I get the following error:
Does anyone have any insight into why this happens? I know I can force the directory to where the code is executing, but this is not elegant. Ideas. Comments?
Thanks.
Brad
The OS is windows 2003 Advanced Server (32bit) SP1.System Windows NT SCBENAWEB10 5.2 build 3790
Build Date Dec 8 2008 19:30:48
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template" "--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"
Server API ISAPI
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINNT
Loaded Configuration File C:\Program Files\PHP\php.ini
Scan this dir for additional .ini files (none)
additional .ini files parsed (none)
I installed a fairly complex system I have been writing locally on my PC. I am an admin on the server and when I load the start page everything works great. Just like it does in my development environment.
I use several common files that are included in the early part of the php file as it is executed:
Code: Select all
require_once ('./includes/functions.php');
require_once ('./includes/mysql_connect.php');When executed as admin the paths are resolved correctly, but as any other user the paths are not reliable and I get the following error:
I have echoed the actual CWD and have been surprised to see it is not where the script is executing when I am a general user. This breaks all the code as I used relative file paths.Warning: require_once(./includes/functions.php) [function.require-once]: failed to open stream: No such file or directory in E:\dailyReport\index.php on line 32
Fatal error: require_once() [function.require]: Failed opening required './includes/functions.php' (include_path='.;C:\php5\pear') in E:\dailyReport\index.php on line 32
Does anyone have any insight into why this happens? I know I can force the directory to where the code is executing, but this is not elegant. Ideas. Comments?
Thanks.
Brad