Hi all,
not sure if this is the correct place to post this question but here goes.
I am trying (and failing) to execute a command line program with the php function shell_exec.
Some commands work, dir for example is fine and shows me all the files in that directory.
I have image magic installed on the server which, when run from a command prompt via remote desktop connection, works fine.
But when I run the same command using the shell_exec function it doesn't work. I don't get an error or anything, the output file just isn't created.
I really want to get ffmpeg running, but when i try to use this progam via shell_exec I get a "502 - Bad Gateway" error.
Again, the same command using remote desktop connection it works fine.
The server is running Windows 2003 server, and I dont know if its a PHP problem (maybe a config problem) or a server problem (permissions perhaps?).
If anyone has any ideas I'd appreciate a reply.
Thanks
Zico
shell_exec problem
Moderator: General Moderators
-
ZicoBarton
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 12, 2007 11:30 am
Thanks for the quick reply.
I have tried setting the permissions on the executable (ffmpeg.exe) but I wasn't sure which user to give access to it.
As a test I have the user group 'Everyone' full access, but this hasn't worked.
Do you know who I should give access to, what level of access I should give them and what do I give them access too (ie the executable only, or the entire directory)?
Thanks
Zico
I have tried setting the permissions on the executable (ffmpeg.exe) but I wasn't sure which user to give access to it.
As a test I have the user group 'Everyone' full access, but this hasn't worked.
Do you know who I should give access to, what level of access I should give them and what do I give them access too (ie the executable only, or the entire directory)?
Thanks
Zico
-
ZicoBarton
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 12, 2007 11:30 am
-
ZicoBarton
- Forum Newbie
- Posts: 4
- Joined: Sun Aug 12, 2007 11:30 am
There havnt been any replies for a couple of days now so I am assuming no one has an easy answer?
Does anyone know what permissions I should set to run a shell_exec command?
e.g. Full Access, Read Only etc.
Also what user do I allow access?
Should I set the permissions on the exe I am trying to run, the entire directory or cmd.exe?
Thanks again for your help.
Does anyone know what permissions I should set to run a shell_exec command?
e.g. Full Access, Read Only etc.
Also what user do I allow access?
Should I set the permissions on the exe I am trying to run, the entire directory or cmd.exe?
Thanks again for your help.
- stereofrog
- Forum Contributor
- Posts: 386
- Joined: Mon Dec 04, 2006 6:10 am
Try running your command with 2>&1, perhaps you get a meaningful error message.
As for permissions, IIRC on windows you have to go to Start - Settings - Services (or similar), double-click Apache service and select your own account on the "login" tab (assuming this is your local test server and security is not a concern).
As for permissions, IIRC on windows you have to go to Start - Settings - Services (or similar), double-click Apache service and select your own account on the "login" tab (assuming this is your local test server and security is not a concern).