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

Maximum function nesting level reached on (new Swoole\Coroutine\MySQL())->connect() #1064

Closed
kfreiman opened this issue Feb 1, 2017 · 2 comments

Comments

@kfreiman
Copy link

kfreiman commented Feb 1, 2017

<?php
use Swoole\Http\Server;
$server = new Server('127.0.0.1', 9501);
var_dump(phpversion());
var_dump(SWOOLE_VERSION);

$server->on('Request', function($request, $response) use ($server) {
    $swoole_mysql = new Swoole\Coroutine\MySQL();
    $connected = $swoole_mysql->connect([
        'host' => '127.0.0.1',
        'user' => 'myuser',
        'password' => 'mypass',
        'database' => 'test',
    ]);

    if (!$connected) {
        echo 'connection failed!';
    }
    $res = $swoole_mysql->query('select sleep(1)');
});

$server->start();

Extention configured by

./configure --with-php-config=/usr/bin/php-config --enable-coroutine 

Result of executing php ./http_server.php:

/home/kirill/sites/swoole/http_server.php:4:
string(22) "7.0.8-0ubuntu0.16.04.3"
/home/kirill/sites/swoole/http_server.php:5:
string(5) "2.0.5"
PHP Fatal error:  Maximum function nesting level of '256' reached, aborting! in /home/kirill/sites/swoole/http_server.php on line 7
PHP Stack trace:
PHP   1. {main}() /home/kirill/sites/swoole/http_server.php:0
PHP   2. Swoole\Http\Server->start() /home/kirill/sites/swoole/http_server.php:22
PHP   3. {closure:/home/kirill/sites/swoole/http_server.php:7-20}() /home/kirill/sites/swoole/http_server.php:0
PHP   4. Swoole\Coroutine\MySQL->connect() /home/kirill/sites/swoole/http_server.php:10
....
PHP 255. {closure:/home/kirill/sites/swoole/http_server.php:7-20}() /home/kirill/sites/swoole/http_server.php:0
PHP 256. Swoole\Coroutine\MySQL->connect() /home/kirill/sites/swoole/http_server.php:10
[2017-02-01 16:32:43 *24120.3]  ERROR   zm_deactivate_swoole (ERROR 503): Fatal error: Maximum function nesting level of '256' reached, aborting! in /home/kirill/sites/swoole/http_server.php on line 7.
[2017-02-01 16:32:43 $24112.0]  WARNING swManager_check_exit_status: worker#3 abnormal exit, status=255, signal=0

Is it bug, or i doing somethung wrong?

@matyhtf
Copy link
Member

matyhtf commented Feb 2, 2017

Have you installed the xdebug extension?
Try turn off xdebug extension.

@kfreiman
Copy link
Author

kfreiman commented Feb 2, 2017

Yes, disabling xdebug (at /etc/php/7.0/mods-available/xdebug.ini in my case) solved this problem. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants