When i run magento command i get this error.

  Warning: is_file() expects parameter 1 to be a valid path, string given in   
  File.php on line 512

Try this :

rm -rf var/cache var/log var/page_cache var/view_preprocessed

More detail : https://github.com/magento/magento2/issues/10878


No need to delete particular folder just run this command :-

Just One time

rm -rf var/view_preprocessed/*   == Clear cache 
rm -rf generated/* == Clear generated classes 

Please do not run

rm -rf var/* 

Because it will removed your database backup and other module log files.

  • For second line, added -r recursive flag since hierarchy of files existed in my case. – jiy Jul 2 at 14: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.