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

PHP8.1 compatibility #20

Open
tsegarra opened this issue Sep 27, 2022 · 2 comments
Open

PHP8.1 compatibility #20

tsegarra opened this issue Sep 27, 2022 · 2 comments

Comments

@tsegarra
Copy link

I'm trying to install this extension with PHP8.1 on macOS 12.6. All the provided tests fail. It appears the INI variables aren't being read properly, either for testing or for normal use. I get the following warnings:

Warning: [TOMBS] Failed to allocate shared memory for graveyard in Unknown on line 0
Warning: fsockopen(): Unable to connect to 127.0.0.1:8010 (Connection refused)

The tests pass if I hard-code the INI values in the extension code, or if I use PHP7.4.

Is this expected behavior? If so, I can submit a PR updating the README with the supported PHP version range. If not, let me know what other info I can provide.

@tsegarra
Copy link
Author

This appears to have been caused by a change in how ini entries are registered. It was introduced here: php/php-src#8435

A workaround is to use the old function, modifying line 126 of zend_tombs_ini.c as follows:

-    zend_register_ini_entries(ini_entries, -1);
+    zend_register_ini_entries_ex(ini_entries, -1, -1);

After that, all tests pass on PHP8.1. I'm not familiar enough with zend extensions to know whether this is a good practice, but I suspect it isn't. If it is, I can make a proper PR.

@radykal-com
Copy link

radykal-com commented Oct 21, 2022

Any chance to get this fixed?

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