Skip to content
Advertisement

“file_get_contents(http://127.0.0.1:8000/storage/config/xxx.ini): failed to open stream: HTTP request failed! ”

I got this error message when trying to send form data post request via POST method.

JavaScript

Laravel code

JavaScript

By the way, the file exist if I view at URL. Any idea?

Advertisement

Answer

Instead of making an http request to read the file, use the storage_path helper:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement