Users Pricing

forum

Home Forums exec doesn't execute command if path contains whitespaces – MindStick

exec doesn't execute command if path contains whitespaces

Manoj Bhatt 2880 10 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

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md