Ubuntu 20.04 LTS编译安装PHP7.2 报错 configure: error: freetype-config not found

Ubuntu 20.04 LTS编译安装PHP7.2 报错 configure: error: freetype-config not found

依赖包安装:

    apt-get install -y libsodium-dev libonig-dev libsqlite3-dev libcurl4-openssl-dev libwebp-dev libvpx-dev libxslt1-dev
     
    apt-get install libxml2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libmcrypt-dev -y

php编译:

./configure --prefix=/sxws/srv/php/72--with-config-file-path=/sxws/srv/php/72/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl=/usr/local/curl --enable-mbregex --enable-mbstring --enable-intl --enable-pcntl --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl=/usr/local/openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --with-webp-dir=/usr --with-mcrypt

报错如下:

解决方法:

方法1、网上大多说安装依赖包 libfreetype6-dev,本人安装了确依旧失败;

    apt-get -y install libfreetype6-dev
    # 编译php的时候依旧报错

方法2、安装freetype,亲测有效;

参考:https://blog.csdn.net/qq_37674858/article/details/81085848

    cd /usr/local/src/
     
    wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz
     
    tar zxvf freetype-2.4.10.tar.gz
     
    cd freetype-2.4.10
     
    ./configure --prefix=/usr/local/freetype
    make && make install

第二种方式 安装freetype后编译PHP成功。

上一篇: php如何查询数据库是否存在 下一篇: 没有下一篇了
2141 2021-04-25

JavaScript >>

Linux >>

PHP >>

HTML/CSS >>

C/C++ >>

MySql >>

常用工具使用 >>