boys1999 发表于 2023-9-18 11:30:33

lnmp1.9 upgrade.sh 提示文件不存,但文件是存在的

本帖最后由 boys1999 于 2023-9-18 11:32 编辑

一年前安装的,今天想安装个nginx第三方模块,执行更新时都是提示文件不引入

我的 lnmp 目录有点奇怪
在 /root/lnmp1.9 里面还有一个一模一样的/root/lnmp1.9/lnmp1.9/,所有文件和目录和外面一样

在我执行下面命令时,发现有这个: /root/lnmp1.9/lnmp1.9/, 如下所示, 我想应该就以这个目录的为准: /root/lnmp1.9/lnmp1.9/

# /usr/local/nginx/sbin/nginx -V
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-openssl=/root/lnmp1.9/lnmp1.9/src/openssl-1.1.1o --with-openssl-opt='enable-weak-ssl-ciphers'



执行 /root/lnmp1.9/lnmp1.9/upgrade.sh 和 /root/lnmp1.9/upgrade.sh 都是一样提示


# /root/lnmp1.9/lnmp1.9/upgrade.sh
/root/lnmp1.9/lnmp1.9/upgrade.sh: line 15: lnmp.conf: No such file or directory
/root/lnmp1.9/lnmp1.9/upgrade.sh: line 16: include/version.sh: No such file or directory
...

# /root/lnmp1.9/lnmp1.9/upgrade1.x-1.9.sh
/root/lnmp1.9/lnmp1.9/upgrade1.x-1.9.sh: line 13: lnmp.conf: No such file or directory
/root/lnmp1.9/lnmp1.9/upgrade1.x-1.9.sh: line 14: include/main.sh: No such file or directory
...

# /root/lnmp1.9/upgrade1.x-1.9.sh
/root/lnmp1.9/upgrade1.x-1.9.sh: line 13: lnmp.conf: No such file or directory
/root/lnmp1.9/upgrade1.x-1.9.sh: line 14: include/main.sh: No such file or directory
...

实际上类似下面这些文件都存在的
/root/lnmp1.9/lnmp1.9/lnmp.conf
/root/lnmp1.9/lnmp1.9/include/main.sh


boys1999 发表于 2023-9-18 11:43:24

\root\lnmp1.9\lnmp1.9\upgrade.sh文件内容,没动过
#!/usr/bin/env bash
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin

# Check if user is root
if [ $(id -u) != "0" ]; then
    echo "Error: You must be root to run this script"
    exit 1
fi

cur_dir=$(pwd)
action=$1
shopt -s extglob
Upgrade_Date=$(date +"%Y%m%d%H%M%S")

. lnmp.conf
. include/version.sh
. include/main.sh
. include/init.sh
. include/php.sh
. include/nginx.sh
. include/mysql.sh
. include/mariadb.sh
. include/upgrade_nginx.sh
. include/upgrade_php.sh
. include/upgrade_mysql.sh
. include/upgrade_mariadb.sh
. include/upgrade_mysql2mariadb.sh
. include/upgrade_phpmyadmin.sh
. include/upgrade_mphp.sh

Get_Dist_Name
Get_Dist_Version
MemTotal=`free -m | grep Mem | awk '{print$2}'`

licess 发表于 2023-9-18 20:04:39

官网教程https://lnmp.org/faq/lnmp1-2-upgrade.html上有说明,必须要进入到安装包目录下后 ./upgrade.sh

boys1999 发表于 2023-9-19 09:13:38

licess 发表于 2023-9-18 20:04
官网教程https://lnmp.org/faq/lnmp1-2-upgrade.html上有说明,必须要进入到安装包目录下后 ./upgrade.sh ...

原来这样, 感谢大佬. 没弄明白shell执行的路径问题;P
页: [1]
查看完整版本: lnmp1.9 upgrade.sh 提示文件不存,但文件是存在的