I don't have composer instaled on my computer. So I can't do: "composer install --ignore-platform-reqs". Why do I have to have composer installed on my computer? Aren't we using Docker?
I hit a snag here; whenever I tried accessing the app it would just give me "Fatal error: Composer detected issues in your platform..." complaining about needing PHP 8.2 and the app having 8.1. I found the solution to be to remove the vendor folder and composer.lock, re-run "composer install --ignore-platform-reqs" and NOT run "composer dump-autoload" locally; I figure this is fine as we do that step as part of the PHP Dockerfile anyway? Excellent tutorial btw, having a great time following along!
Hello. I'm getting the following error: "Warning: require_once(/var/www/html/vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/public/index.php on line 5 Fatal error: Uncaught Error: Failed opening required '/var/www/html/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/public/index.php:5 Stack trace: #0 {main} thrown in /var/www/html/public/index.php on line 5" My files are the same as yours at this point in the class. Could you help me ? Sorry my bad english. I'm from Brazil.
This whole series is gold! Thank you!
I don't have composer instaled on my computer. So I can't do: "composer install --ignore-platform-reqs". Why do I have to have composer installed on my computer? Aren't we using Docker?
Yes you can do it inside docker.
Just run:
docker compose exec app composer install
You won't need --ignore-platform-reqs doing it this way
I hit a snag here; whenever I tried accessing the app it would just give me "Fatal error: Composer detected issues in your platform..." complaining about needing PHP 8.2 and the app having 8.1.
I found the solution to be to remove the vendor folder and composer.lock, re-run "composer install --ignore-platform-reqs" and NOT run "composer dump-autoload" locally; I figure this is fine as we do that step as part of the PHP Dockerfile anyway?
Excellent tutorial btw, having a great time following along!
Yes..composer dump-autoload will run in the container when you do the install so no need to do it locally. Nice work on figuring it out 👍
Hello. I'm getting the following error:
"Warning: require_once(/var/www/html/vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/public/index.php on line 5
Fatal error: Uncaught Error: Failed opening required '/var/www/html/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/public/index.php:5 Stack trace: #0 {main} thrown in /var/www/html/public/index.php on line 5"
My files are the same as yours at this point in the class. Could you help me ? Sorry my bad english. I'm from Brazil.
I needed to add "- /var/www/html/vendor" in "docker-compose.dev.yaml (volumes)" and use "=" instead of ":" in ".env". My code worked like that.