{"id":20163399,"url":"https://github.com/sjinks/php-chuid","last_synced_at":"2025-04-10T00:36:31.984Z","repository":{"id":20926370,"uuid":"24214470","full_name":"sjinks/php-chuid","owner":"sjinks","description":"PHP extension that allows one to run PHP CLI/CGI/FastCGI binary as the owner of the DocumentRoot","archived":false,"fork":false,"pushed_at":"2025-01-11T02:21:55.000Z","size":538,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T02:22:09.933Z","etag":null,"topics":["php","php-extension","zend-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/sjinks.png","metadata":{"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]},"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-19T03:17:30.000Z","updated_at":"2025-01-11T02:21:57.000Z","dependencies_parsed_at":"2023-02-17T18:55:15.586Z","dependency_job_id":"c299928e-8d58-44a9-ad0a-8b2cef1a527b","html_url":"https://github.com/sjinks/php-chuid","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-chuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-chuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-chuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fphp-chuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/php-chuid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137996,"owners_count":21053773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["php","php-extension","zend-extension"],"created_at":"2024-11-14T00:29:29.203Z","updated_at":"2025-04-10T00:36:31.964Z","avatar_url":"https://github.com/sjinks.png","language":"PHP","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":[],"sub_categories":[],"readme":"# PHP CHUID\n\n[![Build and Test](https://github.com/sjinks/php-chuid/actions/workflows/test.yml/badge.svg)](https://github.com/sjinks/php-chuid/actions/workflows/test.yml)\n\nPHP CHUID (CHange User ID) is a PHP extension that allows one to run PHP CLI/CGI/FastCGI binary as the owner of the DocumentRoot by changing UID/GID upon request start and reverting to the original UID/GID when the request finishes.\n\nCHUID can be seen as an alternative to php-fpm: you won't need many worker processes if you have many users because CHUID dynamically changes process UID/GID, and therefore, it can reuse processes without having to spawn a new child for the new user.\n\nIt was tested with PHP 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, and 8.4 nightly.\n\n## Installation\n\nFirst, you will need to build the extension:\n\n```bash\nsudo apt-get install php8.3-dev libcap-dev build-essential autoconf\nphpize\n./configure\nmake\nsudo make install\n```\n\nThen you need to install it. There are two ways to do that: install CHUID as a PHP or Zend extension.\n\nPHP extension: add this line to your php.ini:\n\n```\nextension=chuid.so\n```\n\nZend extension: add something like this to your php.ini:\n\n```\nzend_extension=/path/to/zend/extension/dir/chuid.so\n```\n\n`/path/to/zend/extension/dir/` can be found by running `php-config --extension-dir`\n\n**WARNING:** For CHUID to work properly, php must be run as a `root` user. Note that PHP will **not** handle requests as `root` — all privileges are dropped\nduring `zend_activate` phase (this happens **before** the request is processed) and restored during `zend_post_deactivate` phase (**after** the request has been processed).\n\n[This picture](https://wiki.php.net/_media/internals/extensions_lifetime.png) better explains the extension lifetime.\n\nAll privileges are dropped during the `activate()` phase and restored during the `post_deactivate_func()` phase.\n\n## INI settings\n\n  * `chuid.enabled`: Whether CHUID should be enabled\n    * boolean, defaults to 1 if CHUID was compiled as an extension and 0 if it was compiled statically into PHP\n    * PHP_INI_SYSTEM\n  * `chuid.disable_posix_setuid_family`: disable  `posix_seteuid()`, `posix_setegid()`, `posix_setuid()` and `posix_setgid()` functions\n    * boolean, defaults to 1\n    * PHP_INI_SYSTEM\n  * `chuid.never_root`: forces the change to the `default_uid`/`default_gid` if the UID/GID computes to 0 (`root` user)\n    * boolean, defaults to 1\n    * PHP_INI_SYSTEM\n  * `chuid.cli_disable`: do not try to modify UIDs/GIDs when PHP SAPI is CLI\n    * boolean, defaults to 1\n    * PHP_INI_SYSTEM\n  * `chuid.no_set_gid`: do not change process GID\n    * boolean, defaults to 0\n    * PHP_INI_SYSTEM\n  * `chuid.default_uid`: the default UID, used when the module is unable to get the `DOCUMENT_ROOT` or when `chuid.never_root` is `true` and the UID of the `DOCUMENT_ROOT` is 0\n    * integer, defaults to 65534 (`nobody` in Debian based distros)\n    * PHP_INI_SYSTEM\n  * `chuid.default_gid`: the default GID, used when the module is unable to get the `DOCUMENT_ROOT` or when `chuid.never_root` is `true` and the GID of the `DOCUMENT_ROOT` is 0\n    * integer, defaults to 65534 (`nogroup` in Debian based distros)\n    * PHP_INI_SYSTEM\n  * `chuid.global_chroot`: if not empty, `chroot()` to this location before processing the request\n    * string, empty by default\n    * PHP_INI_SYSTEM\n  * `chuid.enable_per_request_chroot`: whether to enable per-request `chroot()`. Disabled when `chuid.global_chroot` is set\n    * boolean, defaults to 0\n    * PHP_INI_SYSTEM\n  * `chuid.chroot_to`: per-request chroot, used only when `chuid.enable_per_request_chroot` is enabled\n    * string, empty by default\n    * PHP_INI_SYSTEM | PHP_INI_PER_DIR\n  * `chuid.run_sapi_deactivate`: Whether to run SAPI deactivate function after calling SAPI activate to get per-directory settings\n    * boolean, defaults to 1\n    * PHP_INI_SYSTEM | PHP_INI_PER_DIR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fphp-chuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fphp-chuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fphp-chuid/lists"}