Mobile app version of vmapp.org
Login or Join
Alves908

: How can I run a background PHP script on a hosting account like godaddy? I need to run a PHP script 24x7 on the server I'll be hosting my website on (Probably Godaddy). The PHP script's

@Alves908

Posted in: #Cpanel #Cron #Godaddy #Php

I need to run a PHP script 24x7 on the server I'll be hosting my website on (Probably Godaddy). The PHP script's job is to open a socket and wait for incoming connections. Once a connection is established, it receives some data from 'Somewhere' and pushes it to a database. The data from this database will be constantly accessed by my index.php and will be used accordingly having some particular frequency.

The code is all ready and is working perfectly on my LAN using WAMP. But I am absolutely clueless on going about doing this in hosting accounts. I am guessing SSH, cron and cPanel is the way but no idea on how to do it and connect. Please elaborate the entire process and suggest some readings.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

Many hosting companies have in their terms and conditions bans on any background processes which just sit there waiting for connections, additionally they firewalls servers against incoming connections on ports not used as standard on the server for what they believe the server should be used for. As I recall GoDaddy has this restriction on all shared and semi-shared hosting services and only allows this on virtual servers or dedicated servers. To do what you are wanting to do you would need to have a virtual server or dedicated server hosting account which will give you a greater level of access to the server itself and will avoid the strict restrictions applied to shared servers.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme