1

I'm trying to use PEL to make a web page that will read/edit Exif data. I'm not sure I'm including the PEL files correctly. Here's what I've done:

1. Uploaded all the PEL .php files into a directory called: /home/mydomain/private/PEL
2. edited the global php.ini file: /home/mydomain/php.ini by adding this:

;Include PEL - PHP Exif Library
include_path = "/home/mydomain/private/PEL"


3. Then I created a file called gallery.php that includes this:

$jpeg = new PelJpeg($file);
echo $jpeg;

The gallery file worked fine until I added the above 2 lines of code. But after I added reference to PelJpeg, it gives me this error:

Fatal error: Class 'PelJpeg' not found in /home/mydomain/www/www/photogallery/gallery.php on line 28

Line 28 is where the PelJpeg reference is. What am I doing wrong?

Drakes
  • 23,254
  • 3
  • 51
  • 94
OutThere
  • 467
  • 2
  • 8
  • 19

2 Answers2

1

I think this manual is out of date.

You should try

Structure

pel/autoload.php
pel/src/Pel.php
pel/src/PelConvert.php
pel/src/:(ALL src files)

In gallery.php

require_once "pel/autoload.php";
use lsolesen\pel\PelJpeg;
use lsolesen\pel\PelTag;
use lsolesen\pel\PelIfd;
pupupu
  • 21
  • 2
0

It's recommended to install PEL as a PECL extension via the following commands:

pear channel-discover pearhub.org
pear install pearhub/pel

However, if you have downloaded the source from github, then that will also work. One thing to note is that the PEL docs say to just set the include path to the place you downloaded the files to - but this won't work - the PHP files are in a src subdirectory.

Try putting this at the top of your gallery.php:

set_include_path('/home/mydomain/private/PEL/src');

I prefer to use set_include_path rather than adjusting the PHP ini setting.

madebydavid
  • 6,457
  • 2
  • 21
  • 29