銀河麒麟V10服務器版本編譯安裝php7.2.12


上傳tar包php-7.2.12.tar.gz

tar -zxvf php-7.2.12.tar.gz

cd php-7.2.12

./configure --prefix=/home/kookserver/php --with-config-file-path=/home/kookserver/php/etc --with-config-file-scan-dir=/home/kookserver/php/etc/php.d --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-gd --with-iconv --with-zlib --enable-xml --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-ftp --with-openssl --enable-pcntl  --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir  --with-freetype-dir --enable-opcache --with-libxml-dir --with-png-dir --with-xpm-dir=/usr/lib64/ 

make && make install

添加mongodb擴展(http://pecl.php.net/package/mongodb)
tar -zxvf mongodb-1.8.2.tgz
cd mongodb-1.8.2
/home/kookserver/php/bin/phpize
./configure --with-php-config=/home/kookserver/php/bin/php-config
make && make install

配置文件的末尾加上extension=mongodb.so這一段,重啟php服務

 

添加imap擴展

cd php-7.2.12/ext/imap

/home/kookserver/php/bin/phpize
./configure --with-php-config=/home/kookserver/php/bin/php-config

編譯報錯

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing

需要安裝 

libc-client libc-client-devel這兩個包

但是麒麟V10自帶的yum源沒有找到,只能通過rpm包安裝(https://centos.pkgs.org/

獲取libc-client:

wget  https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/l/libc-client-2007f-24.el8.aarch64.rpm

獲取 libc-client-devel:

wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/u/uw-imap-devel-2007f-24.el8.aarch64.rpm

注意:這里需要安裝centos8版本的rpm包,不能選centos7,rpm安裝7版本的libc-client包時找不到libcrypto.so和libssl.so,但是/usr/lib64下有這兩個庫文件

其實是因為麒麟V10自帶的openssl版本是1.1.1d,而7版本的libc-client包適配的是1.0.2版本的openssl

rpm -ivh libc-client-2007f-24.el8.aarch64.rpm

rpm -ivh uw-imap-devel-2007f-24.el8.aarch64.rpm

繼續編譯,報錯:cannot find imap library(libc-client.a)

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so,該報錯消失

再編譯,會提示讓你加一些 --參數,提示什么參數就加什么

我的是 ./configure --with-php-config=/home/kookserver/php/bin/php-config  --with-kerberos --with-imap-ssl

然后make && make install成功

配置文件的末尾加上extension=imap.so這一段,重啟php服務

 

添加mcrypt擴展

 7.1以下版本默認自帶mcrypt功能,7.2版本的ext下沒有找到mcrypt目錄

把7.0.11的編譯包解壓后,其中的ext/mcrypt拷貝到7.2.12的ext目錄下進行編譯

cd php-7.2.12/ext/mcrypt

/home/kookserver/php/bin/phpize
./configure --with-php-config=/home/kookserver/php/bin/php-config

編譯報錯:需要安裝libmcrypt

centos系統可以通過yum install libmcrypt libmcrypt-devel mcrypt mhash

但是銀河麒麟的yum源沒有這些包,只能下載rpm包

wget https://download-ib01.fedoraproject.org/pub/epel/7/aarch64/Packages/l/libmcrypt-2.5.8-13.el7.aarch64.rpm

wget https://download-ib01.fedoraproject.org/pub/epel/7/aarch64/Packages/l/libmcrypt-devel-2.5.8-13.el7.aarch64.rpm

rpm -ivh libmcrypt-2.5.8-13.el7.aarch64.rpm

rpm -ivh libmcrypt-devel-2.5.8-13.el7.aarch64.rpm

繼續編譯

make && make install 成功

 配置文件的末尾加上extension=mcrypt.so這一段,重啟php服務


免責聲明!

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



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