{"id":13827122,"url":"https://github.com/longbill/node-phpfpm","last_synced_at":"2026-01-19T23:39:15.364Z","repository":{"id":57168290,"uuid":"48723741","full_name":"longbill/node-phpfpm","owner":"longbill","description":"node.js run php scripts via phpfpm","archived":false,"fork":false,"pushed_at":"2024-06-03T14:14:54.000Z","size":14,"stargazers_count":52,"open_issues_count":2,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-28T19:59:13.067Z","etag":null,"topics":["nodejs","php","php-fpm"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/longbill.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":"2015-12-29T02:50:00.000Z","updated_at":"2024-06-03T14:14:58.000Z","dependencies_parsed_at":"2024-06-18T22:35:21.203Z","dependency_job_id":"4151cb8c-c786-4540-a574-21d6d4723d36","html_url":"https://github.com/longbill/node-phpfpm","commit_stats":{"total_commits":12,"total_committers":3,"mean_commits":4.0,"dds":0.25,"last_synced_commit":"50c7d6b034b9e37099a3a2d0ec53b5d2e1cf1d0e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/longbill/node-phpfpm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbill%2Fnode-phpfpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbill%2Fnode-phpfpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbill%2Fnode-phpfpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbill%2Fnode-phpfpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/longbill","download_url":"https://codeload.github.com/longbill/node-phpfpm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/longbill%2Fnode-phpfpm/sbom","scorecard":{"id":598015,"data":{"date":"2025-08-11","repo":{"name":"github.com/longbill/node-phpfpm","commit":"9eb05960020efb5da831af3d87d88234f7ddc621"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":2,"reason":"Found 3/12 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T23:39:54.786Z","repository_id":57168290,"created_at":"2025-08-20T23:39:54.786Z","updated_at":"2025-08-20T23:39:54.786Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28590656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"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":["nodejs","php","php-fpm"],"created_at":"2024-08-04T09:01:50.555Z","updated_at":"2026-01-19T23:39:15.342Z","avatar_url":"https://github.com/longbill.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# node-phpfpm\nnode.js run php scripts via phpfpm\n\n[![NPM](https://nodei.co/npm/node-phpfpm.png?downloads=true\u0026stars=true)](https://www.npmjs.com/package/node-phpfpm)\n\n```\nnpm install node-phpfpm\n```\n\n## Usage\n\n```js\nvar PHPFPM = require('node-phpfpm');\n\nvar phpfpm = new PHPFPM(\n{\n\thost: '127.0.0.1',\n\tport: 9000,\n\tdocumentRoot: __dirname\n});\n\nphpfpm.run('test.php', function(err, output, phpErrors)\n{\n\tif (err == 99) console.error('PHPFPM server error');\n\tconsole.log(output);\n\tif (phpErrors) console.error(phpErrors);\n});\n```\n\n## Configuration\n\n```js\nvar phpfpm = new PHPFPM(configObject);\n```\n\nconfigObject may have the following keys:\n\n\n* `documentRoot` optional [string] the document root folder of PHP scripts. must end with /\n* `host` optional [string] the ip or host name of php-fpm server (default: 127.0.0.1)\n* `port` optional [int] the port of php-fpm server ( default: 9000 )\n* `sockFile` optional [string] use the unix sock file instead of 127.0.0.1:9000 to connect php-fpm server \n\n\n## APIs\n\n### run(options, callback)\n\navailable keys in options object\n\n\n* `uri` [string] path to your phpfile\n* `url` \u003coptinal\u003e [string] alias of uri\n* `method` optional [string] GET or POST (default: GET)\n* `form` optional [object] form_data that will be sent with content-type: application/x-www-form-urlencoded \n* `json` optional [object] json data that will be sent with content-type: application/json \n* `body` optional [string] raw post body data\n* `contentType` optional [string] the content-type header\n* `contentLength` optional [string] the content-length header\n\n\nif you send a string as `options`, it will be converted to:\n\n```js\n{ uri: \"the string value\", method: 'GET' }\n```\n\ncallback\n\n```js\nfunction(err, output, phpErrors)\n{\n\t// if err === 99, means php-fpm error \n\t// it may be lost php-fpm connection or too many connections\n\t// otherwise it will always equal to false\n\t\n\t// output is the stdout of php scripts\n\t\n\t// phpErrors is the php errors detail string\n\t// php will output some errors, but that does not mean the request fails\n\t// if you turn on display_errors in your php.ini, the phpErrors content will also be found in the output string\n\t\n\tconsole.log(err, output, phpErrors); \n}\n```\n\n## Demo\n\nSimple php request with no parameters\n```js\nphpfpm.run('test1.php', function(err, output, phpErrors)\n{\n\tconsole.log(err, output, phpErrors);\n});\n```\n\nSend data via GET method\n```js\nphpfpm.run('test.php?a=b\u0026c=d\u0026e[0]=1\u0026e[1]=2', function(err, output, phpErrors)\n{\n\tconsole.log(err, output, phpErrors);\n});\n```\n```php\n\u003c?php\nprint_r($_GET);\n// Array\n// (\n//     [a] =\u003e b\n//     [c] =\u003e d\n//     [e] =\u003e Array\n//         (\n//             [0] =\u003e 1\n//             [1] =\u003e 2\n//         )\n// )\n?\u003e\n```\n\nSend form data via POST method\n```js\nphpfpm.run(\n{\n\turi: 'test.php',\n\tform: \n\t{\n\t\ta:'a',\n\t\tb:'b'\n\t}\n}, function(err, output, phpErrors)\n{\n\tconsole.log(err, output, phpErrors);\n});\n```\n```php\n\u003c?php\nprint_r($_POST);\n// Array\n// (\n//     [a] =\u003e a\n//     [b] =\u003e b\n// )\n?\u003e\n```\n\nSend json data with POST method\n```js\nphpfpm.run(\n{\n\turi: 'test.php',\n\tjson: \n\t{\n\t\ta:'a',\n\t\tb:'b'\n\t}\n}, function(err, output, phpErrors)\n{\n\tconsole.log(err, output, phpErrors);\n});\n```\n```php\n\u003c?php\necho file_get_contents('php://input');\n// {\"a\":\"a\",\"b\":\"b\"}\n?\u003e\n```\n\nSend form data with GET method\n```js\nphpfpm.run(\n{\n\turi: 'test2.php',\n\tmethod: 'GET',\n\tform: \n\t{\n\t\ta:'a',\n\t\tb:'b'\n\t}\n}, function(err, output, phpErrors)\n{\n\tconsole.log(err, output, phpErrors);\n});\n```\n```php\n\u003c?php\nprint_r($_GET);\n// Array\n// (\n//     [a] =\u003e a\n//     [b] =\u003e b\n// )\n?\u003e\n```\n\nSend form data and query string with GET method\n```js\nphpfpm.run(\n{\n\turi: 'test2.php?c=cc',\n\tmethod: 'GET',\n\tform: \n\t{\n\t\ta:'a',\n\t\tb:'b'\n\t}\n}, function(err, output, phpErrors)\n{\n\tconsole.log(err, output, phpErrors);\n});\n```\n```php\n\u003c?php\nprint_r($_GET);\n// Array\n// (\n//     [c] =\u003e cc\n//     [a] =\u003e a\n//     [b] =\u003e b\n// )\n?\u003e\n```\n\nSend raw body data with POST method\n```js\nphpfpm.run(\n{\n\turi: 'test5.php',\n\tbody: 'abc123'\n}, function(err, output, phpErrors)\n{\n\tconsole.log(err, output, phpErrors);\n});\n```\n```php\n\u003c?php\necho file_get_contents('php://input');\n// abc123\n?\u003e\n```\n\n## License\nMIT\n\n## Thanks\n\nThis project is based on the great work of `node-fastcgi-client` written by LastLeaf. [LastLeaf/node-fastcgi-client](https://github.com/LastLeaf/node-fastcgi-client)\n\n## Links\n\n[How to execute PHP scripts with Node.JS](http://jszen.com/how-to-execute-php-scripts-with-nodejs.8.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongbill%2Fnode-phpfpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flongbill%2Fnode-phpfpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flongbill%2Fnode-phpfpm/lists"}