WinCache 統計スクリプト
WinCache のインストールパッケージには
wincache.php
という PHP スクリプトが含まれています。
これを使えば、キャッシュ情報や統計情報を取得することができます。
WinCache 拡張モジュールのインストールを Microsoft Web Platform Installer
で行った場合は、このスクリプトの場所は
%SystemDrive%\Program Files\IIS\Windows Cache for PHP\
となります。64 ビット版の Windows サーバー OS の場合は
%SystemDrive%\Program Files (x86)\IIS\Windows Cache for PHP
です。拡張モジュールを手動でインストールした場合は、
インストールパッケージを展開した場所と同じフォルダに
wincache.php
があります。
wincache.php
を使うには、
ウェブサイトのルートフォルダあるいはその配下のサブフォルダにこのファイルをコピーします。
スクリプトを保護するために、このファイルをテキストエディタで開いて、定数
USERNAME と PASSWORD
の値を変更しましょう。サーバー上で何らかの IIS 認証を有効にしている場合は、
コメントに書かれている指示に従います。
例1 wincache.php
用の認証設定
<?php/** * ======================== CONFIGURATION SETTINGS ============================== * If you do not want to use authentication for this page, set USE_AUTHENTICATION to 0. * If you use authentication then replace the default password. */define('USE_AUTHENTICATION', 1);define('USERNAME', 'wincache');define('PASSWORD', 'wincache');/** * The Basic PHP authentication will work only when IIS is configured to support * Anonymous Authentication' and nothing else. If IIS is configured to support/use * any other kind of authentication like Basic/Negotiate/Digest etc, this will not work. * In that case use the array below to define the names of users in your * domain/network/workgroup which you want to grant access to. */$user_allowed = array('DOMAIN\user1', 'DOMAIN\user2', 'DOMAIN\user3');/** * If the array contains string 'all', then all the users authenticated by IIS * will have access to the page. Uncomment the below line and comment above line * to grant access to all users who gets authenticated by IIS. *//* $user_allowed = array('all'); *//** ===================== END OF CONFIGURATION SETTINGS ========================== */?>
注意:
組み込みの認証あるいはサーバーの認証機構を使って、常に
wincache.php
スクリプトを保護するようにしましょう。 このスクリプトを保護せずに放置しておくと、アプリケーションやウェブサーバーを危険にさらすことになってしまいます。