Thread: php and exec
View Single Post
  #1  
Old 10-01-2012, 11:41 AM
mrxUx mrxUx is offline
Member
 
Join Date: Jul 2012
Posts: 23
Default php and exec

a quick question, maybe already answered but I couldn't find anything yet, so please excuse me

I'm using cPanel + LiteSpeed, and for example, I have the following code on a php script:

PHP Code:
<?php
echo ":: ".`which convert`;
?>
Which should come up with the full path of convert (part of imagemagick), however is returning empty, now if I do the same from the user's shell by executing the php: "sudo -u user php -f file.php" y do get the right path.

Another funny thing is, if instead I use `which --help` it works in both and actually "convert" does work without problems, so I'm kinda confused here
Reply With Quote