zl程序教程

您现在的位置是:首页 >  其它

当前栏目

ubunutu 18.04 编译php7.4.1

编译 18.04
2023-09-27 14:19:37 时间

 

 

如何在Ubuntu18.04下安装PHP7.4版本

 

https://www.jianshu.com/p/6aa3ac214153


想要在Ubuntu18.04上安装新版的PHP7.4要如何做呢?

因为Ubuntu本身的软件包里并没有最新版的PHP,一般是7.1或7.2版,如果你想尝鲜,只能自己安装。

1)先加入别人做好的软件包库;

sudo add-apt-repository ppa:ondrej/php
sudo apt update

2)安装指定版本的PHP;

sudo apt install php7.4
//以及相关的PHP包

 

参考:
https://computingforgeeks.com/how-to-install-php-on-ubuntu/
https://ayesh.me/Ubuntu-PHP-7.2

 

 

cd /usr/local/src

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

 

 

安装依赖
sudo apt-get install build-essential
sudo apt-get install -y pkg-config
sudo apt-get install libxml2-dev
sudo apt-get install libssl-dev
sudo apt-get install sqlite3 libsqlite3-dev
sudo apt-get install libbz2-dev
sudo apt-get install libgmp3-dev
sudo apt-get install libonig-dev
sudo apt-get install -y libedit-dev libreadline-dev
sudo apt-get install libxslt1-dev

 

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql-sock --with-mysqli --with-libxml-dir --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-zlib --with-iconv --with-bz2 --with-curl --with-cdb --with-pcre-dir --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --with-gettext --with-gmp --with-mhash --with-libmbfl --with-onig --with-pdo-mysql --with-zlib-dir --with-readline --with-libxml-dir --with-xsl --with-pear --enable-fpm --enable-soap --enable-bcmath --enable-calendar --enable-dom --enable-exif --enable-fileinfo --enable-filter --enable-ftp --enable-gd-native-ttf --enable-gd-jis-conv --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --enable-pdo --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-zip --enable-mysqlnd-compression-support

 

 

ubuntu18.04 安装php7.4

 

Ubuntu 18.04 安装 php7.4

 

error: Missing required libcurl >= 7.15.2

ubuntu 下执行configure是出现错误,无解
图片描述

确定安装了libcurl

 

解决了
执行命令:

`sudo apt-get install libcurl4-openssl-dev`


作者:hades
链接:https://segmentfault.com/q/1010000014500977#answer-1020000014504738
来源:SegmentFault 思否
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

 

centos7安装 php743 + php-fpm + nginx负载均衡