《PHP教程:php檢測apache mod_rewrite模塊是否安裝的方法》要點:
本文介紹了PHP教程:php檢測apache mod_rewrite模塊是否安裝的方法,希望對您有用。如果有疑問,可以聯系我們。
相關主題:apache配置
PHP學習本文實例講述了php檢測apache mod_rewrite模塊是否安裝的辦法.分享給大家供大家參考.具體實現辦法如下:
PHP學習
/**
* @title Check if Apache's mod_rewrite is installed.
*
* @author Pierre-Henry Soria <ph7software@gmail.com>
* @copyright (c) 2013, Pierre-Henry Soria. All Rights Reserved.
* @return boolean
*/
function isRewriteMod()
{
if (function_exists('apache_get_modules'))
{
$aMods = apache_get_modules();
$bIsRewrite = in_array('mod_rewrite', $aMods);
}
else
{
$bIsRewrite = (strtolower(getenv('HTTP_MOD_REWRITE')) == 'on');
}
return $bIsRewrite;
}
PHP學習使用辦法:
PHP學習
if (!isRewriteMod()) exit('Please install Apache mod_rewrite module.');
PHP學習希望本文所述對大家的php程序設計有所贊助.
《PHP教程:php檢測apache mod_rewrite模塊是否安裝的方法》是否對您有啟發,歡迎查看更多與《PHP教程:php檢測apache mod_rewrite模塊是否安裝的方法》相關教程,學精學透。維易PHP學院為您提供精彩教程。