dmikusa / cf-php-apache-buildpack

CloudFoundry PHP & Apache HTTPD Buildpack
Apache License 2.0
4 stars 11 forks source link

Invalid JSON in VCAP_SERVICES environment variable #5

Closed nshenry03 closed 10 years ago

nshenry03 commented 10 years ago

It seems that the VCAP_SERVICES environment variable has invalid JSON now (it used to work correctly)?

I created test.php with the following:

<?php
echo $_ENV['VCAP_SERVICES'];
?>

It returns the following (http://nshwptest.testcfapp.standingcloud.com/test.php):

{
    "cleardb-n/a": [
        {
            "name": "cleardb-c14b5",
            "label": "cleardb-n/a",
            "tags": [
                "mysql",
                "relational"
            ],
            "plan": "spark",
            "credentials": {
                "jdbc

It didn't used to do this; any suggestions? Could it be a newer version of PHP or HTTPD that's breaking things?

Thanks!

dmikusa commented 10 years ago

This is a regression with the build pack's build of the latest version of HTTPD, 2.2.26. With this version I upgraded mod_fcgid to 2.3.9, but I forgot to the patch I use to enable support long environment variable with mod_fcgid. Normally mod_fcgid limits this to 128 characters, I've extended it to 2048 since VCAP_SERVICES can hold a ton of stuff.

This shouldn't be a problem in the older binaries for HTTPD 2.2.x or 2.4.x, so the workaround here is to downgrade or upgrade to 2.4. You can do that by setting a specific HTTPD_VERSION in your options.json.

I've also rebuilt 2.2.26 & mod_fcgid with the patch I mentioned. So if you "cf push", you should see it download HTTPD 2.2.26 again and hopefully that will resolve the issue.

dmikusa commented 10 years ago

If you just tried this in the last few minutes, please retry. I apologize but my dropbox upload hung so the uploaded binary never made it out. The uploaded binaries should be available now.

dmikusa commented 10 years ago

Tested and this should be fixed now. If you still see the problem, do a "cf delete" and "cf push". This will clear any files out that might be cached on the server. If it still occurs, reopen this ticket.

nshenry03 commented 10 years ago

Works great, thanks :-D! Thanks for the fast turn-around.

Nicholas Henry

PGP Key ID: 0x8512BA364AFE58C3 http://keyserver.pgp.com

Forwarded conversation Subject: Re: [cf-php-apache-buildpack] Invalid JSON in VCAP_SERVICES

environment variable (#5)

From: Daniel Mikusa notifications@github.com Date: Tue, Nov 26, 2013 at 1:08 PM To: dmikusa-pivotal/cf-php-apache-buildpack < cf-php-apache-buildpack@noreply.github.com> Cc: Nicholas Henry nshenry03@gmail.com

This is a regression with the build pack's build of the latest version of HTTPD, 2.2.26. With this version I upgraded mod_fcgid to 2.3.9, but I forgot to the patch I use to enable support long environment variable with mod_fcgid. Normally mod_fcgid limits this to 128 characters, I've extended it to 2048 since VCAP_SERVICES can hold a ton of stuff.

This shouldn't be a problem in the older binaries for HTTPD 2.2.x or 2.4.x, so the workaround here is to downgrade or upgrade to 2.4. You can do that by setting a specific HTTPD_VERSION in your options.json.

I've also rebuilt 2.2.26 & mod_fcgid with the patch I mentioned. So if you "cf push", you should see it download HTTPD 2.2.26 again and hopefully that will resolve the issue.

— Reply to this email directly or view it on GitHubhttps://github.com/dmikusa-pivotal/cf-php-apache-buildpack/issues/5#issuecomment-29329106 .


From: Daniel Mikusa notifications@github.com Date: Tue, Nov 26, 2013 at 1:22 PM To: dmikusa-pivotal/cf-php-apache-buildpack < cf-php-apache-buildpack@noreply.github.com> Cc: Nicholas Henry nshenry03@gmail.com

If you just tried this in the last few minutes, please retry. I apologize but my dropbox upload hung so the uploaded binary never made it out. The uploaded binaries should be available now.


From: Daniel Mikusa notifications@github.com Date: Tue, Nov 26, 2013 at 1:40 PM To: dmikusa-pivotal/cf-php-apache-buildpack < cf-php-apache-buildpack@noreply.github.com> Cc: Nicholas Henry nshenry03@gmail.com

Tested and this should be fixed now. If you still see the problem, do a "cf delete" and "cf push". This will clear any files out that might be cached on the server. If it still occurs, reopen this ticket.


From: Daniel Mikusa notifications@github.com Date: Tue, Nov 26, 2013 at 1:40 PM To: dmikusa-pivotal/cf-php-apache-buildpack < cf-php-apache-buildpack@noreply.github.com> Cc: Nicholas Henry nshenry03@gmail.com

Closed #5https://github.com/dmikusa-pivotal/cf-php-apache-buildpack/issues/5 .