Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running Apache/PHP on MacOS X Lion 10.7.4. My directory structure is set up as so:

/Users/achan/Sites/
lrwxrwx---   1 achan  staff    23B Apr 27 16:21 epwbst@ -> /Users/achan/dev/epwbst`

where epwbst/ is a symlink inside of ~/Sites.

If I put test.php inside of the Sites/ directory, Apache serves up the file correctly; it spews out phpinfo() like it is supposed to. If I put the same file under the symlink, I get this error:

[Mon May 28 14:47:13 2012] [error] [client ::1] PHP Warning:  Unknown: failed to open stream: No such file or directory in Unknown on line 0
[Mon May 28 14:47:13 2012] [error] [client ::1] PHP Fatal error:  Unknown: Failed opening required '/Users/achan/Sites/epwbst/test.php' (include_path='.:/usr/lib/php/pear') in Unknown on line 0

Just to be sure that Apache was working, I created a test html file under ~/Sites/epwbst/ and Apache served it up as expected.

Why can't Apache run php under my symlinked directory?

I've pasted my php config here: http://pastebin.com/gg27JyVZ

share|improve this question
    
Could it be a file permissions issue? –  Justin Pearce May 28 '12 at 15:22
    
Well, this only occurs with PHP. HTML files are served up fine. Plus, the permissions on the file are world readable and the file contains the simplest of php: <?php phpinfo() If it's a file permissions issue, I don't know what to change the file permissions to. We've already established that symlinks 'work' because html can be served from the symlinked folder. –  Avery Chan May 29 '12 at 4:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.