Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SomeT's avatar
Level 1

Setting up a SLIM app via digital ocean on laravel forge using LEMP stack?

You can set up a digital ocean workflow quite easily in forge for laravel. When I do the same in SLIM it does not work, is there something I am missing to get this working? Would I have to set it up as a custom VPN instead? Preferably need to use LEMP stack as well.

0 likes
15 replies
bobbybouwmann's avatar
Level 88

You can just use the regular way of setting up a project. So Add site. Under Project Type you can select "General PHP / Laravel" and set the Web Directory to "/public". After that you can choose the correct repository and it should be up and running ;)

You of course need to make sure all other dependencies are available and all config is set!

I just installed it in less than a minute on this subdomain: http://slim.markdownmail.com/

1 like
SomeT's avatar
Level 1

In Laravel forge there is no option for add site only add server. I think add site is after you added the server, but do you just do it as digital ocean in this case? Additionally would that not set it up as a LEMP server when what I want is a LAMP server. If you could do more in depth details for me on setup be much appreciated or a video recording or something.

bobbybouwmann's avatar

Yes, you first need the server.

You can do the normal setup with a server using Forge. It will setup a server with PHP, nginx and everything else configured. After that you can add a site and install slim. That should be it ;)

I don't have the time to record a video for you...

1 like
SomeT's avatar
Level 1

Ok no worries, I have done this, I followed the hello world tutorial on the slim site I get the following: No input file specified.

locally using laragon I get:

Warning: require(/vendor/autoload.php): failed to open stream: No such file or directory in C:\laragon\www\myapp\Slim\src\public\index.php on line 5

Fatal error: require(): Failed opening required '/vendor/autoload.php' (include_path='.;C:/laragon/etc/php/pear') in C:\laragon\www\myapp\Slim\src\public\index.php on line 5

my code of index.php is:


<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;

require '../vendor/autoload.php';

$app = new \Slim\App;
$app->get('/hello/{name}', function (Request $request, Response $response, array $args) {
    $name = $args['name'];
    $response->getBody()->write("Hello, $name");

    return $response;
});
$app->run();.

SomeT's avatar
Level 1

Update got it working locally by putting the full path to autoload.php in vendor folder.

As for publically I have no idea... the public environment would have been the one set up by forge.

SomeT's avatar
Level 1

Additionally not sure if 'no input file specified' on the live server is a completely different error to this?

Cronix's avatar

The "public" dir really shouldn't be in the "src" dir. Check the github link @bobbybouwmann showed in his last post for the correct structure.

And in forge, the public dir should be the "web directory"

Edit: you shouldn't mark it as "solved" until you actually get it working. Most people don't look in solved threads unless they have the same problem and are looking for the fix, so they won't see your additional questions...

SomeT's avatar
Level 1

Yeah sorry I kinda got half of it working, why I posted it as solved.

bobbybouwmann's avatar

slimphp is the framework, but slim-skeleton is just a starting setup for your application. Just like laravel/framework is the framework itself but laravel/laravel is the project with some setup that includes the framework ;)

SomeT's avatar
Level 1

So slim-skeleton still contains the framework still right? @bobbybouwmann

And sorry I did ask this elsewhere but no response and I thought as the conversation was on this subject it would be ok to carry on discussing it.

bobbybouwmann's avatar

@SomeT Yes, the skeleton project pulls in the framework. You can see that in the composer.json file ;)

Please or to participate in this conversation.