Shared cPanel hosting / PHP - what I do wrong?

Started by knipser, February 06, 2019, 09:55:58 PM

Previous topic - Next topic

knipser

So far I didn't manage to get any data.

I am on cPanel shared hosting, the cPanel has a one-click perl perl module (Image::ExifTool / 11.11), which I installed.

However, the simple PHP example doesn't return anything:

<?php
eval('$array=' . `exiftool -php -q test.jpg`);
print_r($array);
?>


test.jpg exists in the same directory and has full exif data.

I tried various modifications, added also #!/usr/bin/exiftool (or /perl /perlml)

The error I mostly get is:

syntax error, unexpected end of file in /home/***/ : eval()'d code on line 1

The line has no obvious syntax error to me. Seems I do something fundamentally wrong here.

Your advice is highly appreciated!

Hayo Baan

Me php knowledge is a bit rusty but I think you simply need to write $array = `exiftool -php -q Test.jpg` (so without the eval).
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

That PHP code is straight from the example in the documentation.  It works for me on Mac.  Make sure there are no funny characters if you copied and pasted the example (ie. try re-typing it).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

knipser

Just a note: I rest my case for now. It might be related to how the shared host is run and my need a deeper look at from the server people.