EC-CUBE3のデバッグには、index_dev.phpを利用します。
index_dev.phpに自身の接続IPアドレス(123.123.123.123)を下記のように記述し、
http://EC-CUBE3のURL/index_dev.phpでアクセスします。
$allow = array( '127.0.0.1', 'fe80::1', '::1', '123.123.123.123', );
ところが、サーバ(Xサーバーで確認)によっては、下記メッセージが表示され、動作しない場合があります。
Youare not allowed to access this file. Check index_dev.php for more information.
そこで、index_dev.phpの37行目付近を下記のように変更して対応します。
if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !in_array(@$_SERVER['REMOTE_ADDR'], $allow) ) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); }
↓【変更】
$IP = '123.123.123.123'; if ($IP != $_SERVER["REMOTE_ADDR"]) { if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !in_array(@$_SERVER['REMOTE_ADDR'], $allow) ) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'.'<br />'.$_SERVER['REMOTE_ADDR']); } }
(1)IPアドレスの設定
↓自身の接続IPアドレス
$IP = ‘123.123.123.123‘;
(2).'<br />’.$_SERVER[‘REMOTE_ADDR’]
これは、必ずしも必要ではありません。
これを追加しておくと、IPアドレスが設定されていない場合や正しくない場合に、下記のように現在のIPアドレスが表示されるので便利です。
————————————-
Youare not allowed to access this file. Check index_dev.php for more information.
123.123.123.123
————————————-