158******53
deepin
2022-07-18 05:03 #源码安装PHP8,整理了一下
#依赖安装,执行下面命令
apt install -y \
libcurl4-openssl-dev\
install libsqlite3-dev\
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
zlib1g-dev \
libxml2-dev \
libzip-dev \
graphviz \
#PHP编译检查
./configure \
--prefix=/opt/apps/php8 \
--with-mcrypt=/usr/include \
--enable-mysqlnd \
--with-mysqli \
--with-pdo-mysql \
--enable-fpm \
--with-fpm-user=buffer\
--with-fpm-group=buffer \
--with-gd \
--with-iconv \
--with-zlib \
--enable-xml \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-gd-native-ttf \
--with-openssl \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--without-pear \
--with-gettext \
--enable-session \
--with-curl \
--with-jpeg-dir \
--enable-opcache
#出现错误
checking for oniguruma... no
configure: error: Package requirements (oniguruma) were not met:
No package 'oniguruma' found
#解决错误
wget https://github.com/kkos/oniguruma/releases/download/v6.9.8/onig-6.9.8.tar.gz
./configure make&&make install
#再执行PHP安装成功编辑
#make && make install
Reply Like 0 View the author


中文 
./configure
--prefix=/usr/local/php8
--exec-prefix=/usr/local/php8
--bindir=/usr/local/php8/bin
--sbindir=/usr/local/php8/sbin
--includedir=/usr/local/php8/include
--libdir=/usr/local/php8/lib/php
--mandir=/usr/local/php8/php/man
--with-mcrypt=/usr/include
--enable-mysqlnd
--with-mysqli
--with-pdo-mysql
--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
--enable-gd-native-ttf
--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
checking for sqlite3 >= 3.7.7... no
configure: error: Package requirements (sqlite3 >= 3.7.7) were not met:
No package 'sqlite3' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables SQLITE_CFLAGS
and SQLITE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
#上面提示 (sqlite3 >= 3.7.7) 其实是满足的
我的版本是:
root@buffer-PC:/opt/src/php8# sqlite3 version
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
sqlite>
#猜测是PHP默认sqlite3的路径,和depin安装路径不一样。
#1.是否可以指定安装sqlite3安装路径
#2.其他安装方式 apt install php
#我先放弃源码安装,有时间再研究
#执行命令安装吧 截止(2022/7/17)只有PHP7.3
#apt install php