【问题标题】:Include files in php app [HEROKU]在 php 应用程序中包含文件 [HEROKU]
【发布时间】:2018-01-19 06:27:18
【问题描述】:

我的应用在 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,因为我也有 amazon s3 的问题...

【问题讨论】:

    标签: php heroku amazon-s3 sendgrid


    【解决方案1】:

    已解决,您所要做的就是在根目录中添加 composer.json 文件(在我的情况下,在名为 mailer 的文件夹中)。此文件必须包含少于 {}

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-27
      • 2012-09-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多