linux - php7.0.13 安裝完成gd庫沒有freetype

來源:互聯網
上載者:User

linux小白,red hat 7.0 下安裝php 7.0.13,完成之後在phoinfo中的gd擴充內沒有freetype。

編譯指令碼

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

freetype使用yum安裝的,位置就在/usr/include/freetype2/freetype,編譯完成並安裝php之後,貌似並沒有裝上freetype。試了好幾遍都不行,初入linux,也不知道問題出在哪。麻煩幫忙看看。

是phpinfo中的gd庫資訊,可見gd庫是裝上了的。

回複內容:

linux小白,red hat 7.0 下安裝php 7.0.13,完成之後在phoinfo中的gd擴充內沒有freetype。

編譯指令碼

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

freetype使用yum安裝的,位置就在/usr/include/freetype2/freetype,編譯完成並安裝php之後,貌似並沒有裝上freetype。試了好幾遍都不行,初入linux,也不知道問題出在哪。麻煩幫忙看看。

是phpinfo中的gd庫資訊,可見gd庫是裝上了的。

之前寫過一個安裝備忘[cetnos 7],直接粘過來了.
freetype:

安裝依賴程式包

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

安裝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

缺少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

注意

  1. 這裡的--prefix 和 php裡的--with-iconv值保持一致

  2. 將安裝包下檔案 :srclib/stdio.in.h 中 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); 改為

#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");#endif 

編譯時間記憶體不足

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

解決:添加swap交換記憶體

#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

操作樣本

[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]# 

編譯與安裝

$ make && make install

這裡要make好久,要耐心一下

配置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

參考

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.