Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 on visiting http://127.0.0.1:1215 #67

Closed
ctf0 opened this issue May 29, 2018 · 6 comments
Closed

404 on visiting http://127.0.0.1:1215 #67

ctf0 opened this issue May 29, 2018 · 6 comments

Comments

@ctf0
Copy link

ctf0 commented May 29, 2018

  1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)
PHP 7.2.6 (cli) (built: May 25 2018 06:16:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies
swoole

swoole support => enabled
Version => 2.2.0
Author => tianfeng.han[email: mikan.tenny@gmail.com]
coroutine => enabled
kqueue => enabled
rwlock => enabled
async http/websocket client => enabled
pcre => enabled
zlib => enabled

Directive => Local Value => Master Value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_namespace => On => On
swoole.use_shortname => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
  1. Please provide your Laravel/Lumen version.
    Laravel Framework 5.5.40

  2. Which release version of this package are you using?
    v2.3.9

  3. What did you do? If possible, provide a recipe for reproducing the error.

  • pecl install swoole
  • php -m | grep swoole
  • install the package
  • update config
'server' => [
        'host'        => env('SWOOLE_HTTP_HOST', '127.0.0.1'),
        'port'        => env('SWOOLE_HTTP_PORT', '1215'),
        'public_path' => base_path('public'),
        // Determine if to use swoole to respond request for static files
        'handle_static_files' => env('SWOOLE_HANDLE_STATIC', true),
        'options'             => [
            'pid_file'              => env('SWOOLE_HTTP_PID_FILE', base_path('storage/logs/swoole_http.pid')),
            'log_file'              => env('SWOOLE_HTTP_LOG_FILE', base_path('storage/logs/swoole_http.log')),
            'daemonize'             => env('SWOOLE_HTTP_DAEMONIZE', false),
            // Normally this value should be 1~4 times larger according to your cpu cores.
            'reactor_num'     => env('SWOOLE_HTTP_REACTOR_NUM', swoole_cpu_num()),
            'worker_num'      => env('SWOOLE_HTTP_WORKER_NUM', swoole_cpu_num()),
            'task_worker_num' => env('SWOOLE_HTTP_TASK_WORKER_NUM', swoole_cpu_num()),
            // The data to receive can't be larger than buffer_output_size.
            'package_max_length' => 20 * 1024 * 1024,
            // The data to send can't be larger than buffer_output_size.
            'buffer_output_size' => 10 * 1024 * 1024,
            // Max buffer size for socket connections
            'socket_buffer_size' => 128 * 1024 * 1024,
            // Worker will restart after processing this number of request
            'max_request' => 3000,
            // Enable coroutine send
            'send_yield' => true,
            // You must add --enable-openssl while compiling Swoole
            'ssl_cert_file' => null,
            'ssl_key_file'  => null,
        ],
    ],
  • php artisan swoole:http start
  • go to http://127.0.0.1:1215/
  1. What did you expect to see?
    something else other than 404

  2. What did you see instead?
    404

Notes

Ps
is it possible to get swoole to work with valet ?

@albertcht
Copy link
Member

Hi @ctf0 ,

The information is a little bit less for me to tell what caused a 404 response. Can you provide more detail about your code? That would be better if you can provide a repo which can reproduce your issue.

@ctf0
Copy link
Author

ctf0 commented May 29, 2018

its a project am working on and its not easy to upload the whole thing,
but on the other hand, is there a way i could debug this from my end ?

  • like what might be the reasons ?
  • are there any configs that needs to be changed ?
  • does the ext needs to be downloaded with specific options atm i just use no for all

@albertcht
Copy link
Member

it's not easy to upload the whole thing.

Actually you don't need to upload your whole project. You can try to reproduce it in a clean laravel.

is there a way i could debug this from my end?

There's a Debug Guideline in wiki.

like what might be the reasons ?

It may caused by your third-party packages or anywhere in your code. I don't have any clues for limited information.

are there any configs that needs to be changed ?

No.

does the ext needs to be downloaded with specific options?

No. Default options are okay.

@ctf0
Copy link
Author

ctf0 commented May 29, 2018

Actually you don't need to upload your whole project. You can try to reproduce it in a clean laravel.

i'll do just that then, btw is it necessary to add the nginx config ?
or would it work with the default brew install nginx

@albertcht
Copy link
Member

Nginx is acting as a proxy server in production environment. You can just access http://127.0.0.1:1215 directly while in develop.

@ctf0
Copy link
Author

ctf0 commented May 29, 2018

hi again, tested on new laravel and its working without issues.

but i dont understand why with normal serve its working and with swoole its giving a 404 😢.

still thanx for ur help 🏆

@ctf0 ctf0 closed this as completed May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants