Learning -app-ecommerce update index.php

I tried following the instructions found here GitHub - kodekloudhub/learning-app-ecommerce: A sample e-commerce learning app

For step 6: update index.php, it is not clear to me how to update the index.php file with the code snippet. Do I add it at the beginning of the file? After the tag? At the end of the file?

You should add loadEnv function and database credentials preferably at the beginning of index.php (for code to work correctly).

Is there some step missing? The last steps are cloning a repo and modifying some configurations ( creating the .env file and modifying index.php). After cloning the repo there is no step to start an app, or restart a service or anything like that.

You don’t need to restart anything, httpd service should automatically pick up any modification in index.php and serve the updated content.

1 Like

Turns out I was not cloning the repo in the right directory (/var/www/html/) so it couldn’t pick up the changes. Thank you for the hints!