我想使用nexmo平台,所以我从DigitalOcean创建了LAMP Droplet。在这一点上没有问题。之后,请在this页面上安装作曲家。
最近,当我想使用此命令安装nexmo时,
composer require nexmo/client
它已安装,但是当ı在我的index.php
文件中添加了此代码时
require_once _DIR__ . '/../vendor/autoload.php';
页面未加载。
这里是我的目录...
var/www/html/index.php
var/www/html/vendor
有人可以帮我什么问题吗?
我在Internet上搜索了问题,并尝试了一些解决方案,但没有任何改变。
[composer install - composer update
,等等...我尝试了这些。
如果index.php
和vendor
文件夹位于同一路径,则require_once
错误。它必须是:
require_once __DIR__ . '/vendor/autoload.php';
[__DIR__
解析到当前文件所在的目录,因此vendor
文件夹实际上位于__DIR__ . '/vendor/'
。