Let a user to execute a command from php script

4 posts / 0 new
Last post
#1 Fri, 05/31/2013 - 15:40
marciano

Let a user to execute a command from php script

There is an Centos Apache user called Usename. If he logs in ssh he is able to execute the ImageMacgick command
$ convert tmp/file1.php ... /path-to/file2.jpg
But he does not get results running the same command from a php script.
All his files/dirs belong to Username.
What to do?
Thank you

PD:
Also to say that I use the same command from my php scripts but as user apache (old configuration). No problems here.

Sat, 06/01/2013 - 08:41
andreychek

Howdy,

Do you get an error of some sort when trying to run the "convert" command from your PHP script?

If so, can you paste in the error message you receive?

-Eric

Sat, 06/01/2013 - 17:53
marciano

Hello Eric, thanks for your help.

Sorry to bother you.
I finally found the issue. A directory name like 4X3 was named as 4x3 in the script.
The problem was that many times I did not get any log errors and others "file not found". I assumed that it was the source what was not found because the target is what I am creating and it was 'obvious' that it didn't exist.
It was a path error on the target image.

Sun, 06/02/2013 - 21:58
andreychek

I'm glad you figured out the issue, thanks for letting us know how you fixed it!

-Eric

Topic locked