Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php doesn't recognize environment variables #4

Closed
yevgenko opened this issue Sep 12, 2012 · 4 comments
Closed

php doesn't recognize environment variables #4

yevgenko opened this issue Sep 12, 2012 · 4 comments

Comments

@yevgenko
Copy link

I might be missing, but php doesn't see environment variables with this buildpack, e.g.:

getenv("CLEARDB_DATABASE_URL");

or

getenv("BUILDPACK_URL");

doesn't return anything.

I also found that original buildpack puts environment variables into httpd.conf in boot.sh script, see: https://github.com/heroku/heroku-buildpack-php/blob/master/bin/compile#L50

@iphoting
Copy link
Owner

You need to modify php-fpm.conf to specifically defined allowed env vars.
https://github.com/iphoting/heroku-buildpack-php-tyler/blob/master/conf/php-fpm.conf#L463

Just copy the php-fpm.conf from this buildpack and drop it with your changes in your app's conf/ folder; the copy from your app's conf/ folder will override that of from this buildpack.

Indeed, the way env is done in the original buildpack boot.sh is quite interesting. I'll try to adapt the idea when I'm free over the coming weeks. In anyway, I don't mind a pull request either.

@iphoting
Copy link
Owner

I've added this feature to commit 997e021.

Please help me test this in the develop branch like so:

heroku config:add BUILDPACK_URL=git://github.com/iphoting/heroku-buildpack-php-tyler.git#develop

Let me know if it works.

@yevgenko
Copy link
Author

Thank you Ronald, it works :)

Especially if I start a fresh app, e.g.:

heroku create -s cedar -b git://github.com/iphoting/heroku-buildpack-php-tyler.git#develop

Changing BUILDPACK_URL on existent app doesn't seems to reflect instantly, only after the next push, but I assume it is something heroku specific.

@iphoting
Copy link
Owner

Yes, it's heroku specific as the changes to the buildpack will only be exhibited in the app after the "compilation process".

I will merge it into master soon, if nothing breaks.

Shall close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants