文件包括不在heroku服务器上工作(没有这样的文件或目录)

Php line is working fine on localhost but not on live heroku server, even if I have the same file and folder structure.

require(APPPATH . '../../vendor/mpdf/mpdf/mpdf.php');

I am getting following error on heroku live server is:

PHP Fatal error:  require(): Failed opening required 'application/../../vendor/mpdf/mpdf/mpdf.php' (include_path='.:/app/.heroku/php/lib/php') in /app/CI/application/libraries/PDFLib.php on line 5

spend a lot of time trying to figure out what could be the reasons behind this, any help will appreciated.

I just ran composer update with my branch. It ends up updating the composer.lock file and adding the “mpd/mpdf” and “setasign/fpdi” packages

So what is happening is, my composer.lock file doesn’t include mpdf or fpdi. When Heroku tries to build the application, it modifies the “vendor” directory to match what my composer.lock file specifies.

And my composer.lock file specifies that mpdf and fpdi should not be part of the application

However, this is different from the composer.json file, which specifies that mpdf and fpdi should be part of the application.