PHP Packages - Dotenv manage PHP application configuration in .env files

Поділитися
Вставка
  • Опубліковано 30 лип 2024
  • Dotenv allows you to put your PHP applications configuration into a .env file and it will load the configuration into environment variables for you.
    My scratchpad file: gitlab.com/penguindigital/scr...
    Dotenv: github.com/vlucas/phpdotenv

КОМЕНТАРІ • 23

  • @DragonnSteve
    @DragonnSteve 4 роки тому +1

    Nice tutorial. Thank you for your work😉

    • @PenguinDigital
      @PenguinDigital  4 роки тому +1

      No problem, I’m glad you found it useful

  • @maxmaaen9070
    @maxmaaen9070 4 роки тому +3

    Thanks for helping to pass my practical course #studyIT

  • @med3060
    @med3060 Рік тому +1

    thank you so much , very helpful introduction.

  • @srilankateaandspice5846
    @srilankateaandspice5846 3 роки тому +1

    Thank you

  • @zomboy-exe3440
    @zomboy-exe3440 5 років тому +1

    tnx

  • @ahmedhabibglai6880
    @ahmedhabibglai6880 Рік тому

    Fatal error: Trait 'Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait' not found in C:\Users\user\Desktop\myshop\src\Kernel.php on line 12
    Do you have any idea about this error, i've been stuck in this error for a day, could you help me please?

  • @NedumEze
    @NedumEze 2 роки тому +1

    Thank you very much sir. This is a handful!
    Could you please walk us through how to handle this in a Production or live server?
    That is, the phpdotenv library and the Composer interactions in a liveserver. Truly sorry for the inconvenience!

  • @basilemartin1756
    @basilemartin1756 3 роки тому +3

    need to use 'createUnsafeImmutable' to use getenv and putenv now

  • @davidofug
    @davidofug 4 роки тому

    Thank you. How do I take the .env to production server. Assuming the production server is a shared host environment on Cpanel or something like that.

    • @PenguinDigital
      @PenguinDigital  4 роки тому +1

      Sorry I don't have much experience with cPanel. I assume you have some way to upload your standard PHP files? Using something like SSH or SFTP? You would simply upload your .env file using one of those.

    • @davidofug
      @davidofug 4 роки тому +1

      @@PenguinDigital so if I upload .env file without uploading composer and vendor folder, will it work? I'm wondering why at development we need the composer and the phpdotenv library.

    • @PenguinDigital
      @PenguinDigital  4 роки тому +1

      No it needs the vendor folder also. When you're deploying to a server you need to run all the same commands you did during development on your live server.

    • @davidofug
      @davidofug 4 роки тому

      @@PenguinDigital its unfortunate on shared hosting environments you don't get to run commands.
      Fortunately, made a WordPress plugin with Composer features like autoload, psr-4, classmaps, files maps etc. Uploaded the entire directory including vender, composer.json etc.
      The plugin worked like expected, this only gives me courage.
      Thank you for introducing me to .env

    • @PenguinDigital
      @PenguinDigital  4 роки тому +1

      @@davidofug Sorry I've not used shared hosting for over 10 years. I assume they are using cPanel for the admin panel? If so you can follow this tutorial for getting .ssh access www.plothost.com/kb/generate-private-public-key-cpanel-ssh-access/

  • @rdz1319
    @rdz1319 3 роки тому

    "Class 'Dotenv\Dotenv' not found" help me please :(

    • @PenguinDigital
      @PenguinDigital  3 роки тому

      The error is pretty clear, its saying it cant find the class. Have you installed it? If you have installed it are you sure the autoloader knows about the package? composer dump-autoload

  • @judeleon8485
    @judeleon8485 3 роки тому

    You should have zoomed in a little more, so one can see your code on the screen.

  • @goodluckoriuwa1669
    @goodluckoriuwa1669 7 місяців тому

    The texts are too small