I keep getting “Failed to open stream: Permission denied” and changing permissions on the folder does not work

I am switching from Windows to Linux (Fedora), and I keep getting this error in my Laravel project that I did not have on Windows:

enter image description here

It’s apparently related to permissions, but running these commands doesn’t fix the issue:

sudo chmod -R 777 /var/www
sudo chmod -R 777 storage/
sudo chown -R apache:apache /var/www/
sudo chmod -R 777 /var/www/html/cursos/victor-robles/master-fullstack/api-rest-laravel/storage/framework/views/

I have checked if permissions have been set properly with ls -la and this is what I get:

api-rest-laravel folder:

drwxr-xr-x. 1 apache apache    402 Sep 18 10:51 .
drwxrwxrwx. 1 apache apache     56 Sep 18 02:02 ..
drwxr-xr-x. 1 apache apache     52 Aug 18 22:33 app
-rwxrwxrwx. 1 apache apache    425 Apr 15 08:24 artisan
drwxr-xr-x. 1 apache apache     50 Aug 18 22:33 bootstrap
-rwxrwxrwx. 1 apache apache   2462 Aug 18 23:27 composer.json
-rwxrwxrwx. 1 apache apache 299734 May  1 13:24 composer.lock
drwxr-xr-x. 1 apache apache    204 Aug 18 22:33 config
drwxr-xr-x. 1 apache apache    102 Aug 18 22:33 database
drwxr-xr-x. 1 apache apache     24 Aug 18 22:33 docs
-rwxrwxrwx. 1 apache apache    258 Apr 15 08:24 .editorconfig
-rwxrwxrwx. 1 apache apache   1139 Sep 18 02:20 .env
-rwxrwxrwx. 1 apache apache   1084 Apr 15 08:24 .env.example
-rwxrwxrwx. 1 apache apache    186 Apr 15 08:24 .gitattributes
-rwxrwxrwx. 1 apache apache    286 Apr 15 08:24 .gitignore
-rwxrwxrwx. 1 apache apache    354 Apr 15 08:24 package.json
-rwxrwxrwx. 1 apache apache   1173 Apr 15 08:24 phpunit.xml
drwxr-xr-x. 1 apache apache     78 Aug 18 22:33 public
-rwxrwxrwx. 1 apache apache   3932 Apr 15 08:24 README.md
drwxr-xr-x. 1 apache apache     20 Aug 18 22:33 resources
drwxr-xr-x. 1 apache apache     36 Aug 18 22:33 routes
drwxr-xr-x. 1 apache apache     32 Aug 18 22:33 storage
drwxr-xr-x. 1 apache apache     46 Aug 18 22:33 tests
drwxr-xr-x. 1 apache apache    596 Aug 18 22:34 vendor
-rwxrwxrwx. 1 apache apache    331 Apr 15 08:24 vite.config.js

api-rest-laravel/storage

drwxr-xr-x. 1 apache apache  32 Aug 18 22:33 .
drwxr-xr-x. 1 apache apache 402 Sep 18 10:51 ..
drwxr-xr-x. 1 apache apache  68 Aug 18 22:33 app
drwxr-xr-x. 1 apache apache  70 Aug 18 22:33 framework
drwxr-xr-x. 1 apache apache  42 Aug 18 22:33 logs

api-rest-laravel/storage/framework

drwxr-xr-x. 1 apache apache   70 Aug 18 22:33 .
drwxr-xr-x. 1 apache apache   32 Aug 18 22:33 ..
drwxr-xr-x. 1 apache apache   28 Aug 18 22:33 cache
-rwxrwxrwx. 1 apache apache  119 Apr 15 08:24 .gitignore
drwxr-xr-x. 1 apache apache   20 Aug 18 22:33 sessions
drwxr-xr-x. 1 apache apache   20 Aug 18 22:33 testing
drwxrwxrwx. 1 apache apache 4052 Sep 18 02:24 views

I have also tried restarting apache with sudo systemctl restart httpd several times but nothing works.

Please, any ideas?