Как добавить поддержку WebP в MAMP Pro

Рубрики PHP
  1. Для начала откройте http://localhost/MAMP/index.php?language=English&page=phpinfo  и скопируйте команды конфигурации “ Configure Command ” из phpinfo. Это пример конфигурации сборки php.

Скопируйте значение в текстовый редактор, в дальнейшем нам нужно будет добавить и изменить некоторые значения конфигурации.

Второй этап, запустите команду установки недостающих библиотек.

1brew install webp libpq imap-uw

Третий этап, скачайте и разархивируйте исходный код php

cd /Applications/MAMP/bin/php

wget http://cn2.php.net/get/php-7.2.19.tar.bz2/from/this/mirror-O php-7.2.19.tar.bz2

tar xvf php-7.2.19.tar.bz2

Четвертый этап, измените with-imap with-imap-ssl with-pdo-pgsql опции, и добавьте директории. В цонец добавить: –with-webp-dir=/usr/local/lib . После этого вы получите команду конфигурации:

‘./configure’ ‘—with-gd’ ‘—with-jpeg-dir=/Applications/MAMP/Library’ ‘—with-png-dir=/Applications/MAMP/Library’ ‘—with-zlib’ ‘—with-zlib-dir=/Applications/MAMP/Library’ ‘—with-freetype-dir=/Applications/MAMP/Library’ ‘—prefix=/Applications/MAMP/bin/php/php7.3.1’ ‘—exec-prefix=/Applications/MAMP/bin/php/php7.3.1’ ‘—sysconfdir=/Applications/MAMP/bin/php/php7.3.1/conf’ ‘—with-config-file-path=/Applications/MAMP/bin/php/php7.3.1/conf’ ‘—enable-ftp’ ‘—with-bz2=/Applications/MAMP/Library’ ‘—with-mysqli=mysqlnd’ ‘—enable-mbstring=all’ ‘—with-curl=/Applications/MAMP/Library’ ‘—enable-sockets’ ‘—enable-bcmath’ ‘—with-imap=shared,/usr/local/Cellar/imap-uw/2007f’ ‘—with-imap-ssl=/usr/local/lib’ ‘—enable-soap’ ‘—with-kerberos’ ‘—enable-calendar’ ‘—with-pgsql=shared,/usr/local/lib/pg’ ‘—enable-exif’ ‘—with-libxml-dir=/Applications/MAMP/Library’ ‘—with-gettext=shared,/Applications/MAMP/Library’ ‘—with-xsl=/Applications/MAMP/Library’ ‘—with-pdo-mysql=mysqlnd’ ‘—with-pdo-pgsql=shared,/usr/local/Cellar/libpq/11.3’ ‘—with-openssl=/Applications/MAMP/Library’ ‘—enable-zip’ ‘—with-pcre-dir=/Applications/MAMP/Library’ ‘—with-libzip=/Applications/MAMP/Library’ ‘—with-iconv=/Applications/MAMP/Library’ ‘—enable-opcache’ ‘—enable-intl’ ‘—with-icu-dir=/Applications/MAMP/Library’ ‘—enable-wddx’ ‘—with-libexpat-dir=/Applications/MAMP/Library’ ‘—with-readline=/Applications/MAMP/Library’ ‘—with-mhash’ ‘—with-iconv-dir=/Applications/MAMP/Library’ ‘—with-sodium=/Applications/MAMP/Library’ ‘—with-password-argon2=/Applications/MAMP/Library’ ‘—enable-cgi’ ‘—disable-phpdbg’ ‘YACC=/Applications/MAMP/Library/bin/bison’ ‘—with-webp-dir=/usr/local’

Запустите команду конфигурации, а затем скомпилируйте пакет

123make -j 8make installcp libs/libphp7.so ../php7.0.15/modules/libphp7.so

Финал: Restart MAMP and go to phpinfo page, you will get WebP Support enabled in the phpinfo page.