"Docker for PHP Developers" by Paul Redmond.
Trying to solve Xdebug and other issues.
Steps to build
-
Clone
git clone https://github.com/avrahamm/docker-app-11-laravel.git xdebug
cd xdebug -
Add .env from .env.example and .docker.env from docker.env.example files from respective example files
Windows!
Open docker/start.sh and assure line endings LF (linux style) and not CLRF(wibdows style),
as docker container runs linux.
@link: https://stackoverflow.com/questions/70380310/docker-env-bash-r-no-such-file-or-directory -
Build and run utility temporary container to composer install
docker-compose build composer
docker-compose run --rm composer install -
Build and run app container
docker-compose build app
docker-compose run app php artisan key:generate
docker-compose up -
Open http://localhost:8080 in Firefox - I ran on ubuntu 20.
-
https://github.com/avrahamm/docker-app-11-laravel/blob/master/xdebug-info-1.png on my side
-
Try to turn on Xdebug firefox extension
-
Turn on PHPStorm "Listen to PHP debug connetions"/green phone and "break on first line", or add breakpoints.
-
Get into container bash
docker-compose exec app bash -
To see log
cat /usr/local/etc/php/conf.d/xdebug.ini -
To see xdebug.ini
tail /tmp/xdebug.log -
take a look at
https://www.youtube.com/watch?v=4opFac50Vwo&lc=UgzO6tuJmbDjA6UUoHJ4AaABAg.9ZDeShZELEl9a2cVgU-UEW