{"id":13839581,"url":"https://github.com/AntSwordProject/ant_php_extension","last_synced_at":"2025-07-11T05:33:25.487Z","repository":{"id":47204481,"uuid":"177760503","full_name":"AntSwordProject/ant_php_extension","owner":"AntSwordProject","description":"PHP 扩展, 用于 PHP-FPM、FastCGI、LD_PRELOAD等模式下突破 disabled_functions","archived":false,"fork":false,"pushed_at":"2021-09-08T15:15:50.000Z","size":8,"stargazers_count":104,"open_issues_count":0,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-18T13:21:10.523Z","etag":null,"topics":["antsword","php","php-extension","php-fpm"],"latest_commit_sha":null,"homepage":"","language":"C","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/AntSwordProject.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":"2019-03-26T09:55:54.000Z","updated_at":"2024-05-16T10:23:34.000Z","dependencies_parsed_at":"2022-09-06T03:32:27.158Z","dependency_job_id":null,"html_url":"https://github.com/AntSwordProject/ant_php_extension","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntSwordProject%2Fant_php_extension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntSwordProject%2Fant_php_extension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntSwordProject%2Fant_php_extension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AntSwordProject%2Fant_php_extension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AntSwordProject","download_url":"https://codeload.github.com/AntSwordProject/ant_php_extension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225699896,"owners_count":17510431,"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":["antsword","php","php-extension","php-fpm"],"created_at":"2024-08-04T17:00:30.680Z","updated_at":"2024-11-21T08:31:14.179Z","avatar_url":"https://github.com/AntSwordProject.png","language":"C","readme":"# Ant PHP Extension\n\nPHP 扩展, 用于 PHP-FPM、FastCGI 模式下突破 `disabled_functions`。\n\n### 原理\n\n加载该扩展后, 可使用函数 `antsystem` 执行命令(相当于 `system` 别名)\n\neg:\n\n```php\n\u003c?php antsystem('whoami'); ?\u003e\n```\n\n### php.ini 样例\n\n```\ndisable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,exec,shell_exec,popen,proc_open,passthru,symlink,link,syslog,imap_open,ld,mail,system\n```\n\n### 编译\n\n```bash\n$ cd ant_php_extension/\n$ phpize \u0026\u0026 ./configure \u0026\u0026 make\n```\n\n编译完成后当前目录下的 `ant.so` 则是需要的文件\n\n### 安装到本机\n\n```bash\n$ cd ant_php_extension/\n$ phpize \u0026\u0026 ./configure \u0026\u0026 make\n$ make install\n\n# 测试\n$ php -d enable_dl=On ant.php\n```\n\n### 相关链接\n\n* [AntSword](github.com/antswordproject/antsword)\n","funding_links":[],"categories":["C","C (286)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAntSwordProject%2Fant_php_extension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAntSwordProject%2Fant_php_extension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAntSwordProject%2Fant_php_extension/lists"}