Forum How do I...?

Prince from another script doesn't seem to work.

olivier_morre
Hi,


I have a php script (say script A) that uses Prince to make a PDF from an HTML file. I can call the script in console mode or from a browser and it works fine.
The thing is, this script is supposed to be called from another php script (say script B ).

So script B is on a web server and is called from a browser. During its execution, it calls script A, like this:
exec("php /path/to/script/index.php -c paramC -a paramA -i paramI");
In this case, Prince doesn't log anything and the result I get is 127. Nothing else. The array in which I catch the output is empty.

I'd like to know what the error code 127 means? And if you have any advice to help me fix that issue, it would be great !
mikeday
Is the second script specifying the correct full path to the Prince executable?
olivier_morre
Ahhh. The path was only correct on my computer, not on the dev server. Sorry, my bad.

That said - before I made the correction on the path - even though the pdf couldn't be properly created, an empty pdf file (0 byte) still appeared. Not that it is critical, but I wonder why/how.
Any clues?

Anyways, thanks for pointing my mistake out,
Have a good day !
mikeday
Slightly odd, I would not expect any PDF to appear unless Prince has actually been invoked.