作曲家在移动文件夹后未加载课程

时间:2018-09-11 12:28:25

标签: php class composer-php

我遇到了一个问题,我将整个文件夹与供应商文件和所有内容一起移入了服务器,并且在localhost /本地副本正常运行时,不再加载类了。可能是什么问题? 错误代码是不必要的,但是我还是要添加它。.

  

致命错误:未捕获的错误:在/ home / user / full / path / of / the / file / where / its / located /中找不到类“ Google_Service_Adsense”

文件未更改,仅移入服务器。 Composer不在服务器中,它是受管服务器,因此也无法安装和更新软件包或Composer。

composer.json:

  

{“ require”:{“ google / apiclient”:“ ^ 2.0”,“ google / apiclient-services”:“ ^ 0.68.0”}}

类文件应驻留的文件路径:

  

myDirectory \ vendor \ google \ apiclient-services \ src \ Google \ Service \ AdSense.php

它实际位于github存储库中的链接:

https://github.com/google/google-api-php-client-services/blob/master/src/Google/Service/AdSense.php


更新: 从服务器删除整个内容并重新导入后,出现此错误: Fatal error: require(): Failed opening required '/home/user/full/path/of/the/file/where/its/located/vendor/composer/../guzzlehttp/psr7/src/functions_include.php' (include_path='.:/usr/share/pear') in /home/user/full/path/of/the/file/where/its/located/vendor/composer/autoload_real.php on line 66


第二次更新。再次从服务器中删除包含内容的目录后,上传一个压缩的存档,将其解压缩后,我仍然遇到第一个致命错误。

1 个答案:

答案 0 :(得分:0)

在使用不同类型的文件上载和解压缩进行了超出我应有的努力之后,我手动加载了类所在的文件(即使我认为不需要这样做) 喜欢:

  require_once __DIR__ . '/vendor/google/apiclient-services/src/Google/Service/AdSense.php';

它开始工作。