Previously, I've asked for a Laravel issue in this question:
There, I've mentioned that I have a Laravel project folder placed into the default Apache root directory. That's it, the one that is used for placing the content of any website. In my Linux Mint installation, that directory is: "/var/www/html/", so my project is in a subdirectory called "infoalq".
Also, I've mentioned I had two ways for viewing the content of the project. One of them is running the command "php artisan serve" in the terminal, while placed in the project folder (in my case, "/var/www/html/infoalq/") and then, going to the URL "http://localhost:8000" (using port 8000) in the browser. The other way is just going to the URL "http://localhost/infoalq/public/" (using the HTTP port 80, like is configured in Apache by default), just with having the Apache server active.
The issue is this one: I can't access simultaneously to the content of the app in both ways. I mean, if I access to it by going to "http://localhost:8000", it shows perfectly the welcome view, but then, if I go to "http://localhost/infoalq/public/" in another tab in the same session, I get an error page showing this:
UnexpectedValueException
The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: The stream or file "/var/www/html/infoalq/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied The exception occurred while attempting to log: file_put_contents(/var/www/html/infoalq/storage/framework/sessions/adfnCUfB0vFv305r0P8mUgkdJHbvlfqctbHu6etu): Failed to open stream: Permission denied Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}} Context: {"exception":{}}
Something similar happens in the opposite case. When I try to access the website by the URL "http://localhost:8000" in another tab, after accessing to it by the URL "http://localhost/infoalq/public/" (which initially works fine), I get an error page showing this:
ErrorException
file_put_contents(/var/www/html/infoalq/storage/framework/sessions/IlqNl7oqUUAiMPAUjx6FlQOvOsNcHadDLNePjvG3): Failed to open stream: Permission denied
So then, I have to restart the browser every time I want to view the app running with any of those ways.
As I've mentioned in the other post, I'm using:
Linux Mint 21 Vanessa
Apache/2.4.52 (Ubuntu)
PHP 8.2.1
Laravel v9.48.0
Does anyone knows if is there a solution for this? Or it's just like this and there's nothing to do? I mean, perhaps there is no way to run the project simultaneously in both ways, without restarting the browser. I think there it must be a conflict between the Apache server and the PHP server. If there's any concept that I'm not clear about or I'm confusing about, please let me know.
Thank you very much!
Leandro