I've got a bit of a complicated setup going on here, and, well, it's not quite working. I have a Python script that parses a directory for certain "attributes" in the directory name (how the script works isn't necessarily important - it runs just fine). This script is called via the system()
command in PHP (running on an Apache webserver on CentOS 6.2). My issue lies in the fact that the directory I'm attempting to search with the Python script is an SSHFS share. I can run my script just fine from a terminal (as myself), but when I run it in PHP I get the following error as output:
Traceback (most recent call last): File "../rpm-viewer/getRunsList.py", line 20, in os.chdir(rpmdir) # change the working directory OSError: [Errno 13] Permission denied: '/mnt/rpm'
Script Exit Status: 1
(The "Script Exit Status" code comes courtesy of the return_var parameter in PHP's system()
function.)
I also tried creating a symbolic link to my mountpoint and accessing it via Apache (just using the web browser), but again I get a 403 error.
My SSHFS share was established with the option allow_other
enabled, however, if it matters, the share created is/must be read-only.
Is there any way I can possibly access my SSHFS share via Apache/my PHP-called-Python script?
Well, the error tells you exactly what's wrong:
Change the permissions on that directory. I believe that Apache runs as
apache
on CentOS, which will most likely be the other permissions (e.g.,chmod -R o+rX /mnt/rpm
).You also need to have execute permission on the entire path from the root in order to reach the leaf level.