Issam Posted November 8, 2014 Share Posted November 8, 2014 Hi, I would like to ask if someone knows a trick to know if the script is running on a shared hosting or a vps or a dedicated server. Regards Quote Link to comment https://forums.phpfreaks.com/topic/292350-detect-hsoting-type-trick-shared-or-vps/ Share on other sites More sharing options...
requinix Posted November 8, 2014 Share Posted November 8, 2014 (edited) If they didn't tell you it's dedicated hosting, it's shared. [edit] Check __FILE__ or __DIR__: if they have your username in it, like /home/username, then it's shared. If you have virtually no control over the server, it's shared. Edited November 8, 2014 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/292350-detect-hsoting-type-trick-shared-or-vps/#findComment-1496067 Share on other sites More sharing options...
Issam Posted November 8, 2014 Author Share Posted November 8, 2014 Hi, again I would like to make an installer that check if it is a vps or a shared not for my own but for people using the script. Some instructions and configuration have to be specific to shared hosting while an other specification for a vps or even a dedicated server, even if dedicated servers are too few. Regards Quote Link to comment https://forums.phpfreaks.com/topic/292350-detect-hsoting-type-trick-shared-or-vps/#findComment-1496069 Share on other sites More sharing options...
kicken Posted November 8, 2014 Share Posted November 8, 2014 There's no reliable way to determine what kind of hosting they are using. They might have a dedicated server and have full control but if they are using something like cpanel it'd probably look like shared hosting from your script's point of view. So, just ask them what kind of hosting they have and then show whatever instructions apply for their selected answer. Quote Link to comment https://forums.phpfreaks.com/topic/292350-detect-hsoting-type-trick-shared-or-vps/#findComment-1496072 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.