Recent Topics

Notice: Use of undefined constant STDIN (fixed)

started by on Dec 27, 2010 – Last touched: May 09, 2015

Dec 27, 2010 12:23    

My b2evolution Version: Not Entered

My b2evolution Version: 4.0.3

Hi, after do upgrade from 3.3.3 to 4.0.3 my instalation is with very much bugs:

1 - Notice: Use of undefined constant STDIN - assumed 'STDIN' in /home/oigreslima/sergioflima.pro.br/blogs/inc/_core/_misc.funcs.php on line 153

Warning: fclose(): supplied argument is not a valid stream resource in /home/oigreslima/sergioflima.pro.br/blogs/inc/_core/_misc.funcs.php on line 153

Notice: Use of undefined constant STDOUT - assumed 'STDOUT' in /home/oigreslima/sergioflima.pro.br/blogs/inc/_core/_misc.funcs.php on line 154

Warning: fclose(): supplied argument is not a valid stream resource in /home/oigreslima/sergioflima.pro.br/blogs/inc/_core/_misc.funcs.php on line 154

Notice: Use of undefined constant STDERR - assumed 'STDERR' in /home/oigreslima/sergioflima.pro.br/blogs/inc/_core/_misc.funcs.php on line 155

Warning: fclose(): supplied argument is not a valid stream resource in /home/oigreslima/sergioflima.pro.br/blogs/inc/_core/_misc.funcs.php on line 155

2 - In all pages, in foot page this message:

Additional information about this error:

MySQL error!

MySQL server has gone away(Errno=2006)

Your query:

SELECT dom_ID

FROM evo_basedomains

WHERE dom_name = 'sergioflima.pro.br'

And the server after any time is down...

Can anybody help me?

Dec 27, 2010 20:08

As a temporarily solution comment-out the following block in /inc/_core/_misc.funcs.php 145-170

PHP

if( is_callable('pcntl_fork') ) // NOTE: not enabled in php5-fpm (via dotdeb)
{
    if( $pid pcntl_fork() )
        return; // Parent
 
    function shutdown_kill()
    {
        posix_kill(posix_getpid(), SIGHUP);
    }
 
    ob_end_clean(); // Discard the output buffer and close
    fclose(STDIN);  // Close all of the standard
    fclose(STDOUT); // file descriptors as we
    fclose(STDERR); // are running as a daemon.
 
    register_shutdown_function('shutdown_kill');
 
    if( posix_setsid() < )
        return;
 
    if( $pid pcntl_fork() )
        return;     // Parent
 
    // Now running as a daemon. This process will even survive
    // an apachectl stop.
}

ps. I edited the title so it will be easier for other users to find this thread

Dec 28, 2010 10:09

Hi sam2kb

Your solution work for me... thanks

sam2kb wrote:

As a temporarily solution comment-out the following block in /inc/_core/_misc.funcs.php 145-170

ps. I edited the title so it will be easier for other users to find this thread

Dec 30, 2010 05:12

I had the same problem. The fix worked but does it stop any functionality?

Jan 02, 2011 03:08

The fix worked but does it stop any functionality

No

Feb 11, 2011 09:51

Thks sam2kb, I had the same pbm and the fix works for me.

Apr 26, 2011 22:09

I upgraded from 3.3.3 to 4.0.5 and I get same warnings as oigreslima.

I have tried what sam2kb suggested, but nothing changed.

But I also get this error on for line 152
Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete. in ...../inc/_core/_misc.funcs.php on line 152

please advice what to do

Apr 26, 2011 23:50

I have tried what sam2kb suggested, but nothing changed.

Well, the fix I suggested was added in v4.0.4 so you probably have another problem somewhere.
Can you copy the exact error messages you get?

To fix the "No buffer to delete" error edit the code in /inc/_core/_misc.funcs.php on line 152

replace

PHP


with

PHP

if ( ob_get_level() )
{
    ob_end_clean();
}

Apr 27, 2011 21:04

Hi sam2kb
Thanks for rapid response. It worked out with "No buffer to delete"

I get this error message:
Notice: Use of undefined constant STDIN - assumed 'STDIN' in /home1/zreach/public_html/inc/_core/_misc.funcs.php on line 155

Warning: fclose(): supplied argument is not a valid stream resource in /home1/zreach/public_html/inc/_core/_misc.funcs.php on line 155

Notice: Use of undefined constant STDOUT - assumed 'STDOUT' in /home1/zreach/public_html/inc/_core/_misc.funcs.php on line 156

Warning: fclose(): supplied argument is not a valid stream resource in /home1/zreach/public_html/inc/_core/_misc.funcs.php on line 156

Notice: Use of undefined constant STDERR - assumed 'STDERR' in /home1/zreach/public_html/inc/_core/_misc.funcs.php on line 157

Warning: fclose(): supplied argument is not a valid stream resource in /home1/zreach/public_html/inc/_core/_misc.funcs.php on line 157

-It seems to be about same error messages as the first post on this thread. I also thought with version 4.0.5 should fix it, or it is something else..?

cheers

Apr 30, 2011 18:13

Hi

Thanks a lot, it worked out perfectly. I just had to put quotes around STDIN.

like this:
if( is_callable('pcntl_fork') && function_exists('posix_kill') && defined('STDIN') )

thanks again for help!

Apr 13, 2012 11:56

You posted a very helpful information. I could finally fix my challenge. Great work guys

May 07, 2015 06:18

@sam2kb wrote earlier:

As a temporarily solution comment-out the following block in /inc/_core/_misc.funcs.php 145-170

if( is_callable('pcntl_fork') ) // NOTE: not enabled in php5-fpm (via dotdeb)
{
if( $pid = pcntl_fork() )
return; // Parent

function shutdown_kill()
{
posix_kill(posix_getpid(), SIGHUP);
}

ob_end_clean(); // Discard the output buffer and close
fclose(STDIN); // Close all of the standard
fclose(STDOUT); // file descriptors as we
fclose(STDERR); // are running as a daemon.

register_shutdown_function('shutdown_kill');

if( posix_setsid() < 0 )
return;

if( $pid = pcntl_fork() )
return; // Parent

// Now running as a daemon. This process will even survive
// an apachectl stop.
}

ps. I edited the title so it will be easier for other users to find this thread

Thanks sam2kb .thanks you my problem was resolved


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.