Deploying on a shared host


nothing change expect my path


You need to install it in the right director under public_html folder. Then you can install it using following command

composer require slim/slim"^3.0"

Once installed, add following code in index.php file


require 'vendor/autoload.php';
$app = new Slim\App();

However, for this method to work, you must have access to composer on your hosting provider. Most of the PHP hosting providers, like Cloudways and ServerPilot, provides composer on their servers.


Running composer on a production server is not a good idea. Please don’t do that!
Run composer only within your development or CI environment. Create an artifact you can deploy on your test/staging/prod webserver.