وعليكم السلام اخي ممكن تجرب هذه الطريقة
اعمل ملف مثلاً باسم ip.php يحتوي التالي
<?php

// Checks the current date and time
$dateTime = date('Y/m/d G:i:s');

// Loads the writable text file and await instruction from fwrite command
$fp = fopen('ip-log.txt', 'r+');

while (!feof($fp))
{
$buffer = fgets($fp);
// Scan for any previous logs of the IP
// If scan determines that the user is a logged IP address, overwrite existing log.
list ($ip, $crap) = split(' ', $buffer);
if ($_SERVER['REMOTE_ADDR'] == trim($ip))
$exists = TRUE;
}
// If scan determines it's user is a new IP entry, add the IP address to the log file at the end of the document
if (!$exists)
fwrite($fp, $_SERVER['REMOTE_ADDR']. " $dateTime\n");
fclose($fp);
قم بعمل ملف باسم ip-log.txt في نفس المجلد وقم باعطاءه التصاريح 777 ليسمح بكتابة المعلومات للزوار
جرب هذه الطريقه