Forum Moderators: coopster

Message Too Old, No Replies

Can't get exec() to work in PHP

         

groovyhippo

2:30 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



I am calling the exec() function in my PHP script but it doesn't seem to run the command.

I'm actually attempting to run the ImageMagick convert command but even if I try it with just the date command, the return value is null.

I am running php in safe_mode (and won't be switching that off!) - is that something to do with it?

Lisa

6:01 pm on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I take you have a dedicated server? I have seen web hosts that don't allow exec() because of security. Just making sure that is not your problem.

groovyhippo

6:40 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



I do have a dedicated server, so that's not the problem.

And when I SSH on to the box, I can paste the exact same command I'm trying to run onto the shell prompt and it runs fine, so I know the command is OK.

I'm sure it must be a permissions type problem, but don't know exactly what.

groovyhippo

8:53 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



I've solved this now.

As I had safe_mode set to on, I had to specify the folder that contains the ImageMagick commands in the safe_mode_exec_dir variable.

All works fine now.