longbill / node-phpfpm

node.js run php scripts via phpfpm
MIT License
52 stars 14 forks source link

PHPFPM server error #8

Open GreXLin85 opened 4 years ago

GreXLin85 commented 4 years ago

I'm trying to execute this code. ` var PHPFPM = require('node-phpfpm');

var phpfpm = new PHPFPM( { host: '127.0.0.1', port: 9000, documentRoot: "." });

phpfpm.run('index.php', function(err, output, phpErrors) { if (err == 99) console.error('PHPFPM server error'); console.log(output); if (phpErrors) console.error(phpErrors); }); `

But i get this error;

PHPFPM server error Error: Cannot send request to server. Error: Cannot send request to server.

How can i solve this

nowaysgit commented 2 years ago

I'm trying to execute this code. ` var PHPFPM = require('node-phpfpm');

var phpfpm = new PHPFPM( { host: '127.0.0.1', port: 9000, documentRoot: "." });

phpfpm.run('index.php', function(err, output, phpErrors) { if (err == 99) console.error('PHPFPM server error'); console.log(output); if (phpErrors) console.error(phpErrors); }); `

But i get this error;

PHPFPM server error Error: Cannot send request to server. Error: Cannot send request to server.

How can i solve this

Do you fix it?

Arc8ne commented 5 months ago

I am also running into this issue, I was unable to find a fix for it unfortunately.

longbill commented 5 months ago

I am also running into this issue, I was unable to find a fix for it unfortunately.

you can try to fix it by changing the index.js source code. there are only a few lines of code.

I am the author of this project, but I did not use php for a really long time.

If you have interest in fixing this issue, please make a merge request.