[solved] problem executing external script from php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

[solved] problem executing external script from php

Post by andre_c »

i'm trying to execute a program through php using backticks (or shell_exec) and it's not working.
it just returns null and the program doesn't run, no errors.

this is the code:

Code: Select all

<?php
echo shell_exec('/opt/fop/fop.sh simple.fo simple.pdf');
?>
and i get one line in the error_log that says

Code: Select all

sh: /opt/fop/fop.sh: Permission denied
the 'fop.sh' script is 755 and the directory is owned by apache (which is what the webserver runs as)
the server is fedora 4 and apache was installed using yum
SELinux is disabled

any ideas?
Last edited by andre_c on Thu Sep 22, 2005 1:20 am, edited 2 times in total.
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post by andre_c »

never mind...
SELinux was running and that was the problem... my bad
i just turned it off for the httpd daemon
Post Reply