PHP shell_exec, permission denied for executing -rwxrwxrwx shell script

前端 未结 1 523
梦如初夏
梦如初夏 2021-01-15 14:04

I am currently over ssh on a remote CentOS 5.6 system which runs an Apache webserver. I need to use the poppler pdftohtml binary which, unfortunately, is not cu

相关标签:
1条回答
  • 2021-01-15 14:35

    Just because a file is executable for a user does not mean that user is actually able to execute the file. The user needs to also be able to 'get to' the file: The user needs execution permission for all 'parent directories', in your case for /users, myfolder, poppler-0.18.2 and utils.

    Assuming /users is the same basic thing as /home, everybody should have +x on that. From there, you can set it: simply do chmod o+x /users/myfolder /users/myfolder/poppler-0.18.2 /users/myfolder/poppler-0.18.2/utils

    (Note: This will make it possible for everybody to execute this binary, not just Apache.)

    If the apache user and you share a group, it would be better to use chown the poppler directory and everything in to be owned by that group, and set g+x instead of o+x.

    0 讨论(0)
提交回复
热议问题