Jump to content

[SOLVED] PHP and NFS


fats

Recommended Posts

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.