forum

Home / DeveloperSection / Forums / exec doesn't execute command if path contains whitespaces

exec doesn't execute command if path contains whitespaces

Manoj Bhatt246810-May-2013
Hi Expert!

When I do something like

exec("c:\\Program Files (x86)\\wkhtmltopdf\\wkhtmltopdf.exe --footer-center as  http://bbc.co.uk c:\\test2.pdf",$output);
nothing happens. File exists and the following line returns 1.

echo file_exists("c:\\Program Files (x86)\\wkhtmltopdf\\wkhtmltopdf.exe");
If I change it

 exec("d:\\wkhtmltopdf\\wkhtmltopdf.exe --footer-center as  http://bbc.co.uk c:\\test2.pdf",$output);
works fine. Can that be fixed?

Thanks in advance! 

Updated on 10-May-2013

Can you answer this question?


Answer

1 Answers

Liked By