是否可以在Heroku的PHP应用程序中设置include_path?
As the title says... If so, how? Thanx for providing solutions such as links to official documentation related to it as well as just replying it is impossible! :)
正如标题所说......如果是这样,怎么样? Thanx提供解决方案,例如与其相关的官方文档的链接以及回复它是不可能的! :) p> div>
On Heroku documentation:
https://devcenter.heroku.com/articles/custom-php-settings#php-runtime-settings
It says you can add a file named .user.ini
to your document root (not necessarily the same as your application root) with your custom php settings.
I hope this saves someone some time. I wasted a couple hours on this.
Quick note - your application root is /app
, so in my case, I added /app/includes
to the include_path
Just to give a working example, and I'm guessing so you can access installed composer/pear packages or includes, I used the following setup:
.user.ini (in app root):
include_path=".:includes:vendor/composer"
Procfile (remote):
web: vendor/bin/heroku-php-apache2
Procfile.test (local):
web: php -S 0.0.0.0:$PORT -c .user.ini