So, I am getting the following error whilst trying to upload images on my Heroku site (PHP).
Fatal error: Call to undefined function: imagejpeg()
It refers to the following line in my AmazonS3Handler.php file.
//build the jpeg
imagejpeg($destinationImage);
Any ideas on how I could fix this?
I had GD
lib installed and got the same error. The problem was in compiling without jpeg
support. Here what you should do to make things work.
libjpeg
apt-get install libjpeg62-turbo-dev
PHP
with jpeg
support ./configure \
--with-gd
--with-jpeg-dir=/usr/lib64
# other options
PHP
make clean
make
make install
First stop the local server XAMPP or WAMP
In XAMPP
Example path: C:\xampp\php\php.in
In wamp
Example path: C:\wamp64\bin\php\php7.0.10
If you can't find the extension=gd, add it yourself
Find "extension=" in the php.ini file and place it after any extension.
Then restart your local server, and everything should be fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.