exec not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
atrichtch
Forum Newbie
Posts: 18
Joined: Sun Apr 03, 2011 4:57 pm

exec not working

Post by atrichtch »

I know this is a common problem, yet I'm one more beginner experiencing it.
I tried to use open source software to convert Word and PDF uploads to HTML. When invoked from a shell, the program works fine. When I try to invoke it from Firefox, I get it waiting on the command forever. My PHP safe mode is off, and the full control is granted to the System user on the executable. I also set my firewall exception, to no result. My code is below; those three lines shouldn't be an issue.

Code: Select all

<?php
      $command='convertdoc /S resume_sd.doc /T resume_new.html /M2 /C2 /F9';
      echo $command;
      echo exec($command);
?>
Is it just another open source software reliability issue, or should I change something in the code?
Thanks.
klandaika
Forum Newbie
Posts: 19
Joined: Wed Mar 30, 2011 3:25 pm
Location: New York

Re: exec not working

Post by klandaika »

you should specify full path to the program and the documents. Using relative pathts often leads to complications.

If you get any errors in your error log, posting them would be useful. If not make sure you are loggin all errors including E_NOTICE
atrichtch
Forum Newbie
Posts: 18
Joined: Sun Apr 03, 2011 4:57 pm

Re: exec not working

Post by atrichtch »

Just in case anybody else has this problem:
If you are using Apache Server, go to your C:\Windows\system32\services.msc file and right-click on Apache. In the properties menu, check the "Allow interaction with desktop" checkbox. This should resolve it.
Post Reply