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

Unable to overload exit in PHP 5.5.14 and PHP 5.4.30 #6

Closed
Vinai opened this issue Jul 24, 2014 · 2 comments
Closed

Unable to overload exit in PHP 5.5.14 and PHP 5.4.30 #6

Vinai opened this issue Jul 24, 2014 · 2 comments

Comments

@Vinai
Copy link

Vinai commented Jul 24, 2014

Test Script:

<?php

if (function_exists('uopz_overload')) {
    if (ini_get('uopz.overloads')) {
        echo "overloading exit()\n";
        uopz_overload(ZEND_EXIT, function(){});
    }
}
exit();

echo "This does not get output despite exit being overloaded.\n";

Output:

% php overload.php 
overloading exit()

Despite uopz being installed and overloads being enabled in php.ini, it simply doesn't work.

PHP Version:

% php --version
PHP 5.5.14 (cli) (built: Jul 22 2014 22:24:54) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

Note I have disabled the opcache zend extension.
Same results happens for php54:

% php --version            
PHP 5.4.30 (cli) (built: Jul 22 2014 21:34:41) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

Do you have any pointers how to debug or fix this?

@kornrunner
Copy link
Contributor

You should load uopz as zend_extension in your ini, eg:

zend_extension=uopz.so

Once you do that, it should show up in php version output:

➜  ~  php -v
PHP 5.5.14 (cli) (built: Jun 25 2014 19:03:14) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with uopz v2.0.4, Copyright (c) 2014, by Joe Watkins <krakjoe@php.net>
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

@Vinai
Copy link
Author

Vinai commented Jul 24, 2014

Thanks! Thats it!

The install via pecl had added it using extension="uopz.so" instead of zend_extension="upoz.so".

@Vinai Vinai closed this as completed Jul 24, 2014
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