Deploying on a shared host


Is there any clear instructions on deploying slim in a shared host because i have a go daddy cpanel shared host and i have tried every available instructions and all of them failed knowing that i have a ssh access and already installed it through composer
( the app is working on the local machine )


The key is often to mimic the directory structure locally that you are forced to use in the shared environment. As we discussed in your other thread, sometimes shared hosts don’t allow you access above your “public” folder, which can be an issue if you didn’t develop the app that way. Not a big one to change though.

If you can describe to use the directory structure of your app as well as the directory structure of your hosting environment I’m sure we can get you up and running.


the directory structuer of the cpanel :
the directory structuer of my app :


Okay. So you will need to change the directory structure of your app a bit to match. It looks like the root web directory of your site is the public_html folder. I assume for a typical site on that host that is where you would put your index.php or index.html file, correct?

So in your app, you will need to rename the public folder to be public_html and adjust the webserver you are running locally to point to that new location. Then, when you upload your files, your .htaccess and index.php files that were previously in your public folder will now go into the public_html folder.

Your other folders and files src/, vendor/, composer.json, composer.lock etc will live in the top level directory you posted… so src/ will be right alongside public_html/ and tmp/.

Then you should be good to go. Does that make sense? If it still doesn’t work, error logs might be helpful.


It’s working smoothly , i am really grateful and thankful to you :slight_smile: