Jump to content

Installing vlucas/phpdotenv package to parse .env file on php site


Recommended Posts

Posted

Hi there!

I'm new on using .env file to securely store database credentials on my php project. I watched some tutorials about it, and all of them used a popular third-party package phpdotenv. But, I don't have an idea on installing it on plesk panel. May I request for assistance?

Thank youuu!! :)

Posted

It's a library that's meant to be implemented through Composer. If your project doesn't use composer, you'll need to set that up, after which you can just add the package to your composer.json file. When you do a composer install the result is a vendor folder with all the dependencies and a custom-built autoloader script that you call from your code to load them all.

Composer is one of those things that's usually best done on your local PC. Once you get everything working, you can commit the composer.json file in your git repo (the vendor folder itself is typically excluded). Plesk has Composer support, so you can use that to process the composer.json and install the required dependencies right on the server.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...