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

Missing arginfo with PHP 8 #2356

Closed
jSML4ThWwBID69YC opened this issue Oct 14, 2021 · 3 comments · Fixed by #2391
Closed

Missing arginfo with PHP 8 #2356

jSML4ThWwBID69YC opened this issue Oct 14, 2021 · 3 comments · Fixed by #2391

Comments

@jSML4ThWwBID69YC
Copy link

Hello,

uWSGI with PHP 8 shows the following errors. The errors show up in the php error log.

[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_version() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_setprocname() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_worker_id() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_masterpid() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_signal() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_rpc() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_cache_get() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_cache_set() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_cache_update() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_cache_del() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_cache_clear() in Unknown on line 0
[14-Oct-2021 19:24:25 UTC] PHP Warning:  Missing arginfo for uwsgi_cache_exists() in Unknown on line 0

Simply starting uWSGI with the PHP 8 plugin loaded is enough to trigger this. This does not happen on PHP 7.

System information

OS: FreeBSD 13.0p4
uWSGI: 2.0.20
PHP: PHP 8.0.11 (cli) (built: Oct 7 2021 16:35:42) ( NTS )

uWSGI and plugin build command

make PROFILE=nolang
./uwsgi --build-plugin "plugins/php php"
@jSML4ThWwBID69YC
Copy link
Author

Attempted quick fix. Minimally tested, but does not seem to break anything.

Based off amphp/ext-uv@444acfb

diff --git a/php_plugin.c.orig b/php_plugin.c
index ca0ef6c..00c39b0 100644
--- a/php_plugin.c.orig
+++ b/php_plugin.c
@@ -257,6 +257,9 @@ PHP_MINIT_FUNCTION(uwsgi_php_minit) {
        return SUCCESS;
 }
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
 PHP_FUNCTION(uwsgi_version) {
        RETURN_STRING(UWSGI_VERSION);
 }
@@ -488,20 +491,20 @@ PHP_FUNCTION(uwsgi_signal) {
 }
 
 zend_function_entry uwsgi_php_functions[] = {
-       PHP_FE(uwsgi_version,   NULL)
-       PHP_FE(uwsgi_setprocname,   NULL)
-       PHP_FE(uwsgi_worker_id,   NULL)
-       PHP_FE(uwsgi_masterpid,   NULL)
-       PHP_FE(uwsgi_signal,   NULL)
-
-       PHP_FE(uwsgi_rpc,   NULL)
-
-       PHP_FE(uwsgi_cache_get,   NULL)
-       PHP_FE(uwsgi_cache_set,   NULL)
-       PHP_FE(uwsgi_cache_update,   NULL)
-       PHP_FE(uwsgi_cache_del,   NULL)
-       PHP_FE(uwsgi_cache_clear,   NULL)
-       PHP_FE(uwsgi_cache_exists,   NULL)
+       PHP_FE(uwsgi_version,   arginfo_void)
+       PHP_FE(uwsgi_setprocname,   arginfo_void)
+       PHP_FE(uwsgi_worker_id,   arginfo_void)
+       PHP_FE(uwsgi_masterpid,   arginfo_void)
+       PHP_FE(uwsgi_signal,   arginfo_void)
+
+       PHP_FE(uwsgi_rpc,   arginfo_void)
+
+       PHP_FE(uwsgi_cache_get,   arginfo_void)
+       PHP_FE(uwsgi_cache_set,   arginfo_void)
+       PHP_FE(uwsgi_cache_update,   arginfo_void)
+       PHP_FE(uwsgi_cache_del,   arginfo_void)
+       PHP_FE(uwsgi_cache_clear,   arginfo_void)
+       PHP_FE(uwsgi_cache_exists,   arginfo_void)
        { NULL, NULL, NULL},
 };

vcunat pushed a commit to NixOS/nixpkgs that referenced this issue Dec 26, 2021
unbit/uwsgi#2356
<b>Warning</b>:  Missing arginfo for uwsgi_version() in <b>Unknown</b> on line <b>0</b><br />
github-actions bot pushed a commit to NixOS/nixpkgs that referenced this issue Dec 26, 2021
unbit/uwsgi#2356
<b>Warning</b>:  Missing arginfo for uwsgi_version() in <b>Unknown</b> on line <b>0</b><br />

(cherry picked from commit 0ebda3c)
@gdamjan
Copy link
Contributor

gdamjan commented Dec 29, 2021

this patch needs to be applied to the 2.x branch, to compile against php8.

@xrmx
Copy link
Collaborator

xrmx commented Dec 29, 2021

Please open a PR against master

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

Successfully merging a pull request may close this issue.

3 participants