linux-php7.0.13 installation Complete GD Library no FreeType

Source: Internet
Author: User
Tags gmp

Linux small white, Red Hat 7.0 under the installation of PHP 7.0.13, after completion in Phoinfo in the GD extension does not freetype.

Compiling scripts

./configure --with-apxs2=/usr/local/apache/bin/apxs  --prefix=/usr/local/php --with-gd --with-freetype-dir=/usr/include/freetype2/freetype

FreeType installed with Yum, the location is/usr/include/freetype2/freetype, after compiling and installing PHP, it does not seem to be loaded freetype. Tried several times not, first into Linux, do not know where the problem. Please help to see.

Is the phpinfo in the GD library information, it can be seen that the GD library is loaded.

Reply content:

Linux small white, Red Hat 7.0 under the installation of PHP 7.0.13, after completion in Phoinfo in the GD extension does not freetype.

Compiling scripts

./configure --with-apxs2=/usr/local/apache/bin/apxs  --prefix=/usr/local/php --with-gd --with-freetype-dir=/usr/include/freetype2/freetype

FreeType installed with Yum, the location is/usr/include/freetype2/freetype, after compiling and installing PHP, it does not seem to be loaded freetype. Tried several times not, first into Linux, do not know where the problem. Please help to see.

Is the phpinfo in the GD library information, it can be seen that the GD library is loaded.

Before I wrote a setup memo [Cetnos 7], I glued it directly.
FreeType

Installing dependent Packages

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel

Install PHP

Configure

./configure--prefix=/alidata/server/php-7.0.5--enable-fpm--with-fpm-user=nginx--with-fpm-group=nginx-- Enable-inline-optimization--disable-debug--disable-rpath--enable-shared--enable-soap--with-libxml-dir-- With-xmlrpc--with-openssl--with-mcrypt--with-mhash--with-pcre-regex--with-sqlite3--with-zlib--enable-bcmath-- With-iconv=/usr/local--with-bz2--enable-calendar--with-curl--with-cdb--enable-dom--enable-exif-- Enable-fileinfo--enable-filter--with-pcre-dir--enable-ftp--with-gd--with-openssl-dir--with-jpeg-dir-- With-png-dir--with-zlib-dir--with-freetype-dir--enable-gd-native-ttf--enable-gd-jis-conv--with-gettext-- With-gmp--with-mhash--enable-json--enable-mbstring--enable-mbregex--enable-mbregex-backtrack--WITH-LIBMBFL-- With-onig--enable-pdo--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-zlib-dir--with-pdo-sqlite-- With-readline--enable-session--enable-shmop--enable-simplexml--enable-sockets--enable-sysvmsg--enable-sysvsem- -enAble-sysvshm--enable-wddx--with-libxml-dir--with-xsl--enable-zip--enable-mysqlnd-compression-support-- With-pear--enable-opcache

Missing Libiconv

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar -zxvf libiconv-1.14.tar.gzcd libiconv-1.14.1 ./configure --prefix=/usr/localmake && make install

Attention

    1. This is --prefix consistent with the values in PHP. --with-iconv

    2. To change the installation package under File: srclib/stdio.in.h _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

Insufficient memory at compile time

virtual memory exhausted: Cannot allocate memorymake: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1

FIX: Add swap swap memory

#1.进入目录cd /var#2.获取要增加的SWAP文件块(这里以1GB为例)dd if=/dev/zero of=swapfile bs=1024 count=1038336#3.创建SWAP文件/sbin/mkswap swapfile#4.激活SWAP文件/sbin/swapon swapfile#5.查看SWAP信息是否正确/sbin/swapon -s#6.添加到fstab文件中让系统引导时自动启动echo "/var/swapfile swap swap defaults 0 0" >>/etc/fstab

Operation Example

 [Root@iz25uog2aivz var]# dd If=/dev/zero of=swapfile bs=1024 count=10383361038336+0 Records in1038336+0 Records out1063256064 bytes (1.1 GB) copied, 19.287 S, 55.1 mb/s[root@iz25uog2aivz var]#/sbin/mkswap swapfilesetting up Swapspace Version 1, size = 1038332 kibno label, Uuid=59e3b114-ed70-4d64-af01-2d02873fa358[root@iz25uog2aivz var]#/sbin/swapon SW Apfileswapon:/var/swapfile:insecure permissions 0644, 0600 suggested. [Root@iz25uog2aivz var]#/sbin/swapon-sfilename Type Size used Priority/var/swapfile File 1038332 0-1[root@iz25uog2aivz var]# echo "/var/swapfile Swap swap defaults 0 0" >&G T;/ETC/FSTAB[ROOT@IZ25UOG2AIVZ var]# free-m Total used free shared buffers Cachedmem: 992 923 1 309-/+ buffers/cache:611 381Swap: 1013 0 1013[root@iz25uog2aivz var]# 

Compiling and installing

$ make && make install

It's going to be a long time, so be patient.

Configure PHP-FPM

$ cp php.ini-production /etc/php.ini$ cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf$ cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf$ cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm$ chmod +x /etc/init.d/php-fpm

Reference

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.