easy-swoole / easyswoole

swoole,easyswoole,swoole framework
https://www.easyswoole.com/
Apache License 2.0
4.74k stars 510 forks source link

Serving an existing application #222

Closed juberjj closed 5 years ago

juberjj commented 5 years ago

Hi there,

Quick and probably silly question but I'm having some issues serving a PHP app with easyswoole. Have installed everything changed the port to accommodate my configurations but the only thing I get is the Snoopy page. Where can I set the App folder like it would be for swooletw?

Many thanks in advance.

xuanyanwow commented 5 years ago

You can see "https://www.easyswoole.com/En/Introduction/install.html" The "Hello World" module.

Then update the composer.json file in the root directory to register the application's namespace.

    "autoload": {
        "psr-4": {
            "App\\": "App/"
        }
    },

At last, run composer dumpautoload command in the prompt. The framework now can automatically load the files in the App directory, so you can start writing the business logic at this stage.

kiss291323003 commented 5 years ago

fix close

juberjj commented 5 years ago

Apologies for my delay on that. I'll try the suggested method and post a feedback. My project tree is slightly different but the concept should be the same I guess. Project public app fileA fileB ...

I serve the entire public folder.

juberjj commented 5 years ago

@xuanyanwow

Based on my folder structure that's what I get

Fatal error: Uncaught ReflectionException: Class App\Console\Kernel does not exist in /engage-web/vendor/laravel/framework/src/Illuminate/Container/Container.php:790 Stack trace:

my index.php is inside public.

If I use php artisan serve all is served accordingly.

Could you please assist on this?

Many thanks