docker-laravel icon indicating copy to clipboard operation
docker-laravel copied to clipboard

Issues with running artisan command

Open MahnazJ opened this issue 3 years ago • 6 comments

Hi,

First of all thank you for publicizing your repo.

I have cloned the repo, but I am experiencing some issues. Disclaimer: I am fairly new to Docker. I would like to use the artisan command, but I get "/usr/local/bin/docker-php-entrypoint: 9: exec: artisan: not found" when I use the following: docker-compose run php artisan serve. What would you recommend doing in this case?

MahnazJ avatar Oct 19 '22 17:10 MahnazJ

Hi @MahnazJ

Thanks and nice to see that you want to use my package!

You don't need to use php artisan serve, because you are using the Docker environment / webserver and not your built in webserver. If you follow the wizard and install Laravel, the installation will start the Docker containers (webserver) and ask if you want to open the new Laravel application in your browser (or you can manually enter the address, http://localhost:poortNumber) thats all :)

If you have any questions, feel free to let me know.

mvd81 avatar Oct 20 '22 05:10 mvd81

Hi,

So I've started all over again. I am running on Linux Ubuntu btw. When I want to visit the page through localhost:portnumber, it states the following: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

After refreshing the page I get: This site can’t be reached localhost refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED

Have you ever countered a similar issue?

MahnazJ avatar Oct 20 '22 15:10 MahnazJ

I don't have any problems, but I don't use Linux. Maybe this topic can help you? https://stackoverflow.com/questions/50552970/laravel-docker-the-stream-or-file-var-www-html-storage-logs-laravel-log-co

mvd81 avatar Oct 20 '22 15:10 mvd81

@MahnazJ

I switched to WSL2 on Docker. Then I also had some permissions issues and created a user in the Docker file to fix this. https://github.com/mvd81/docker-laravel/commit/094110a5efa2930f42ea140701201bfd7d6701bd

Maybe this will fix your permission error?

mvd81 avatar Nov 24 '22 07:11 mvd81

Appreciate it a lot! This saved my life in a different Docker-PHP project

MahnazJ avatar Nov 25 '22 16:11 MahnazJ

@MahnazJ nice, good to hear! 😀

mvd81 avatar Nov 25 '22 18:11 mvd81