FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to run a batch file using PHP?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to run a batch file using PHP? [message #179329 is a reply to message #179326] Fri, 05 October 2012 08:00 Go to previous messageGo to previous message
Shake is currently offline  Shake
Messages: 40
Registered: May 2012
Karma:
Member
El 05/10/2012 9:55, Fastian escribió:
> Yes you are right! But whats the solution?
> I want to know that when the bat file is being run successfully from the command prompt then why not from Php script? On the other hand if I will write some command like for example 'convert picture.jpg newPicture.png' in my batch file and run it from my script using exec(), it works and I get the desired result. (perhaps as 'convert' is from a Windows built-in program)
> I have googled this issue and found many people discussed the same issue. People have suggested different solutions that worked for them but still I am struggling. Any good idea will highly be appreciated. Thanks!
>

Looks like path problems.


>>> latex first-program.tex
1 2
>>> dvipng first-program.dvi
1 2


1.- Command have no absolute path.
2.- Alsto argument files have no absolute path.

Perhaps from command line you have de argument files in the directory
where you execute the batch? PHP probably have not this path.

The error I think is clear:

'latex' is not recognized as an internal or external command, operable
program or batch file.

If you search "not recognized as an internal or external command" you
will find that 'cmd' is who writes the errors. So. this text is the
result of the php exec command.

path.... put the correct paths and everything will work.

Regards
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: JOB - Sr. PHP Developer - Fort Lauderdale, FL - Relo/Sponsor OK
Next Topic: Regular Expression Help
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 16:12:16 GMT 2024

Total time taken to generate the page: 0.05066 seconds