0

Hello I am trying to host my website on franceDNS which only has php support, so I would like to know how can I start my node.js server from php? If at all possible. If it is just better to change the hosting service then let me know to.

1 Answer 1

2

In theory, you could use shell_exec or similar to spawn an application written in Node.js from PHP, then use cURL to make an HTTP request to that application and relay the response to the client.

However, this would be immensely inefficient, depends on features blocked by cheap hosting, would require rewriting the application to listen on different ports so you wouldn't get clashes from two different requests to PHP scripts at around the same time, and would lose the ability to handle anything that requires data to be stored in-memory across requests.


In short: Find suitable hosting. Don't try to hack this.

Sign up to request clarification or add additional context in comments.

1 Comment

Great thank you for the detailed info, I think I will switch I just wanted to make sure that it would not be good to try to hack this thing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.