Docker PHP7. x WordPress prompts that the server does not support the image rotation function
problem
Your server does not support image rotation
call_user_func_array() expects parameter 1 to be a valid callback, function ‘imagejpeg’ not found or invalid function name in class-wp-image-editor.php on line 420 .
solve the problem
Check GD library support
phpinfo();
Install the jpeg library and other libraries
#Freetype library, jpeg library and png library are installed here. Select as required $ apk add --update --no-cache \ freetype-dev \ libjpeg-turbo-dev \ libpng-dev
Add GD library compilation options
$ docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
Recompile and install GD library
$ docker-php-ext-install gd
(Optional) Install imagick support
$ apk add --update --no-cache autoconf g++ imagemagick-dev libtool make pcre-dev $ pecl install imagick $ docker-php-ext-enable imagick $ apk del autoconf g++ libtool make pcre-dev
Restart the PHP container
Docker restart f12da14123 (container id obtained by using docker ps)
References
-
[Header] [Docker, Inc.】Docker Docker Logo -
[Script] [Github] m2sh PHP7>Alpine>DockerFile