Slim 3.3.0 On Shared Hosting


I developing some site with AngularJS and PHP backend. However 30 php files for api is’t cool I jumped in Slim Framework.
But I have problem: I using shared hosting and I haven’t access to composer.
There is some way to use Slim without it?


You can-- though that doesn’t make it a good choice. The exact method would depend on the type of access you have to your server. However, a typical method would be to develop the site on your local computer where you can install composer, then upload all of the files by S/FTP, etc.

I have FTP access. I tried to do this with composer and transport to server. But I think there are some steps, because server have not composer. Maybe some additional files to composer work? I didn’t find any guides on this theme. Thanks.

If your app is working locally, then you should have all the files you need. Then upload them via FTP. I do this quite often.

All composer does is pull in files from remote servers. Once those files are locally on your computer you don’t need composer to do anything else… just upload all of the files including the vendor directory composer creates.

Is your application up and running on your local computer? Have you run computer on your local computer to install the dependencies of your project? If not, that is the first step.

Not yet. I am using windows, and have some errors with composer (SSL). I will try to fix thats. Or will do this on mac tomorrow.
Thanks you!

Okay, then these are your first steps.

  1. Install composer on your local computer.
  2. Install any dependencies your app needs with composer.
  3. Verify your app is running okay locally.
  4. Upload all of the files (including the Vendor folder composer creates within your project) via S/FTP.

It is only the last step that isn’t typical. Most people would not upload the vendor folder, then install or update the dependencies through composer on the server. You will just upload them directly to bypass composer.

Rob Allen made a post about this

1 Like

Thanks! I done it. All working)

If you can, use something like fortrabbit which is cheaper than most shared hosts and very easy to use.

I am using Ukrainian hoster. 2$ per month=) But thanks.

You think combination AngularJS + Slim is good?

You think combination AngularJS + Slim is good?

Anything in combination with Slim is good :slight_smile:


What about Lumen?
And what you can say about DatabaseData->PHPData syns? Connector pattern or else?

If your project has the possibility of moving up to full stack Laravel, then Lumen can be a good choice. Moving from Lumen to Laravel is fairly trivial. Otherwise, I think you will find most of us here prefer Slim. :wink:

I found this, which I consider quite solid advice:

Basically, he advises against using Composer on a production server. (I think he made a mistake talking about a “deployment machine” where I think “development machine” was what was meant, reading the rest of the message).

I’m not constrained by shared hosting, but I don’t want any service to “automagically” install things on a production server before testing it on my development machine.

Isn’t that the point of the composer.lock file?