Ubuntu下编译安装php7.4

Linux2021-01-13 06:24:44110条
在Ubuntu系统下如何编译安装php7.4?

1. 下载

从搜狐镜像源下载php安装包

wget http://mirrors.sohu.com/php/php-7.4.9.tar.gz

2. 解压安装包

tar -zxvf php-7.4.9.tar.gz

3. 查看配置参数

./configure --help

4. 编译安装

./configure --prefix=/usr/local/php74 --with-config-file-path=/usr/local/php74/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --disable-debug  --with-iconv --with-zlib --enable-bcmath --enable-ftp --enable-sockets --enable-mbstring --with-gd --enable-mbregex --enable-soap --enable-xml --with-curl  --with-openssl --enable-opcache --with-mysqli --with-mysql-sock --with-pdo-mysql --enable-mysqlnd --enable-fileinfo --enable-gd --with-jpeg --with-png  --with-mhash --with-freetype --enable-pcntl --enable-zip --enable-gd-jis-conv --without-pear --with-gettext --with-iconv-dir=/usr/local/lib --enable-maintainer-zts --enable-xml --disable-rpath --enable-shmop --enable-sysvsem --enable-inline-optimization
make && make install

编译检查时可能会碰到两个报错:

  • No package ‘sqlite3’ found
apt-get install sqlite3 libsqlite3-dev
  • No package ‘oniguruma’ found
git clone https://github.com/kkos/oniguruma.git oniguruma
cd oniguruma
./autogen.sh
./configure
make
make install
评论啦~
暂无评论,快来抢沙发吧!