PHP Warning: failed to open stream: File name too long


PHP Warning: fopen(cache/____________.cache): failed to open stream: File name too long in test.php on line 12

Error type: warning


Call to function fopen() fails for some files.


The file system has a limit for the file names, for Linux (ext) is 256 characters, trying to create a file longer than that will fail and issue the warning above.


Shorten the filename to have less than 256 characters. Use hash functions if you can’t just truncate the file name.

Leave a Reply

Your email address will not be published. Required fields are marked *

Security question: * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.