Jump to content

file_get_contents() No such file or directory


ttocskcaj

Recommended Posts

file_get_contents() has suddenly stopped working for me. I keep getting this error:

Warning: file_get_contents(/Users/ttocskcaj/MineCMS/public/js/jquery.js ) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /Users/ttocskcaj/MineCMS/controllers/m.controller.php on line 44

 

The file(s) definitely exist, I can use nano to open them, and permissions are 777 on all the files. The lampp error log has nothing. Not even a No such file or directory error as you'd expect.

 

Any ideas what's going on?

Link to comment
Share on other sites

Ok problem solved.

The filename (which is read from a txt file) had a "\n" linebreak at the end of it that wasn't showing in the error messages!

Just did a str_replace for \n and \r and it's working fine :D

That's probably why you should always post your code...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.