How to execute commands on the command line with php? For example, I use the command below on the command line to convert a docx file to a pdf file:
pdfcreator.exe /PF"D:\Documents\sample.docx
Now, using the PHP code, I want to be able to execute the same command, but nothing happens:
<?php
shell_exec('pdfcreator.exe /PF"D:\Documents\sample.docx"');
?>
Is this possible in PHP? If so, how to do it?
source
share