I’m running PHP7.1.4 and getting an error when using the
exif_read_data function as it doesn’t exist.
Is there any way to enable or add this function?
It’s required for this plugin: https://wordpress.org/plugins/ios-images-fixer/
I’m using PHP 7.1.7 on Local by Flywheel. I created this site by simply using the defaults given by the app, and this version includes ImageMagick already configured for use with PHP, saving you a fair amount of work. I’d strongly suggest moving to the newer version of their server environment.
Anyway, if you do, it might help you to know the steps I went through to get the iOS Images Fixer plugin working:
Right-click your site, select Open Site SSH to get a root shell prompt where you can work. Change to root’s home directory, /root so you don’t dump files randomly into the top level of the filesystem.
Update the list of available software packages and install build tools and wget.
apt-get update && apt-get install -y build-essential autoconf pkg-config wget
Download the source code for your version of PHP - mine was 7.1.7. Extract the files from the archive and change to the directory where the exif plugin source code lives.
tar zxf php-7.1.7.tar.gz
phpize to set things up for compiling the source. Then configure the build, compile the exif shared library and install it where it belongs.
./configure --enable-exif=shared --with-php-config=/opt/php/7.1.7/bin/php-config
Edit the php.ini file
Look for the line that says
[exif] on it. Insert this line after the
extension = /opt/php/7.1.7/lib/php/extensions/no-debug-non-zts-20160303/exif.so
Use CTRL-W to save the file. Just hit enter when it gives you the opportunity to change the name. CTRL-X will quite the
nano editor and take you back to a prompt.
Hit the “Stop Site” button in the Local by Flywheel window. When the site shuts down completely, start it back up. Your iOS Images Fixer plugin ought to work now.
Hope this is helpful to you,
Hi Brandon - thanks for the detailed reply!
Because I’m using a custom environment it doesn’t give me the option to switch to 7.1.7 unfortunately. I see that there is a new version imminent with PHP7.2 (which is what I’m running in production), so I’ll wait for that and see if it has ImageMagick included. If not, I’ll follow your instructions.
To switch to the Preferred environment you can export the current site using Custom from Local and then re-import. When re-importing, simply select “Preferred” on the Environment page and you should be good to go.
PHP 7.2.0 in Custom doesn’t come with ImageMagick at this time.
Ah that’s handy to know, I wasn’t aware of that.
Just out of interest, is there a reason ImageMagick is not included?
Right now it’s a limitation of the base image that the Custom environment uses.
We’ll absolutely be adding support for it in Custom in the future.
Thank you very much. It worked!
Just confirming that this worked for me as well on the Preferred Local Environment (PHP 7.1.7).
I was getting a warning from the Ultimate Member plugin regarding enabling Exif on the server and that has now disappeared.