Centos7 编译安装PHP7.4

首先安装依赖包:

yum -y install gcc gcc-c++ openssl openssl-devel libxml2 libxml2-devel curl-devel libjpeg-devel bzip2-devel.x86_64 libXpm-devel gmp-devel icu libicu libicu-devel php-mcrypt libmcrypt libmcrypt-devel postgresql-devel libxslt-devel libpng-devel libpng freetype-devel

安装libzip:

wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar xf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install

下载源码文件:

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

预编译:

./configure –prefix=/usr/local/php –enable-opcache –with-config-file-path=/usr/local/php/etc –with-curl –enable-fpm –enable-gd –with-iconv –enable-mbstring –with-mysqli=mysqlnd –with-openssl –enable-static –enable-sockets –enable-inline-optimization –with-zlib –disable-ipv6 –disable-fileinfo –disable-debug

如提示“No package ‘oniguruma’ found”需要安装 oniguruma包(可以参考 https://github.com/kkos/oniguruma#install):

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

如提示“No package ‘sqlite3’ found:

wget -P /data/tmp https://sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
cd /data/tmp/ && tar xf sqlite-autoconf-3280000.tar.gz
cd sqlite-autoconf-3280000
./configure
make && make install
whereis sqlite3
mv /usr/bin/{sqlite3,sqlite3.7}
cp /usr/local/bin/sqlite3 /usr/bin/sqlite3
sqlite3 –version
export LD_LIBRARY_PATH=”/usr/local/lib”
yum install sqlite-devel

然后执行make && make install 开始编译

分享到:

17 条评论

昵称
  1. Hello there! I know this is kinda off topic but I was wondering which blog platform are you using for this website? I’m getting tired of WordPress because I’ve had issues with hackers and I’m looking at alternatives for another platform. I would be awesome if you could point me in the direction of a good platform.

  2. F*ckin’ remarkable things here. I am very glad to see your article. Thanks a lot and i’m looking forward to contact you. Will you please drop me a mail?

  3. Great blog! I am loving it!! Will come back again. I am bookmarking your feeds also

  4. click reference

    I appreciate your work, thankyou for all the great articles.

  5. next page

    I delight in, cause I discovered exactly what I was looking for. You have ended my four day lengthy hunt! God Bless you man. Have a nice day. Bye

  6. Way cool, some valid points! I appreciate you making this article available, the rest of the site is also high quality. Have a fun.

  7. Click here

    Thank you for sharing excellent informations. Your web site is very cool. I am impressed by the details that you have on this site. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. You, my pal, ROCK! I found just the info I already searched all over the place and simply could not come across. What a great web-site.

  8. Hi my loved one! I want to say that this post is amazing, nice written and include approximately all significant infos. I?¦d like to peer more posts like this .

  9. this site

    I appreciate, cause I found exactly what I was looking for. You have ended my 4 day long hunt! God Bless you man. Have a great day. Bye

  10. linked here

    Woah! I’m really loving the template/theme of this website. It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between usability and visual appearance. I must say you have done a excellent job with this. Additionally, the blog loads super fast for me on Safari. Superb Blog!

  11. Good article and straight to the point. I am not sure if this is in fact the best place to ask but do you guys have any ideea where to hire some professional writers? Thanks in advance 🙂

  12. pexels

    Hi there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Internet explorer. I’m not sure if this is a formatting issue or something to do with internet browser compatibility but I figured I’d post to let you know. The layout look great though! Hope you get the problem fixed soon. Thanks

  13. that site

    I like this site so much, bookmarked. “To hold a pen is to be at war.” by Francois Marie Arouet Voltaire.

  14. After research a number of of the weblog posts on your web site now, and I really like your means of blogging. I bookmarked it to my bookmark web site record and will be checking back soon. Pls take a look at my web site as properly and let me know what you think.

  15. Tactical shit

    Enjoyed reading through this, very good stuff, thankyou.

  16. Hello! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no back up. Do you have any methods to prevent hackers?

  17. oprolevorter

    I consider something truly special in this internet site.