flipboxstudio / lumen-generator

A Lumen Generator You Are Missing
https://packagist.org/packages/flipbox/lumen-generator
MIT License
822 stars 126 forks source link

Failed opening required 'server.php' #32

Closed Synchro closed 6 years ago

Synchro commented 6 years ago

The fix for #30 broke my setup after the 5.6 upgrade - I don't have a server.php, but I do have a public folder, so this part of the change broke it. I've not found any docs on server.php - is it something I'm supposed to have? The 5.6 docs suggest that a public folder is normal, e.g. in https://lumen.laravel.com/docs/5.6#configuration

nox-xou commented 6 years ago

my temporary fix. edit: LumenGenerator\Console\ServeCommand.php

protected function serverCommand()
{
    if(file_exists("base_path()/server.php")) {
        $command = '%s -S %s:%s %s/server.php';
    } else {
        $command = '%s -S %s:%s -t %s/public/';
    }

    return sprintf($command,
        ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)),
        $this->host(),
        $this->port(),
        ProcessUtils::escapeArgument(base_path())
    );
}
joelhy commented 6 years ago

Fixed in release 5.6.1