praveenjayapal
praveenjayapal

Reputation: 38529

How to execute a command line from php

I need to convert the html file into PDF, I am having command line for this process

C:\Program Files\Software602\Print2PDF/print2pdf.exe /iniconvert C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/BPO/Praveen/OCT_08/html_files/file.ini

This is the command line to convert. But i dont know how to run this in php.

Please help me

Upvotes: 0

Views: 322

Answers (2)

knittl
knittl

Reputation: 265221

you can use backticks: `, you can use the exec function, the shell_exec function or the system function.

be sure to correctly sanitize your params (escapeshellargs, escapeshellcmd). all of the above will not work in php’s safe mode though

Upvotes: 2

Vincent Robert
Vincent Robert

Reputation: 36120

You can use the system function but you will require a PHP version which allows it: impossible in safe mode.

Upvotes: 1

Related Questions