【php安裝fileinfo擴展】使用編譯安裝


1.首先檢查系統是否已經安裝

[root@iZbp1dwql3ymcem09rfdchZ ~]# php -i|grep fileinfo
Configure Command => './configure' '--prefix=/alidata/server/php' '--enable-opcache' '--with-config-file-path=/alidata/server/php/etc' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-fpm' '--enable-fastcgi' '--enable-static' '--enable-inline-optimization' '--enable-sockets' '--enable-wddx' '--enable-zip' '--enable-calendar' '--enable-bcmath' '--enable-soap' '--with-zlib' '--with-iconv' '--with-gd' '--with-xmlrpc' '--enable-mbstring' '--without-sqlite' '--with-curl' '--enable-ftp' '--with-mcrypt' '--with-freetype-dir=/usr/local/freetype.2.1.10' '--with-jpeg-dir=/usr/local/jpeg.6' '--with-png-dir=/usr/local/libpng.1.2.50' '--disable-ipv6' '--disable-debug' '--with-openssl' '--disable-maintainer-zts' '--disable-safe-mode' '--disable-fileinfo'
fileinfo
fileinfo support => enabled

如果出現上面說明已經安裝(或者phpinfo查找【fileinfo】,沒有則進行下面步驟)


2.執行下載包含fileinfo擴展的php安裝包命令,也可以獨立下載fileinfo編譯安裝包

首先進入php所在目錄(避免文件雜亂--非必須):cd /usr/local/php/

wget -O php-5.6.36.tar.gz http://cn2.php.net/get/php-5.6.36.tar.gz/from/this/mirror

 

3.解壓

tar -zxvf php-5.6.36.tar.gz

 

4.當前目錄解壓完,進入下面目錄 

cd php-5.6.36/ext/fileinfo/

 

5.在之前已經編譯安裝的的php的bin目錄中找到命令phpize執行生成.configure文件(核心:找到phpinfo中phpize和php-config的路徑

/usr/local/php/bin/phpize

6.配置、編譯安裝

 ./configure -with-php-config=/usr/local/php/bin/php-config

make && make install

 

7.修改php.ini
加入extension=fileinfo.so

8.重啟服務器,完成


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM