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

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 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/pen...
    Dotenv: github.com/vlu...

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

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

    thank you so much , very helpful introduction.

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

    Thanks for helping to pass my practical course #studyIT

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

    Nice tutorial. Thank you for your work😉

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

      No problem, I’m glad you found it useful

  • @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!

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

    Thank you

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

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

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

      Thank you for the update

    • @Kal-el1231
      @Kal-el1231 3 ปีที่แล้ว

      Thanks man you saved me

  • @zomboy-exe3440
    @zomboy-exe3440 5 ปีที่แล้ว +1

    tnx

  • @ahmedhabibglai6880
    @ahmedhabibglai6880 2 ปีที่แล้ว

    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?

  • @judeleon8485
    @judeleon8485 3 ปีที่แล้ว

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

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

    The texts are too small

  • @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

  • @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/