我正在尝试在我的ubuntu服务器上部署我的PHP PHP应用程序。运行composer安装结束时有以下异常:
[RuntimeException]
Failed to execute git clone --no-checkout 'https://git-wip-
us.apache.org/repos/asf/logging-log4php.git'
'/var/www/webapp/public_html/vendor/apache/log4php' && cd
'/var/www/webapp/public_html/vendor/apache/log4php' && git remote
add composer 'https://git-wip-us.apache.org/repos/asf/logging-log4php.git' && git fetch composer
Cloning into '/var/www/webapp/public_html/vendor/apache/log4php'...
fatal: repository 'https://git-wip-us.apache.org/repos/asf/logging-log4php.git/' not found 我尝试向composer.json添加显式存储库,如下所示,但仍未取得任何进展
"repositories": [
{
"type": "vcs",
"url": "https://github.com/apache/logging-log4php"
}
],
"require": {
"apache/log4php": "2.3.0",
"phpmailer/phpmailer": "~6.0"
}我遗漏了什么?
发布于 2018-11-22 09:32:20
更正到存储库的链接后,不要忘记重新创建composer.lock文件。可能最简单的方法是删除它并运行composer install。
发布于 2019-07-08 23:00:29
创建一个具有以下内容的composer.json文件:
{
"require": {
"apache/log4php": "^2.3.0"
}
}运行Composer安装过程:
php composer.phar install这将在供应商/ Apache / log4php中安装apache log4php。
要使用log4php,只需在脚本中包含供应商/autooload.php。
require 'vendor/autoload.php';
$log = Logger::getLogger("default");
$log->info("Hello !!");https://stackoverflow.com/questions/53419960
复制相似问题