Re: How to run a batch file using PHP? [message #179325 is a reply to message #179324] |
Fri, 05 October 2012 07:26 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma:
|
Senior Member |
|
|
El 05/10/2012 7:21, Fastian escribió/wrote:
> To be precise, my batch file named show-preview.bat consist of only two commands:
> latex first-program.tex
> dvipng first-program.dvi
>
> When I run show-preview.bat from cmd then they run successfully and I obtain the desired result.
> But when I use exec('show-preview.bat'); I am finding the following error in apache_error_log:
> 'latex' is not recognized as an internal or external command, operable program or batch file.
> 'dvipng' is not recognized as an internal or external command, operable program or batch file.
>
> Whereas both of these commands are working fine from the command prompt........ what you say?
>
> I also tried to pass the absolute path of the bat file within exec() but it also do not work. Any idea?
>
Let's think about it. If logs complain about "latex" and "dvipng",
doesn't that suggest that the batch file is actually being executed?
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|