Apache, PHP, and Tar (permissions problem?)
I'm pretty confused here. The following PHP code works via command line when I call it as root, however it does not work when called via PHP:
PHP Code:
<?php
exec("tar -cvf filename.tar.gz directory-to-tar/", $debug);
print_r($debug);
?>
sh: line 1: /bin/tar: Permission denied
I can't figure out why it says permission denied though - the attributes are set so that everyone can execute it:
-rwxr-xr-x+ 1 root root 149676 Feb 28 2004 /bin/tar*
I'm not sure what that + at the end is, but I think that's what's causing it not to work. The + is also added to the end of ping and traceroute. This is a CPanel server, and traceroutes are enabled - so I'm not sure where these +s are coming from, why they're there, or how to remove them.
- Matt