# Using symbolic link directories with Apache, PHP and Windows 7

I am trying to setup a symbolic link for a directory and I am getting the strangest error. I am using:

where C:\inc\script.php is the file I need to run. This seems simple enough, and it does work the first time I execute the script (by accessing http://localhost/inc/script.php). After that however, I get an error and cannot get the script to execute successfully again until I delete and recreate the symbolic link (even shutting down Apache or restarting Windows has no effect).

Note that everything else is running normally, the symbolic link does work, and Apache does have permission to access C:\inc and also has FollowSymLinks enabled. Here is the error I am getting:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'C:/inc/script.php' (include_path='.;C:\php5\pear') in Unknown on line 0

Does anyone know what the deal is with the Unknown on line 0, and why would it execute exactly one time before giving this error?

-
all whats needed is Capital D and must be running cmd line as admin – user85684 Jun 13 '11 at 21:36

Why not just use Alias in Apache to achieve what you want rather than using NTFS SymLinks?

Alias /inc "C:/inc"