Home > OS >  Heroku | How to start a php server file?
Heroku | How to start a php server file?

Time:07-30

It's the first time I'm using heroku.

I was able to get my application on Heroku but there is still an issue. My application uses Ratchet websocket so, for my app to work fully I need to run: php server.php from my bin folder. Doing this locally is fine but I'm not sure how I would do this on heroku. I've tried to run it through Heroku bash and a few other ways but to no avail.

CodePudding user response:

For this task, you may find a Procfile useful.

A Procfile gives commands to your Dynos to run whenever your app is deployed. It is stored on the root of your project folder as a plain text file.

For your case, just create a file with the name Procfile in the root of your folder and its contents should be:

Worker: php server.php

You can also read more information about the Procfile if you wish

  • Related