简体   繁体   中英

Is it possible to set include_path in my PHP application in Heroku?

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! :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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