Craig Hopson Posted October 9, 2012 Share Posted October 9, 2012 hi how can i check if the web server is apache, i have the crontab script which only works on apache servers so i would like something like if($_SERVER['server_software'] == 'apache'){// do something here} My server is apache yet if i echo "$_SERVER['server_software'];" it says its LiteSpeed which is based on apache Question:-How can i check if the web server is apache Link to comment Share on other sites More sharing options...
justsomeguy Posted October 9, 2012 Share Posted October 9, 2012 Use print_r to print the entire $_SERVER array so you can check it, any information you can use is in there. Link to comment Share on other sites More sharing options...
Ingolme Posted October 10, 2012 Share Posted October 10, 2012 Is there a particular reason you need to know? There might be other ways to solve your problem. Link to comment Share on other sites More sharing options...
es131245 Posted October 10, 2012 Share Posted October 10, 2012 $_SERVER[sERVER_SOFTWARE]you can use substr to get apache and to compare version too Link to comment Share on other sites More sharing options...
Craig Hopson Posted October 10, 2012 Author Share Posted October 10, 2012 Is there a particular reason you need to know? There might be other ways to solve your problem.Yes im using the crontab command which only works on apache severs Link to comment Share on other sites More sharing options...
Ingolme Posted October 10, 2012 Share Posted October 10, 2012 Are you thinking about linux servers? I'm looking up "crontab" and there's hardly a mention of apache. Link to comment Share on other sites More sharing options...
Craig Hopson Posted October 10, 2012 Author Share Posted October 10, 2012 Maybe be I am if so is there a way to detect linux server Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now