{"id":42259276,"url":"https://github.com/cloudfoundry-samples/cf-ex-phppgadmin","last_synced_at":"2026-01-27T05:38:24.779Z","repository":{"id":29997332,"uuid":"33544821","full_name":"cloudfoundry-samples/cf-ex-phppgadmin","owner":"cloudfoundry-samples","description":"CloudFoundry PHP example application: phpPgAdmin","archived":false,"fork":false,"pushed_at":"2020-03-03T17:23:19.000Z","size":13,"stargazers_count":9,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-03-12T08:24:50.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudfoundry-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-07T13:30:09.000Z","updated_at":"2021-07-01T03:17:05.000Z","dependencies_parsed_at":"2022-09-01T09:40:46.975Z","dependency_job_id":null,"html_url":"https://github.com/cloudfoundry-samples/cf-ex-phppgadmin","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/cloudfoundry-samples/cf-ex-phppgadmin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-samples%2Fcf-ex-phppgadmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-samples%2Fcf-ex-phppgadmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-samples%2Fcf-ex-phppgadmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-samples%2Fcf-ex-phppgadmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudfoundry-samples","download_url":"https://codeload.github.com/cloudfoundry-samples/cf-ex-phppgadmin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudfoundry-samples%2Fcf-ex-phppgadmin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28804371,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T03:44:14.111Z","status":"ssl_error","status_checked_at":"2026-01-27T03:43:33.507Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-27T05:38:24.715Z","updated_at":"2026-01-27T05:38:24.772Z","avatar_url":"https://github.com/cloudfoundry-samples.png","language":null,"readme":"# CloudFoundry PHP Example Application:  PHPPgAdmin\n\nThis is an example application which can be run on CloudFoundry using the [PHP Buildpack].\n\nThis is an out-of-the-box implementation of PHPPgAdmin.  It's an example how common PHP applications can easily be run on CloudFoundry.\n\n## Usage\n\n1. Download the latest phpPgAdmin from [the project site](http://phppgadmin.sourceforge.net/doku.php?id=download).\n\n1. Extract all of the files from phpPgAdmin to the `htdocs` directory. For example: `tar -zx --strip-components=1 -C htdocs/ -f ~/Downloads/phpPgAdmin-5.6.0.tar.bz2`. When done, you should have an `htdocs` directory that looks like this...\n\n    ```bash\n    $ ls -l htdocs/\n    total 1616\n    -rw-r--r--@  1 dmikusa  staff   3141 Nov 12  2018 CREDITS\n    -rw-r--r--@  1 dmikusa  staff   6324 Nov 12  2018 DEVELOPERS\n    -rw-r--r--@  1 dmikusa  staff   8603 Nov 12  2018 FAQ\n    -rw-r--r--@  1 dmikusa  staff  27737 Nov 12  2018 HISTORY\n    -rw-r--r--@  1 dmikusa  staff   2890 Nov 12  2018 INSTALL\n    -rw-r--r--@  1 dmikusa  staff    581 Nov 12  2018 LICENSE\n    -rw-r--r--@  1 dmikusa  staff   5719 Nov 12  2018 TODO\n    -rw-r--r--@  1 dmikusa  staff   2414 Nov 12  2018 TRANSLATORS\n    -rw-r--r--@  1 dmikusa  staff  28907 Nov 12  2018 admin.php\n    -rw-r--r--@  1 dmikusa  staff  16000 Nov 12  2018 aggregates.php\n    -rw-r--r--@  1 dmikusa  staff   2492 Nov 12  2018 ajax-ac-insert.php\n    ...\n    ```\n\n1. If you don't have one already, create a Postgres service.  With Pivotal Web Services, the following command will create a free Postgres database through [ElephantSQL].\n\n    ```bash\n    cf create-service elephantsql turtle pgsql\n    ```\n\n    If you do not name your service `pgsql` then you need to edit `manifest.yml` and change the service name to match the name of your service.\n\n1. Edit `htdocs/conf/config.inc.php`. Add this block of code at the top of the file. Then delete the block that starts with the comment `An example server.` and runs just up to the block that starts with `Groups definition`. This is deleting the sample configuration.\n\n    ```php\n        /*\n        * Read PGSQL service properties from 'VCAP_SERVICES'\n        */\n        $service_blob = json_decode(getenv('VCAP_SERVICES'), true);\n        $pgsql_services = array();\n        foreach($service_blob as $service_provider =\u003e $service_list) {\n            // looks for 'elephantsql' service\n            if ($service_provider === 'elephantsql') {\n                foreach($service_list as $pgsql_service) {\n                    $pgsql_services[] = $pgsql_service;\n                }\n                continue;\n            }\n            foreach ($service_list as $some_service) {\n                // looks for tags of 'postgresql'\n                if (in_array('postgresql', $some_service['tags'], true)) {\n                    $pgsql_services[] = $some_service;\n                    continue;\n                }\n                // look for a service where the name includes 'pgsql'\n                if (strpos($some_service['name'], 'pgsql') !== false) {\n                    $pgsql_services[] = $some_service;\n                }\n            }\n        }\n\n        /*\n        * Servers configuration\n        */\n        for ($i = 0; $i \u003c count($pgsql_services); $i++) {\n            // parse individual config from uri\n            preg_match('/^(?:postgres|postgresql)\\:\\/\\/(.*):(.*)@(.*):(.*)\\/(.*)$/',\n                    $pgsql_services[$i]['credentials']['uri'], $db);\n            if (count($db) == 6) {\n                // configure server\n                $conf['servers'][$i]['desc'] = $pgsql_services[$i]['name'];\n                $conf['servers'][$i]['host'] = $db[3];\n                $conf['servers'][$i]['port'] = $db[4];\n                $conf['servers'][$i]['sslmode'] = 'allow';\n                $conf['servers'][$i]['defaultdb'] = $db[5];\n                // Specify the path to the database dump utilities for this server.\n                // You can set these to '' if no dumper is available.\n                $conf['servers'][$i]['pg_dump_path'] = '/usr/bin/pg_dump';\n                $conf['servers'][$i]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';\n            }\n        }\n    ```\n\n1. Delete `htdocs/composer.json`. It is not set up correctly and it is not being used to install anything. If you do not, it will cause Composer to complain and fail.\n\n1. Push it to CloudFoundry.\n\n    ```bash\n    cf push\n    ```\n\n    Access your application URL in the browser.  Login with the credentials for your service.  If you need to find these, just run this command and look for the VCAP_SERVICES environment variable under the `System Provided` section.\n\n    ```bash\n    cf env \u003capp-name\u003e\n    ```\n\n### How It Works\n\nWhen you push the application here's what happens.\n\n1. The server downloads the [PHP Build Pack] and runs it.  This installs HTTPD and PHP.\n1. At this point, the build pack is done and CF runs our droplet.\n1. The code we added to `config.inc.php` will read service information from the `VCAP_SERVICES` environment variable and automatically configure phpPgAdmin to use the bound services.\n\n[PHP Buildpack]:https://github.com/cloudfoundry/php-buildpack\n[ElephantSQL]:http://www.elephantsql.com/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry-samples%2Fcf-ex-phppgadmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudfoundry-samples%2Fcf-ex-phppgadmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudfoundry-samples%2Fcf-ex-phppgadmin/lists"}