I'm running Xampp on a Windows Server ; Apache is running as a service with a local account. On this server, a network share is mounted as X: with specific credentials.
I want to access files located on X: and run the following code
<?php
echo shell_exec("whoami");
fopen('X:\\text.txt',"r");
?>
and get
theservername\thelocaluser
Warning: fopen(X:\text.txt) [function.fopen]: failed to open stream: No such file or directory
I tried to run Apache, not as a service but directly by launching httpd.exe ... and the code worked.
I can't see what causes the difference between the service and the application and how to make it works.