Page 1 of 1

How to run linux commands in php

Posted: Mon Nov 23, 2009 11:46 pm
by ramakrishnankt
Hi,
I installed poppler utils for converting pdftohtml, it works well in terminal by the command
pdftohtml -c Desktop/resume.pdf
But in a php program
echo exec('pdftohtml -c Desktop/resume.pdf');
this is not works why
Thanks
Ramakrishnan

Re: How to run linux commands in php

Posted: Mon Nov 23, 2009 11:51 pm
by FrancineSantos
Hmmm anyone can help? hehe

Re: How to run linux commands in php

Posted: Tue Nov 24, 2009 11:46 am
by AbraCadaver
Several possibilities (maybe all):

1. pdftohtml is not in the path so you need the full path (/usr/bin/pdftohtml)
2. pdftohtml can't find Desktop/resume.pdf so you need the full path (/home/user/Desktop/resume.pdf)
3. Does the PHP user have permissions to read the PDF and write the HTML to the location?

-Shawn