Home > Backend Development > PHP Tutorial > PHP如何判断服务器是APACHE还是IIS

PHP如何判断服务器是APACHE还是IIS

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 14:03:16
Original
1598 people have browsed it

PHP如何判断服务器是APACHE还是IIS


回复讨论(解决方案)

if(isset($_SERVER['HTTP_X_REWRITE_URL'])) // IISelse if(isset($_SERVER['ORIG_PATH_INFO']))  // IIS 5.0 CGI//以上两行代码,在yii里的,原样复过来的。//只作参考
Copy after login

自己开一下phpinfo就能看到相关函数

_SERVER["SERVER_SOFTWARE"]
Apache/2.4.2 (Win64) PHP/5.4.3

PHP code?123456if(isset($_SERVER['HTTP_X_REWRITE_URL'])) // IIS else if(isset($_SERVER['ORIG_PATH_INFO']))  // IIS 5.0 CGI //以上两行代码,在yii里的,原样复过来的。//只作参考

yang sir也在搞Yii?

引用 1 楼 yangball 的回复:PHP code?123456if(isset($_SERVER['HTTP_X_REWRITE_URL'])) // IIS else if(isset($_SERVER['ORIG_PATH_INFO']))  // IIS 5.0 CGI //以上两行代码,在yii里的,原样复过来的。//只作参考

yang sir也在搞……
项目就在用yii

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template