编译安装 PHP 7.4

PHP 7.4 总算是千呼万唤SHI出来了,距离上到线上环境肯定是还有一段距离,但是小范围的测试还是很容易的

最近大批量的从实体机迁移到kubernetes,所以直接在 php 7.3 的编译参数上面改一改参数直接起个容器测试安装一下

在编译的过程中碰到两个问题,先说一下这两个问题,然后再完整的编译

第一个问题:

sqlite3 >= 3.7.4 要求sqlite版本号,这个主要是没有devel包导致的

解决方法:

# yum install sqlite sqlite-devel

第二个问题:

No package 'oniguruma' found

这个问题就很蛋疼了,经过各路查找发现这是一个开源项目,开源地址: https://github.com/kkos/oniguruma 直接安装之就行,简单粗暴有效

解决方法:

yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-5.9.5-3.el7.x86_64.rpm
yum install https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-5.9.5-3.el7.x86_64.rpm

下载源码包:

wget https://www.php.net/distributions/php-7.4.0.tar.gz

wget https://pecl.php.net/get/redis-5.1.1.tgz

编译参数如下:

./configure –prefix=/php/ –with-config-file-path=/php/etc/ –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –enable-fpm –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 –with-curl –disable-ipv6 –disable-debug –disable-maintainer-zts –disable-fileinfo –enable-pcntl –with-openssl –with-freetype-dir –with-jpeg-dir –with-png-dir –enable-opcache && make -j `grep processor /proc/cpuinfo | wc -l` && make install && cd / && cd redis-5.1.1 && /php/bin/phpize && ./configure –with-php-config=/php/bin/php-config && make && make install

安装完成查看信息:

/php/sbin/php-fpm -v

PHP 7.4.0 (fpm-fcgi) (built: Dec 2 2019 13:00:31)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

初步搞定了,剩下的就是漫长的缓慢的代码功能测试了

特别注意:记得改 php.ini 里php拓展的的路径

特别注意:记得改 php.ini 里php拓展的的路径

特别注意:记得改 php.ini 里php拓展的的路径

10 评论

  1. you’re in reality a just right webmaster. The web site loading speed is amazing.
    It seems that you’re doing any unique trick. Also, The contents are masterpiece.

    you’ve performed a fantastic activity on this subject!

  2. I love your blog.. very nice colors & theme. Did
    you design this website yourself or did you hire
    someone to do it for you? Plz respond as I’m looking to
    create my own blog and would like to find out where u
    got this from. kudos

  3. Hello there! I know this is kinda off topic but I was wondering which blog
    platform are you using for this site? I’m getting sick and tired of WordPress because I’ve had
    problems with hackers and I’m looking at options
    for another platform. I would be fantastic if you could point me in the direction of a good platform.

  4. I think this is among the most significant information for
    me. And i’m glad reading your article. But want to remark on few general things, The site
    style is wonderful, the articles is really excellent :
    D. Good job, cheers

  5. Simply want to say your article is as astonishing. The clearness in your post is simply spectacular and i could assume
    you are an expert on this subject. Fine with your permission allow me
    to grab your feed to keep up to date with forthcoming post.
    Thanks a million and please keep up the enjoyable work.

留下评论

error: Content is protected !!