0

I am developing chat application using php and ajax . later I found get messages by ajax after X seconds doesn't efficient. I want to develop it by php socket . I opened the local server socket by example :

php -f server.php 

My question is How can I open remote server socket after uploading files to the host, need to write commands ?

moussa elenany
  • 61
  • 1
  • 1
  • 6

1 Answers1

0

You can use same command in the remote server too if you have shell access to remote server. Otherwise you have to run it using its URL. If you have shell access and If you want it to run in background of the server just add && at the end like below in the terminal,

php -f server.php &&

But this will not run again automatically after server reboot or after script stopped. If you want to do so, you need to use daemon process for this. You can find information about daemon setup here

Run php script as daemon process

LahiruTM
  • 638
  • 4
  • 16