Linux-php7.0.13 installation completed gd Library no freetype

Source: Internet
Author: User
Tags gmp
Install php7.0.13 in linux and redhat7.0. after completion, there is no freetype in the gd extension in phoinfo. Compile the script {code...} freetype to use yum for installation. The location is usr?defreetype2freetype. after compiling and installing php, it looks like...

Linux: install php 7.0.13 in red hat 7.0. after installation, there is no freetype in the gd extension in phoinfo.

Compile scripts

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

When freetype is installed using yum, it is located at/usr/include/freetype2/freetype. after compiling and installing php, it seems that freetype is not installed. I tried it several times but I didn't know what the problem was when I first started linux. Please take a look.

It is the gd Library Information in phpinfo. it can be seen that the gd Library is installed.

Reply content:

Linux: install php 7.0.13 in red hat 7.0. after installation, there is no freetype in the gd extension in phoinfo.

Compile scripts

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

When freetype is installed using yum, it is located at/usr/include/freetype2/freetype. after compiling and installing php, it seems that freetype is not installed. I tried it several times but I didn't know what the problem was when I first started linux. Please take a look.

It is the gd Library Information in phpinfo. it can be seen that the gd Library is installed.

I have written an installation memo [cetnos 7], and it is directly attached.
Freetype:

Install dependency 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 phpconfigure
./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
Libiconv missing
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
Note:
  1. Here--prefixAnd in php--with-iconvConsistent value

  2. Run the following command to download the files under the installation package:srclib/stdio.in.hMedium _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); Change

#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");#endif 
Insufficient memory during compilation
virtual memory exhausted: Cannot allocate memorymake: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
Solution: add swap memory
#1. go to the directory cd/var #2. obtain the SWAP file block to be added (1 GB is used as an example here) dd if =/dev/zero of = swapfile bs = 1024 count = 1038336 #3. create a SWAP file/sbin/mkswap swapfile #4. activate the SWAP file/sbin/swapon swapfile #5. check whether SWAP information is correct/sbin/swapon-s #6. add it to the fstab file and enable echo automatically during system boot "/var/swapfile 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 swapfileswapon: /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" >>/etc/fstab[root@iZ25uog2aivZ var]# free -m             total       used       free     shared    buffers     cachedMem:           992        923         69         81          1        309-/+ buffers/cache:        611        381Swap:         1013          0       1013[root@iZ25uog2aivZ var]# 
Compilation and installation
$ make && make install

It takes a long time to make. please 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.