进入源码目录
./configure \
--prefix=/usr/local/php8 \
--enable-fpm \
--enable-gd \
--with-pdo-mysql \
--with-curl \
--with-fpm-user=ubuntu \
--with-fpm-group=ubuntu \
--with-zlib \
--with-jpeg \
--with-webp=/usr/local/include/webp \
--with-freetype=/usr/local/freetype \
--without-sqlite3 \
--without-pdo-sqlite \
--disable-rpath\
make && make install
cp /home/php/php.ini-development /usr/local/php8/lib/php.ini
cp /usr/local/php8/etc/php-fpm.conf.default /usr/local/php8/etc/php-fpm.conf
cp /usr/local/php8/etc/php-fpm.d/www.conf.default /usr/local/php8/etc/php-fpm.d/www.conf
killall php-fpm && /usr/local/php8/sbin/php-fpm
phpize
./configure
make && make install
phpize
./configure --with-openssl --with-php-config=/usr/local/php8/bin/php-config
make && make install
https://blog.csdn.net/huaminghui/article/details/82263579
make clean
./configure --prefix=/usr/local/jpeg
make && make install
./configure --with-php-config=/usr/local/php8/bin/php-config --with-jpeg=/usr/local/jpeg --with-freetype=/usr/local/freetype
make && make install
#提示找不到freetype2,echo PKG_CONFIG_PATH;
export PKG_CONFIG_PATH=/usr/local/freetype/lib/pkgconfig
然后再重新配置
freetype下载地址 https://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.gz
jpeg下载地址 http://www.ijg.org/
phpize的作用 用来扩展php的扩展模块,通过phpize可以建立php的外挂模块 主要作用就是检测环境以及在特定的目录生成相应的configure文件,这样make install命令后,生成的.so文件会自动加载到php扩展目录下面。
gd模块一直不出现jpeg,导致操作相关函数报错,重装了n遍php还是出现不了。。