Intro to PHP: Managing environment credentials using vlucas/phpdotenv

preview_player
Показать описание
vlucas/phpdotenv is a great package that allows us to remove hardcoded credentials from our applications and instead put them in a .env file. The .env file should never be check into version control.
Рекомендации по теме
Комментарии
Автор

Amazing. A short and simply effective tutorial that helped me with exactly what I needed. Thanks.

alvarojorge
Автор

Thanks a lot!! I have been watching so many different videos last days because i was struggling with this issue. But you are the only one who was able to help me, really appreciate that! Thanks a lot.

saifabusrour
Автор

I tried to load a .env file using `composer require vlucas/dotenv` and it gave me a `phanda-framework/dotenv` wrapper for it, and my text editor keeps throwing an error if i try to use the way you explained here to load it. I cannot seem to find any resource explaining how to use this phanda framework to load it. How can i use this?

buildervision
Автор

I've followed this video step by step and been trying to fix this error for far too long: Fatal error: Uncaught Error: Class "Dotenv\Dotenv" not found in

Do you have any idea what could be causing this? Cheers

maxxjonesyy
Автор

Hi Chris. Thank you so much for sharing this tutorial. As per @saifabusrour comment, I agree, you have made this tutorial so easy to follow and have actually demonstrated how to use .env variables. I followed your code and it works like a charm. I do have a request. It is about being able to allow users to upload images such as profile images into an area outside the public directory (taking into account GDPR) and then being able to display their profile image in a Views page once signed in. I am using a PHP MVC framework. Any advise on best practices would be welcomed. Ideally a tutorial how this can be achieved would be even better. Thanks you once again for this tutorial.

pareshdawda
welcome to shbcf.ru