fats Posted May 13, 2009 Share Posted May 13, 2009 Hey People, I'm trying to set up my Apache server in such a way that it uses an NFS mount as the document root. However, I get the following error: [Wed May 13 21:42:30 2009] [error] [client 127.0.0.1] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 [Wed May 13 21:42:30 2009] [error] [client 127.0.0.1] PHP Fatal error: Unknown: Failed opening required '/shrdev/ac/staging/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0 I've tried the following on the web server: chmod -R 777 /shrdev chown -R apache /shrdev Both do not make any difference. Copying the entire source tree to a local directory and making that the document root works just fine, even no need for chmod. I'm using Fedora Core 10. Quote Link to comment https://forums.phpfreaks.com/topic/158013-solved-php-and-nfs/ Share on other sites More sharing options...
corbin Posted May 13, 2009 Share Posted May 13, 2009 The security settings on the NFS share probably don't allow the Apache account (usually 'nobody') to access it. Quote Link to comment https://forums.phpfreaks.com/topic/158013-solved-php-and-nfs/#findComment-833545 Share on other sites More sharing options...
fats Posted May 13, 2009 Author Share Posted May 13, 2009 Thanks for your reply. Although I think it's a good suggestion, I just tried a chown -R nobody on the tree (mind that nobody has the same uid on both machines), but it doesn't help. Also tried to add anonuid=500 (I reset the tree back to its original owner with uid 500) to the exports file and restarted nfs, did not help either. To be specific: /shrdev iptohemachinehere(rw,anonuid=500,insecure) Quote Link to comment https://forums.phpfreaks.com/topic/158013-solved-php-and-nfs/#findComment-833608 Share on other sites More sharing options...
fats Posted May 15, 2009 Author Share Posted May 15, 2009 Also, what I forgot to mention but might be relevant: The NFS share is on the host machine of the Virtual Box guest machine with the mount point. Not sure how this could make a difference as everything else seems to be functioning normally. But who knows, maybe it does. Quote Link to comment https://forums.phpfreaks.com/topic/158013-solved-php-and-nfs/#findComment-835020 Share on other sites More sharing options...
vvmht Posted May 19, 2009 Share Posted May 19, 2009 Try adding this to /etc/exports /mnt/exporting_this *(sync,no_root_squash,rw) Then run 'exportfs -av', followed by 'exportfs' to confirm it shows up. Then try it, let us know. Quote Link to comment https://forums.phpfreaks.com/topic/158013-solved-php-and-nfs/#findComment-836911 Share on other sites More sharing options...
fats Posted June 2, 2009 Author Share Posted June 2, 2009 Try adding this to /etc/exports /mnt/exporting_this *(sync,no_root_squash,rw) Then run 'exportfs -av', followed by 'exportfs' to confirm it shows up. Then try it, let us know. That seems to have done the trick. Thanks! :-) Not sure why though, was it the sync option? If so, I fail to understand how it could have solved the problem other than that the error is bogus and in reality it just couldn't find the file? Quote Link to comment https://forums.phpfreaks.com/topic/158013-solved-php-and-nfs/#findComment-848170 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.