{"id":16380563,"url":"https://github.com/edyan/docker-xhgui","last_synced_at":"2026-04-01T20:45:31.607Z","repository":{"id":100586193,"uuid":"64776211","full_name":"edyan/docker-xhgui","owner":"edyan","description":"An xhgui (with nginx, mongodb and php) container for profiling PHP Applications.","archived":false,"fork":false,"pushed_at":"2020-10-03T20:36:14.000Z","size":57,"stargazers_count":28,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-28T18:46:16.143Z","etag":null,"topics":["docker-image","php","profiler","xhgui"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/edyan/xhgui/","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-02T17:07:33.000Z","updated_at":"2025-05-21T07:08:10.000Z","dependencies_parsed_at":"2023-05-20T09:30:45.487Z","dependency_job_id":null,"html_url":"https://github.com/edyan/docker-xhgui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edyan/docker-xhgui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edyan%2Fdocker-xhgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edyan%2Fdocker-xhgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edyan%2Fdocker-xhgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edyan%2Fdocker-xhgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edyan","download_url":"https://codeload.github.com/edyan/docker-xhgui/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edyan%2Fdocker-xhgui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["docker-image","php","profiler","xhgui"],"created_at":"2024-10-11T03:51:46.407Z","updated_at":"2026-04-01T20:45:31.587Z","avatar_url":"https://github.com/edyan.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xhgui docker image\n[![Build Status](https://travis-ci.com/edyan/docker-xhgui.svg?branch=master)](https://travis-ci.com/edyan/docker-xhgui)\n[![Docker Pulls](https://img.shields.io/docker/pulls/edyan/xhgui.svg)](https://hub.docker.com/r/edyan/xhgui/)\n\n\nDocker Hub: https://hub.docker.com/r/edyan/xhgui\n\nDocker containers that runs [xhgui](https://github.com/perftools/xhgui) (which needs mongodb and PHP).\n\nIt's based on :\n* [edyan/php:5.6](https://github.com/edyan/docker-php/tree/master/5.6) image (jessie stable).\n* or [edyan/php:7.2](https://github.com/edyan/docker-php/tree/master/7.2) image (Ubuntu 18.04).\n* or [edyan/php:7.4](https://github.com/edyan/docker-php/tree/master/7.4) image (Ubuntu 20.04).\nUse that one as a preview version, xhgui is not officially compatible with PHP \u003e 7.3\n\nIt's made for development purposes. You need to find the right version for your project.\nUse 5.6 for PHP 5.6 projects and 7.2 / 7.4 for PHP 7.x projects. Just make sure you have the\n`mongodb` extension enabled on your main PHP container.\n\nTo use it in an integrated environment, try [Stakkr](https://github.com/stakkr-org/stakkr)\n\n\n## Example\n\nTo make it work, you need to link it to an existing PHP environment. Example via `docker-compose.yml` :\n\nThe Docker Compose configuration is different for Compose versions 2 and 3:\n\n```yaml\nversion: '2'\nservices:\n  xhgui:\n    image: edyan/xhgui:php7.2\n    # I need to access xhgui\n    ports:\n      - \"9000:80\"\n  php:\n    hostname: php\n    command: /usr/bin/php -S 0.0.0.0:80 -t /var/www\n    image: edyan/php:7.2 # That image contains mongodb extension from PECL\n    # To have xhgui sources mount xhgui's volumes\n    volumes_from: [xhgui]\n    ports:\n      - \"8000:80\"\n    volumes:\n      - \"./src:/var/www\"\n```\n\nThe `volumes_from` is no longer supported in the Docker Compose version 3 syntax. We have to define a volume for *xhgui* in the global section of the config file and reference it in each of the services:\n\n```yaml\nversion: '3'\n\nvolumes:\n  xhgui:\n\nservices:\n  xhgui:\n    image: edyan/xhgui:php7.2\n    # I need to access xhgui\n    ports:\n      - \"9000:80\"\n    volumes:\n      - xhgui:/usr/local/src\n  php:\n    hostname: php\n    command: /usr/bin/php -S 0.0.0.0:80 -t /var/www\n    image: edyan/php:7.2 # That image contains mongodb extension from PECL\n    # To have the new mounted volumes as well as the default volumes of xhgui (its source code)\n    ports:\n      - \"8000:80\"\n    volumes:\n      - ./src:/var/www\n      - xhgui:/usr/local/src\n```\n\nYou need to set an environment variable to define the right mongodb server\nand then include the prepared profiler to your file, for example `src/index.php`:\n```php\n\u003c?php\n\n// Call the profiler\nputenv('XHGUI_MONGO_HOST=mongodb://xhgui:27017');\nrequire_once('/usr/local/src/xhgui/external/header.php');\n\n// Run your code\nfunction test_xhgui()\n{\n    $data = [];\n    for ($i = 0; $i \u003c 5000; $i++) {\n        $data[] = $i * $i;\n        sort($data);\n    }\n}\n\ntest_xhgui();\n\n```\n\nFinally, launch the environment with : `docker-compose up --force-recreate`.\nThen call _http://localhost:8000/index.php_ in your browser and  get reports\nfrom _http://localhost:9000_.\n\n\n## Environment variables\n* `XHGUI_MONGO_HOST` default to `mongodb://127.0.0.1:27017`, used in XHGui config file.\n* `MONGO_PORT` default to 27017\n* `PHP_WEBSERVER_PORT` default to 80\n\n\n## Quick Test\nA `docker-compose` file is available to do some tests:\n```bash\n$ mkdir src\n$ echo '\u003c?php putenv(\"XHGUI_MONGO_HOST=mongodb://xhgui\"); require_once(\"/usr/local/src/xhgui/external/header.php\"); $a=[]; for($i=0; $i\u003c10000; $i++){ $a[]=$i; } sort($a); echo \"Done\";' \u003e src/index.php\n$ docker-compose -f docker-compose.sample.yml up --force-recreate -d\n```\n\nNow open http://localhost:8000/index.php to read the new file created.\nThen http://localhost:9000 to see the report.\n\nClean :\n```bash\n$ docker-compose -f docker-compose.sample.yml down\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedyan%2Fdocker-xhgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedyan%2Fdocker-xhgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedyan%2Fdocker-xhgui/lists"}