For years I had been building PHP and thought I was including GD. Well, I was using a flag that I thought worked, and got no errors. but GD was not actually being loaded in php…from my understanding. The following is required:
sudo apt install libwebp-dev
and use the following:
./buildconf --force LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 ./configure \ --libdir=/lib64 \ --with-apxs2=/usr/local/apache2/bin/apxs \ --prefix=/usr/local/php8 \ --with-config-file-path=/usr/local/lib \ --enable-mbstring \ --enable-debug \ --with-zip \ --enable-bcmath \ --enable-pcntl \ --enable-ftp \ --enable-exif \ --enable-calendar \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-debug \ --enable-intl \ --enable-soap \ --enable-intl \ --with-curl=/usr/include/curl \ --with-iconv \ --with-gmp \ --with-pspell \ --enable-gd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=/usr/share/mysqlnd \ --with-mysql-sock \ --with-jpeg \ --with-webp \ --with-zlib-dir=/usr \ --with-xpm \ --with-freetype \ --enable-gd-jis-conv \ --with-openssl=/usr/local/ssl \ --with-pdo-mysql=/usr \ --with-gettext=/usr \ --with-zlib=/usr \ --with-bz2=/usr
Add ImageMagick
sudo apt update && sudo apt install libmagickwand-dev imagemagick cd /usr/local/src sudo git clone https://github.com/Imagick/imagick.git cd imagick sudo /usr/local/php8/bin/phpize sudo ./configure --with-php-config=/usr/local/php8/bin/php-config sudo make sudo make install
And, the top of /usr/local/lib/php.ini now contains this:
[PHP] zend_extension=/opt/php-8.0.14/modules/opcache.so extension=imagick.so
Ubuntu Issues
PCRE not found…
wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz tar xzf pcre-8.45.tar.gz cd pcre-8.45 ./configure --prefix=/usr/local make && sudo make install
AI said to do the following and I don’t even think I did:
./configure –with-pcre=/usr/local/bin/pcre-config [your other flags]
Ubuntu, PopOS, and possibly other distros – PHP/OPENSSL issue
On anything but Mint my PHP script(s) often fail not being able to find openssl. Amend those with the following snippet:
export OPENSSL_CFLAGS="-I/usr/local/ssl/include" export OPENSSL_LIBS="-L/usr/local/ssl/lib -lssl -lcrypto" export CFLAGS="-I/usr/local/ssl/include" export LDFLAGS="-L/usr/local/ssl/lib -Wl,-rpath,/usr/local/ssl/lib" ./buildconf --force LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 ./configure \