SoftTimur SoftTimur - 1 month ago 7
PHP Question

Cannot redirect the output of an OCaml bytecode to a file in Windows server

I have written a basic OCaml file

test.ml
, and compiled that my Windows server. It works in a command prompt:

enter image description here

However, if I run it in a php, Only the last line (i.e.,
testbat.bat
) succeeded to write to
result.txt
, whereas
test.exe
always failed:

exec('C:\\PRODSERVER\\OCamlTest\\test.exe >> C:/inetpub/testaddbbacom/test/result.txt');
exec('C:/PRODSERVER/OCamlTest/test.exe >> C:/inetpub/testaddbbacom/test/result.txt');
exec('C:\PRODSERVER\OCamlTest\test.exe >> C:/inetpub/testaddbbacom/test/result.txt');
exec("C:\\PRODSERVER\\OCamlTest\\test.exe >> C:/inetpub/testaddbbacom/test/result.txt");
exec('C:/PRODSERVER/OCamlTest/testbat.bat >> C:/inetpub/testaddbbacom/test/result.txt');


enter image description here

Does anyone know how to solve this?

Answer

I have found the solution: add -custom as option of ocamlc while compiling...

Comments