2
Warning: filemtime(): stat failed for includes\img\defaultimg.jpg in

I read and researched but found nothing useful

in the php manual only says this:

If PHP's integer type is only 32 bits on your system, filemtime() will fail on files over 2GB with the warning "stat failed". All stat()-related commands will exhibit the same behavior.

but is just a jpg 900k

this is my code works fine in xammp, but not in production

  $dirimg="includes/img/";  //this one also throws warning
        $filename = "".$dirimg."".$resultsb['Img'].".jpg";  //the path
        if(file_exists ($filename)){  // exists?
        $timeimg=filemtime($filename);
       $srci="".$dirimg."".$resultsb['Img'].".jpg?=".$timeimg."";   
        }else{$timeimg=filemtime("includes\img\defaultimg.jpg");  //another path, the file does exists
       $srci="includes\img\defaultimg.jpg?=".$timeimg.""; } // 

both throw the same warning in the respective path, the file exits btw

the image can be seen, but i need to know when it is modified so the browser refreshes it

1 Answer 1

3

It was the slashes hahaha , the server is in Linux So, they have to be like this "includes/img/defaultimg.jpg?=" instead of "includes\img\defaultimg.jpg?="
LOL

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.