Hi guys,
I am sure this problem is very easy for you people to resolve.
basically i want to run an external program in PHP (via command line) and to do that i am using shel_exec command.
I understand that the shel_exec takes "String" parameter and my problem is exactly here:
I am trying to pass a variable (containing a file name) to the shel_exec, however it is not working. If I just type the content of my variable (i.e. file name) it will work but not when I am using the variable.
here is the part of the code i am working in:
$output = shell_exec('java -jar C:/htmltolatex-1.0.1/htmltolatex.jar -config C:/htmltolatex-1.0.1/config.xml -output C:/ConversionTest/output.tex -input' .$pAddress);
$pAddress is my variable which I want to pass.
I have tried to print out "$pAddress" to make sure it is actually containing what I think it contains and it was fine; it DOES contain the file name, However when it is used inside the shel_exec it is not working.
Please Please Help, I have spend 3 hours on this and could not resolve it 😕