繁体   English   中英

在php应用中包含文件[HEROKU]

[英]Include files in php app [HEROKU]

我的应用程序可以在localhost上运行,但是当我在heroku上部署它时出现此错误

Warning: require(app/classes/sendgrid/sendgrid-php.php): failed to open stream: No such file or directory in /app/index.php on line 10 Fatal error: require(): Failed opening required 'app/classes/sendgrid/sendgrid-php.php' (include_path='.:/app/.heroku/php/lib/php') in /app/index.php on line 10

我的项目结构是:

mailer //project name
  |
  |-- footer.php
  |
  |-- header.php
  |
  |-- index.php
  |
  |-- inc
  |    |
  |    |-- style.css
  |
  |-- app
       |
       |-- classes
              |
              |-- app.php
              |
              |-- sendgrid
                     |
                     |-- sendgrid-php.php
                     |
                     |-- ...

(在我的index.php中,我可以毫无问题地包含app.php)

问题不是出自sendgrid,因为我也有亚马逊s3的问题...

解决了,您所要做的就是在根目录中添加composer.json文件(在本例中为mailer文件夹)。 该文件必须包含更少的{}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM