2

When I see my system.log I see a error name :

2015-12-16T15:15:19+00:00 DEBUG (7): is_readable() expects parameter 1 to be a valid path, string given/data/web/public/lib/Varien/Io/File.php

Does anyone know where this error comes from and what I can do about it?

When I go to the file file.php. I see the code:

protected function _checkSrcIsFile($src)
{
    $result = false;
    if (is_string($src) && is_readable($src) && is_file($src)) {
        $result = true;
    }
    return $result;
 }
5

The log entry

is_readable() expects parameter 1 to be a valid path, string given

occurs due to a bug in the Varien library. The method Varien_Io_File::write() can be used to either

  1. write given data to a given destination file or
  2. copy the contents from a given source file to a given destination file.

These use cases are distinguished by checking the second parameter $src of the aforementioned method via call to Varien_Io_File::_checkSrcIsFile().

If $src turns out to be a filename, its contents are copied to the destination (use case 2). Otherwise it is interpreted as plain data (use case 1). The check applies function.is-readable which always emits given warning in use case 1.

What you can do about it:

  • Replace the initial call to Varien_Io_File::write()
  • Fix the erroneous conditional switch
  • Ignore the log entries
  • @Michel Van De Wiel I think this should be accepted as answer, don't you think? – Eddie C. Aug 1 '17 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.