Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
litespeed_wiki:php:pecl-extension:gd [2019/11/27 17:29] qtwrk created |
litespeed_wiki:php:pecl-extension:gd [2019/11/29 16:04] Lisa Clarke Copyediting |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | How to Compile GD PHP Extension | + | ====== How to Compile the GD PHP Extension ====== |
- | Sometimes the lsphp-gd package is not up-to-date. | + | Sometimes the lsphp-gd package is not up-to-date, in which case it may be missing some features, like WebP support. If this happens, you can manually compile the GD extension to include the new features. |
- | This is guide for how to manually compile GD extension | + | {{ :litespeed_wiki:php:pecl-extension:lsphp-gd1.jpg |}} |
+ | ===== Install Dependencies ===== | ||
+ | <code>yum install -y lsphp73-devel gcc libjpeg-turbo-devel libpng-devel libXpm-devel freetype-devel libwebp-devel</code> | ||
- | yum install -y lsphp72-devel gcc libjpeg-turbo-devel libpng-devel libXpm-devel freetype-devel libwebp-devel | + | ===== Download the PHP Source Code ===== |
- | wget https://www.php.net/distributions/php-7.2.24.tar.gz | + | |
- | tar xzvf php-7.2.24.tar.gz | + | In this example we use ''lsphp73''. Please change it to another appropriate PHP version number if necessary. |
- | cd php-7.2.24 | + | |
+ | <code>wget https://www.php.net/distributions/php-7.3.12.tar.gz | ||
+ | tar xzvf php-7.3.12.tar.gz | ||
+ | cd php-7.3.12 | ||
cd ext | cd ext | ||
cd gd | cd gd | ||
- | /usr/local/lsws/lsphp72/bin/phpize | + | /usr/local/lsws/lsphp73/bin/phpize |
- | /usr/local/lsws/lsphp72/bin/php-config | + | ./configure --with-php-config=/usr/local/lsws/lsphp73/bin/php-config --with-webp-dir=/usr/include/webp --with-freetype-dir=/usr/include/freetype2/freetype --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-xpm-dir=/usr/include |
- | ./configure --with-php-config=/usr/local/lsws/lsphp72/bin/php-config --with-webp-dir=/usr/include/webp --with-freetype-dir=/usr/include/freetype2/freetype --with-jpeg-dir=/usr/include --with-png-dir=/usr/include --with-xpm-dir=/usr/include | + | |
make | make | ||
- | make install | + | make install</code> |
- | pkill lsphp | + | |
+ | ===== Restart and Verify ===== | ||
+ | Restart lsphp if necessary, and check the PHPinfo page again. | ||
+ | |||
+ | {{ :litespeed_wiki:php:pecl-extension:lsphp-gd2.jpg |}} |