Search code examples
phplaravellaravel-bladephpwebsocket

500 internal error Laravel, getting images through websocket daemon


I have a chat daemon running on Laravel project.

If I try to send to the client from a server a string, which contains HTML, I get 500 error (not 404, the file exists. Here is a example of a string

<img src="{{ asset('path/to/img.png') }}">

Here is the error I got in PHP logs:

request exceeded the limit of 10 internal redirects due to probable configuration error. use 'limitinternalrecursion' to increase the limit if necessary. use 'loglevel debug' to get a backtrace.

Again: If I echo this string in client (view), it will be ok, but if I get it like a message (to client from server) I get an error.


Solution

  • Solved. The function asset() returned a url like this:

    http://localhost/path/to/img.png 
    

    The problem was in missing port. I edited my .env file and changed the base url

    from

    http://localhost 
    

    to

    http://localhost:8000