Docker and PHP Complete Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ก.ย. 2024

ความคิดเห็น • 125

  • @tonyhomfray
    @tonyhomfray ปีที่แล้ว +7

    This is so great. You provide really thorough, detailed and clear explanations. And it is so refreshing to see modern PHP development being taken seriously. Thank you!

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Cheers Tony...glad it was helpful!

  • @pasizdobrekuce
    @pasizdobrekuce ปีที่แล้ว +4

    Your newsletter is probably the most useful one I have ever subscribed to. Thanks!

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      I really appreciate that! People rarely unsub so I must be getting something right!

    • @pasizdobrekuce
      @pasizdobrekuce ปีที่แล้ว +1

      @@GaryClarkeTech 💪

  • @RogerHolden
    @RogerHolden 9 หลายเดือนก่อน

    Thanks. I've watched umpteen videos on Docker but they all miss out, or fail to explain, key parts. Yours has finally made Docker understandable (ish!)

    • @GaryClarkeTech
      @GaryClarkeTech  9 หลายเดือนก่อน

      That's great to hear! I hope that you're able to adapt what you've learned into your own stuff.

  • @ronaldoriosespindola3716
    @ronaldoriosespindola3716 8 หลายเดือนก่อน

    You really have the best teaching skills. I always had difficulty understanding the concept of construction (especially X-debug and Composer). Now I understand and I was able to apply it perfectly. Thanks!

    • @GaryClarkeTech
      @GaryClarkeTech  8 หลายเดือนก่อน

      Great to hear! Thanks for the kind words.

  • @karlisbrakis2324
    @karlisbrakis2324 ปีที่แล้ว

    I have no idea how youtube keeps giving these insanely good recommendations, thanks for the video

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Thanks very much for the kind words and thanks for watching!

  • @bartoszyn1
    @bartoszyn1 ปีที่แล้ว

    Amazing, thank you for this easy yet comprehensive tutorial. It helped me grasp certain concepts my brain refused to digest previously.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Great..I'm glad it worked for you!

  • @christopheryongo6113
    @christopheryongo6113 ปีที่แล้ว +1

    A true gem, so detailed and easy to comprehend.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Glad you enjoyed it... I appreciate the kind words

  • @sjankarcher
    @sjankarcher ปีที่แล้ว +1

    I already like it as I see the video description

  • @shashikantmarskole
    @shashikantmarskole ปีที่แล้ว +2

    Thanks Gary 🙏 , Nicely and step by step explain. nice work done and keep it up. thank you once angain creating such quality content.

  • @arjan127
    @arjan127 ปีที่แล้ว +1

    You are a legend for this. Thanks so much, it's very easy to follow and understand.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Ah you're welcome...you're a legend for watching it! Cheers

  • @mcoria74
    @mcoria74 ปีที่แล้ว +2

    Awesome, to be honest for me It was a course of 3 days but with a lot of knowledge gained. Thanks for this video and as soon as possible the next course will be OOP. Regards form México :)

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว +1

      Great to hear, Miguel..keep going! Respect from UK 🤝

  • @ayenikehinde2917
    @ayenikehinde2917 6 หลายเดือนก่อน

    Great tutorial. I was able to follow you from start till end doing it with laravel app.

    • @GaryClarkeTech
      @GaryClarkeTech  6 หลายเดือนก่อน

      Nice work...hope you can put all to practical use!

  • @AceMartinov
    @AceMartinov ปีที่แล้ว +1

    This is such a great resource! I'm not even half way through but I love the pace and the content. Spot on dude! I've been working with DevOps for a few months now, and this seems like a great way to get the basics covered after diving head-in to multi-stage builds and Kubernetes deployments :)

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว +1

      Thanks buddy...I just wanted to get something out there that us regular PHP devs could understand...felt it was missing from the internet!

  • @MoonyWolf2002
    @MoonyWolf2002 10 หลายเดือนก่อน

    Super helpful and helping the community and me a ton. Thank you so much. Literally saving my life.
    I've never used docker before and I just started in a development apprenticeship and could skip the first year but last time I coded anything was a few years ago and I never knew docker existed till recently through my boss wanting me to develop a app... using docker. So this is helping me out so much. Even if its nearly 2am

    • @GaryClarkeTech
      @GaryClarkeTech  10 หลายเดือนก่อน

      Great to hear...keep going! 💪

  • @alterX2ego
    @alterX2ego 19 วันที่ผ่านมา

    great! thank you!

  • @dma98
    @dma98 10 หลายเดือนก่อน

    This video has greatly helped me. Thank you Gary, this was really helpful

  • @hypodrone6198
    @hypodrone6198 4 หลายเดือนก่อน

    ...another great video by Gary. Looking forward to see Symfony (simple dev "quickstart" version) dockerized :)

  • @jasongoossens
    @jasongoossens ปีที่แล้ว +1

    Thanks for yet another great tutorial!

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว +1

      You're welcome..thanks for watching it!

  • @ytalodev
    @ytalodev ปีที่แล้ว

    Sensational content, it was not difficult to understand, everything went well here, congratulations.

  • @JonibekJ
    @JonibekJ ปีที่แล้ว +3

    Wow! the video i was looking for. Absolutely awesome tutorials!! Gary can you also make a complete tutorial on making a php MVC framework from scratch, please. Cause this is also a undertought topic. You make easy to understand videos.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Kind words...thanks very much. Yes my next full course for garyclarke.tech will be create a php framework. The preview will be on TH-cam

  • @okeregodspowerkelsey4217
    @okeregodspowerkelsey4217 ปีที่แล้ว +1

    Nice tutorial sir, your courses have really been of immense value to me sir. Keep up the good work.

  • @Hevletica
    @Hevletica ปีที่แล้ว +1

    Just what I was looking for!!

  • @jochenkohler6721
    @jochenkohler6721 ปีที่แล้ว +1

    Very good! Thanks Gary!

  • @kevinflorenzdaus
    @kevinflorenzdaus ปีที่แล้ว +1

    woah! this is HUGE!
    kudos!

  • @DemianRodriguez-wt5wk
    @DemianRodriguez-wt5wk ปีที่แล้ว

    Great tutorial, great and understandable explanations and practical cases, you got a new happy follower, thanks man!

  • @n1027
    @n1027 ปีที่แล้ว +1

    This video is useful for me. Thank you.

  • @RobertoDeMontecarlo
    @RobertoDeMontecarlo ปีที่แล้ว

    Love this channel! Wonderful resource... I'm learning a lot!

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      That's great news...keep going 💪

  • @mktNo1
    @mktNo1 ปีที่แล้ว +1

    Awesome. Thank you so much. It's very helpful.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      You're welcome...glad I could help.

  • @secure73
    @secure73 ปีที่แล้ว

    thank you very much Sir. I learned a lot

  • @LotusSoftPvtLtd
    @LotusSoftPvtLtd ปีที่แล้ว

    Thank you for such great video Gary Clarke.

  • @user-lu1er6qp2q
    @user-lu1er6qp2q ปีที่แล้ว +2

    Hi Gary, thanks for this video, it's just what I was looking for. A question: to install imagick adding "nstall-php-extensions imagick;" is enough ? Thanks

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Yeah think that will be ok, it's on the list for mlocati/php-extension-installer
      Just check this list when you need to see if an extension is possible:
      github.com/mlocati/docker-php-extension-installer#supported-php-extensions

  • @scotttresor
    @scotttresor ปีที่แล้ว +1

    Thanks for your video

  • @secure73
    @secure73 ปีที่แล้ว

    would you please kindly make one short course with swoole instead of nginx ? thanx

  • @albouchioussema702
    @albouchioussema702 ปีที่แล้ว +1

    Thank you

  • @mehmetaydar_QXyGeN
    @mehmetaydar_QXyGeN ปีที่แล้ว

    Thank you very much. this lesson is great ❤

  • @mlsandreas
    @mlsandreas ปีที่แล้ว +1

    Thank you!!

  • @arunkumark1596
    @arunkumark1596 ปีที่แล้ว

    Nice video, thanks for the great work

  • @LiveDimi
    @LiveDimi 7 หลายเดือนก่อน +1

    On 1:02 Hours of the course there is a command called "composer install". I do not have composer locally installed and I don't want to install locally on the MAC OS php and composer. Is there another way to get this up and running? Thanks a lot so far for this great tutorial.

    • @GaryClarkeTech
      @GaryClarkeTech  7 หลายเดือนก่อน +1

      Yes you can execute this inside the container..which is actually the best way to do it
      docker compose exec app composer install

  • @AshukaMadeIt
    @AshukaMadeIt ปีที่แล้ว +1

    Yes Sir !

  • @amazinggameplays2693
    @amazinggameplays2693 ปีที่แล้ว +2

    Watched till 17:05 (In case youtube doesn't remember)

  • @petritmekuli
    @petritmekuli ปีที่แล้ว

    Great tutorial.

  • @popov654
    @popov654 9 หลายเดือนก่อน

    Very nice video, thank you! It is really even better than the official quick course on Docker site (though the latter one is meant for dummies like me).
    I wanted to ask you, if you don't mind: I set up xdebug (not using your video, by using the guide from docker site), used "host.docker.internal" value, installed the same Chrome extension you are using in the tutorial, changed the IDE key in the extension to vsc (also tried another way - changing this parameter in VSCode settings), tried even adding port 9003 to ports section as "9003:9003" (though that does not seem necessary because I have not seen many tutorials mention this step) - but still xdebug is not working for me.
    I have Windows 10 22H2 in VMware, latest version of VSCode, PHP 8.3 and xdebug 3. What is most important, xdebug is working for me locally without Docker. Also, PHP Info page lists xdebug as enabled inside docker, so I guess it IS installed, but my IDE cannot receive the connection for some reason.
    My networking mode is "mirror host adapter", because it's the only way I can access my home Windows SMB share.

    • @GaryClarkeTech
      @GaryClarkeTech  9 หลายเดือนก่อน

      I've not done it in VSCode personally but give the XDebug playlist by @DerickRethansXdebug a go
      th-cam.com/video/MmyxWy8jl7U/w-d-xo.html
      Loads of useful vids there. Derick created XDebug and he'll be happy to help you out.

  • @remymoro1854
    @remymoro1854 ปีที่แล้ว +1

    Thanks ! ! !

  • @Hevletica
    @Hevletica ปีที่แล้ว +1

    Composer finally meets Compose 😄

  • @kunyuchang
    @kunyuchang ปีที่แล้ว +2

    Hi Gary, your website course looks great, but to me it's missing an auto-translated subtitle (like udemy or youtuber)

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว +1

      Fair feedback...we'll look at what options there are available.

    • @kunyuchang
      @kunyuchang ปีที่แล้ว

      @@GaryClarkeTech Thank You

  • @folomba
    @folomba ปีที่แล้ว +1

    Hello, bro! I learn to PHP!

  • @WernerHelbig
    @WernerHelbig ปีที่แล้ว +1

    Thank you Gary, I completed this super course entirely on an Apple Silicon. An immense value to me! It was so far the best course I've seen on the subject and the nicest thing, it's tailored exactly to my needs. Not too little, but not too much either. Just great! Please don't stop developing courses like this, I'm looking forward to the next one, maybe a detailed XDebug with all the subtleties for once?

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Great job! You'll be building all your own images before you know it! Lots more to come.

  • @nicolasromero6144
    @nicolasromero6144 10 หลายเดือนก่อน

    Nice content thank you for share

    • @GaryClarkeTech
      @GaryClarkeTech  10 หลายเดือนก่อน

      Thanks for watching

    • @nicolasromero6144
      @nicolasromero6144 9 หลายเดือนก่อน

      If you have time create a content on dockers and permission and users on docker, for example: linux users for nginx, apache, laravel app and others. Anyway thank you

  • @erickbianes7513
    @erickbianes7513 ปีที่แล้ว +1

    Thank you for this tutorial. For some odd reason the nginx/default.conf only works for me if I exclude the server_name directive.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Ah ok..could be interesting. Wanna share your setup and I'll look into it?

  • @aamthanh4471
    @aamthanh4471 ปีที่แล้ว +1

    super!

  • @Valantir007
    @Valantir007 ปีที่แล้ว +1

    Is necessary to keep volumes in web section for the production environment? .conf files are copied in nginx dockerfile so I think it's not but I preferred to ask.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว +1

      Not necessary for prod but handy to have during development cos it means no need to rebuild when you make changes

    • @Valantir007
      @Valantir007 ปีที่แล้ว

      Ohh... Of course... Thank you very much@@GaryClarkeTech
      Realy good video and the course. 🤝👍

  • @RichardBlezer
    @RichardBlezer ปีที่แล้ว

    Why are you using tables plus as you are working with php-storm. Database editor is built right in

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว +1

      I've never liked the phpstorm one..don't find it easy to work with

  • @user-lu1er6qp2q
    @user-lu1er6qp2q ปีที่แล้ว

    Hallo Gary!. I am having a problem with the execution time of "imagecreationfromjpeg" (using php:8.1-fpm-alpine); it take minutes to do a jb that usually takes 100 milliseconds (create a jpg image from an url); I ried to install imagi in several ways but nothing change, so I am wondering if it could be a problem of php image. Have you any suggestion ? Many thanks in advance, Pierluigi

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Yes..it could well be related to the php image. PHP and Docker have a history of performance issues but I don't know the solution to your problem off the top of my head.
      But my next steps would be chatgpt / google

  • @karuifeather
    @karuifeather 9 หลายเดือนก่อน

    what's the code editor?

  • @tbiro3478
    @tbiro3478 ปีที่แล้ว

    muito bom

  • @fredrickquansah3607
    @fredrickquansah3607 ปีที่แล้ว

    Thank you very much. But please i have an error. When i try to test the mysql connection. I get this error. "Access denied for user 'user'@'%' to database 'my-db'"

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Are your files the same as mine?

    • @fredrickquansah3607
      @fredrickquansah3607 ปีที่แล้ว

      @@GaryClarkeTech please yes. I have checked.

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Can you show me your docker compose file?

    • @fredrickquansah3607
      @fredrickquansah3607 ปีที่แล้ว

      @@GaryClarkeTech Please here is the docker compose file codes
      services:
      # server
      webserver:
      image: nginx:latest
      ports:
      - "9000:80"
      volumes:
      - ./nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
      # php
      app:
      build:
      dockerfile: ./docker/Dockerfile
      volumes:
      - ./app:/app
      # db
      db:
      image: mysql:8.0
      #preserving development data /var/lib/mysql is a folder in the mysql container
      volumes:
      - mysqldata:/var/lib/mysql
      ports:
      - "4306:3306"
      restart: unless-stopped
      environment:
      MYSQL_ROOT_PASSWORD: p@ssw0rd
      MYSQL_USER: user
      MYSQL_PASSWORD: p@ssw0rd
      MYSQL_DATABASE: docker-db
      volumes:
      mysqldata:
      Initially, I was running it on windows and it was not working. But I just run it on mac and the connection is successful

    • @fredrickquansah3607
      @fredrickquansah3607 ปีที่แล้ว

      Thank you for patience and support

  • @vmvm9758
    @vmvm9758 ปีที่แล้ว +1

    It doesn’t work without context: .
    You can’t compose up

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Possibly your version of docker compose. I used v2. You can check by going to the settings ⚙️ in the Docker Desktop panel

    • @vmvm9758
      @vmvm9758 ปีที่แล้ว

      @@GaryClarkeTech Thank you.

  • @mikail1026
    @mikail1026 7 หลายเดือนก่อน

    nice but not beginner friendly

  • @alexkiiru1283
    @alexkiiru1283 7 หลายเดือนก่อน +1

    Container docker-php-web-1
    Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/host_mnt/home/alexkiirundemi/Desktop/docker-php/nginx/conf.d/default.conf" to rootfs at "/etc/nginx/conf.d/default.conf":
    29:55

  • @user-lu1er6qp2q
    @user-lu1er6qp2q ปีที่แล้ว

    Hi Gary, I am having toubles with a simple php curl call to get mime type of a public file. From inside the container it seems tha curl is unable to access the file, like it was unable to resolve the url address:
    $ch = curl_init(".....something....);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $curlExec = curl_exec($ch);
    $curlExec is FALSE. Is there a setting to access public internet address I am missing ?

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      Is it the same for all outbound addresses?

    • @user-lu1er6qp2q
      @user-lu1er6qp2q ปีที่แล้ว

      @@GaryClarkeTech Yes, different address, same error

    • @user-lu1er6qp2q
      @user-lu1er6qp2q ปีที่แล้ว

      @@GaryClarkeTech I solved adding dns section in docker-compose file, app section. Now I upload wxternal files, but functions like "imagecreatefromjpeg" take ages to load this file; very boring. Thanks.

  • @quaap
    @quaap ปีที่แล้ว +1

    Hi Gary, Great video! I have followed this docker tutorial with great interest, and have already used the knowledge in several projects. However, there is something I can't figure out. My css and js files, loaded via a Link or Script tag, result in a 404. FYI I load the css file with the full link ("css/style.css" doesn't work either) I can't really figure out where the problem lies. Do you perhaps have an idea?

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว

      What folder have you put them in? They will need to go in the public folder. They won't be accessible in outside of here.

    • @EHeins-hg4tn
      @EHeins-hg4tn ปีที่แล้ว

      @@GaryClarkeTech The files are indeed in folders that are in the public folder. That's why I find it so strange that they can't be opened, but index.php can...

    • @GaryClarkeTech
      @GaryClarkeTech  ปีที่แล้ว +1

      You could try keeping them in an assets folder and adding an additional location entry to your default.conf file, like so:
      location /assets {
      alias /var/www/html/public/assets;
      }
      Then to reference that file in your html, use this:
      You will need to rebuild your web container after this change.

    • @EHeins-hg4tn
      @EHeins-hg4tn ปีที่แล้ว

      @@GaryClarkeTech Thanks Gary for this solution, this does indeed work. I have now found the cause why it did not work before. You have to be pretty precise when it comes to docker file layout, I discovered through trial and error. But thanks for your solution, now I can move on to the actual development. ;-)

    • @ytalodev
      @ytalodev ปีที่แล้ว

      @@GaryClarkeTech
      can I just put it like this?, because my css for example is at the root of the project.
      location /css {
      alias /var/www/html/css;
      }
      In the HTML:
      is it right?