这次开始就要安装omv的各种依赖了,所有的依赖如下:
apt install php-fpm php-json php-cgi php-cli php-mbstring ethtool python3-dialog acl xfsprogs jfsutils ntfs-3g sdparm postfix bsd-mailx cpufrequtils smartmontools uuid nfs-kernel-server proftpd-basic sshpass samba samba-common-bin rsync avahi-daemon libnss-mdns beep php-bcmath gdisk rrdtool collectd anacron cron-apt quota php-xml quotatool lvm2 watchdog libjson-perl liblocale-po-perl proftpd-mod-vroot libjavascript-minifier-xs-perl xmlstarlet socat rrdcached nginx wpasupplicant btrfs-progs samba-vfs-modules python3-pyudev python3-natsort jq chrony python3-netifaces python3-lxml salt-minion php-yaml python-click python3-click
其中比较容易安装且已安装有:
php-mbstring,ethtool,python3-dialog,acl,xfsprogs,jfsutils,ntfs-3g,sdparm,postfix,bsd-mailx
smartmontools uuid nfs-kernel-server proftpd-basic sshpass samba samba-common-bin rsync avahi-daemon libnss-mdns beep
gdisk rrdtool collectd anacron cron-apt quota php-xml quotatool lvm2 watchdog libjson-perl liblocale-po-perl proftpd-mod-vroot
libjavascript-minifier-xs-perl xmlstarlet socat rrdcached nginx wpasupplicant btrfs-progs samba-vfs-modules python3-pyudev
python3-natsort jq chrony python3-netifaces python3-lxml salt-minion php-yaml python3-click
monit wsdd
不好安装的如下:
cpufrequtils php-fpm php-json php-cgi php-cli php-bcmath php-pam libjs-extjs6
可以看到,不好安装其中有php的依赖,所以,先安装php。
源码安装需要经历步骤:配置(configure)、编译(make)、安装( make install )。
参考帖:编译安装 PHP7.4 环境,并将 php-fpm 添加到 systemctl 系统服务管理_php7.4 php-fpm_白菜1031的博客-CSDN博客
编译安装PHP
1. 下载源码包
wget http://be2.php.net/get/php-7.4.15.tar.gz/from/this/mirror -O php-7.4.15.tar.gz
2. 解压源码包并进入源码包目录
3. 安装PHP编译安装所必须的软件
yum -y install gcc gcc++ libxml2-devel libicu-devel sqlite-devel oniguruma oniguruma-devel autoconf zip unzip
4. configure 指定安装目录,启用fpm 等扩展
./configure --prefix=/usr/local/php74 --enable-fpm --enable-mbstring --enable-bcmath --enable-fileinfo --with-openssl --with-zlib --with-iconv --with-curl --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pear --enable-xml --enable-sockets --enable-soap --enable-cli
如果抛出错误 ,则添加 参数configure: error: cannot run C compiled programs--host=arm
./configure --host=arm --prefix=/usr/local/php74 --enable-fpm --enable-mbstring --enable-bcmath --enable-fileinfo --with-openssl --with-zlib --with-iconv --with-curl --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-pear --enable-xml --enable-sockets --enable-soap --enable-cli
遇到错误
checking for libxml-2.0 >= 2.7.6... no
configure: error: Package requirements (libxml-2.0 >= 2.7.6) were not met:
No package 'libxml-2.0' 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 LIBXML_CFLAGS
and LIBXML_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
参考帖子:Ubuntu编译安装php7.4 - 大雨转暴雨 - 博客园 (cnblogs.com)
apt install pkg-config Libxml2-dev -y#如果libxml2无法安装,需要到官网下载自行编译: https://gitlab.gnome.org/GNOME/libxml2/-/releases tar -zxvf v2.9.9.tar.gz -C /usr/local/src cd /usr/local/src/ ./autogen.sh ./configure --prefix=/usr/local/libxml2 && make -j4 && make install
如果遇到错误
checking for sqlite3 > 3.7.4... noconfigure: error: Package requirements (sqlite3 > 3.7.4) were not met:No package 'sqlite3' foundConsider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard prefix.Alternatively, you may set the environment variables SQLITE_CFLAGSand SQLITE_LIBS to avoid the need to call pkg-config.See the pkg-config man page for more details.
解决:
sudo apt install libsqlite3-dev
如果遇到错误:
参考帖子:configure: error: Package requirements (oniguruma) were not met-CSDN博客
安装PHP7.4找不到包error: Package requirements (oniguruma) were not met错误_kang50055的博客-CSDN博客
wget
-O oniguruma-6.9.4.tar.gztar -xvf oniguruma-6.9.4.tar.gz
cd oniguruma-6.9.4/
./autogen.sh
./configure --prefix=/usr --libdir=/lib64 //64位的系统一定要标识 --libdir=/lib64 否则还是不行
make && make install
ONIG_LIBS=-L/usr/lib64 ONIG_CFLAGS=-I/usr/include
再次执行命令:
./configure --prefix=/apps/php74 --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-zlib --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-mbstring --enable-xml --enable-sockets --enable-fpm --enable-maintainer-zts --disable-fileinfo ONIG_LIBS=-L/usr/lib64 ONIG_CFLAGS=-I/usr/include
看到这些信息,就算是配置完成了。
之后使用命令,进行编译安装。
make && make install
不出意外,又出错了
安装未完成,敬请期待。。。。(我头都要秃了,依赖太多了啊啊啊啊啊啊)