ExifTool Forum

ExifTool => Developers => Topic started by: knipser on February 06, 2019, 09:55:58 PM

Title: Shared cPanel hosting / PHP - what I do wrong?
Post by: knipser on February 06, 2019, 09:55:58 PM
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:

<?phpeval('$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!
Title: Re: Shared cPanel hosting / PHP - what I do wrong?
Post by: Hayo Baan on February 09, 2019, 06:57:54 AM
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).
Title: Re: Shared cPanel hosting / PHP - what I do wrong?
Post by: Phil Harvey on February 09, 2019, 08:28:22 AM
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
Title: Re: Shared cPanel hosting / PHP - what I do wrong?
Post by: knipser on February 22, 2019, 11:42:42 PM
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.