安装脚本环境问题
FishZe opened this issue · 0 comments
FishZe commented
受影响版本
after 6dc6d93
描述
无法使用内建php
和composer
安装框架 (ubuntu 22.04
/ amd64
)
- 在将
php
和composer
从temp_dir
移动到runtime_dir
前执行了zhamao init
,报错如下:
[*] 开始安装框架到目录 zhamao-v3 ...
Composer could not detect the root package (zhamao/zhamao-v3-app) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
[*] 从 Composer 拉取框架 ...
./composer.json has been updated
Running composer update zhamao/framework
Loading composer repositories with package information
Updating dependencies
Lock file operations: 43 installs, 0 updates, 0 removals
...
[ErrCode:E00014] Cannot find any PHP runtime, please use command "./install-runtime.sh" or install PHP manually!
[!] 安装框架失败!
- 安装脚本不会移动
composer.phar
到runtime_dir
[*] 移动内建 Composer 到框架目录 /home/ubuntu/project/lark-what2eat/zhamao-v3/runtime/ ...
* Framework started with built-in php.
提取框架基础文件
提取 /zhamao ... 完成
提取 /config/config.php ... 完成
提取 /config/container.php ... 完成
提取 /config/file_header.json ... 完成
提取 /config/global.php ... 完成
提取 /config/global_old.php ... 完成
提取 /config/motd.txt ... 完成
[*] 初始化框架脚手架文件 ...
Could not open input file: /home/ubuntu/project/lark-what2eat/zhamao-v3/runtime/composer.phar
[!] 安装框架失败!
复现步骤
在不存在默认php
和composer
的设备执行安装脚本
bash <(curl -fsSL https://zhamao.xin/v3.sh)
解决方案
echo "$(nhead) 从 Composer 拉取框架 ..." && \
echo '{"minimum-stability":"dev","prefer-stable":true}' > composer.json && $composer_executable require -n zhamao/framework:^3.0 && \
$composer_executable require -n --dev swoole/ide-helper:^4.5 && \
if_restore_native_runtime && \
vendor/bin/zhamao init && \
echo "$(nhead) 初始化框架脚手架文件 ..." && \
echo "$(nhead) 移动内建 Composer 到框架目录 $ZM_RUNTIME_DIR ..." && \
(([ -e "$ZM_TEMP_DIR/composer" ] && mv "$ZM_TEMP_DIR/composer" "$ZM_RUNTIME_DIR") && \
([ -e "$ZM_TEMP_DIR/composer.phar" ] && mv "$ZM_TEMP_DIR/composer.phar" "$ZM_RUNTIME_DIR")) || {
echo "$(nhead red) 移动内建 Composer 到框架目录失败!" && return 1
}
附加信息
No response