![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| [SOLVED] php's shell_exec not executing program? Hi, I'm designing a website in php that requires shell_exec(). I need shell_exec() to run a program on my server called "antiword", but I get no output when using shell_exec() but I do get output if I run the same command in my shell. (If I run shell_exec(ls) I get output.) $cmd = "./antiword -a a4 a.doc > a.pdf";//If I run this manually it works fine shell_exec($cmd); I'm in the correct directory and a.doc is present. I get no error messages. |
| |
| |||
| Ensure the web server user (e.g. "apache") can read and execute this program too. If not, you may need change ownership and permissions on your shell prog file. Also, for better control, try executing shell commands using proc_open(). this will give you access to exit code and stderr stream, therefore easier to know what went wrong. |
![]() |
| Thread Tools | |
| Display Modes | |
| |