On 04/02/2022 21:20, Xavier Humbert wrote:
Hi,

I recently upgraded my whole php stuff from 7.3 to 8.0 via portupgrade

All went flawlessly. But when I want to start php-fpm, I got this error about which Google knows nothing :

[root@numenor php80]# service php-fpm restart
Performing sanity check on php-fpm configuration:
<br />
<b>Fatal error</b>:  Duplicate parameter name $oldstate for function smbclient_rename() in <b>Unknown</b> on line <b>0</b><br />
I eventually grepped the whole /usr/local/etc AND /usr/local/www directories for this parameter with no success

Where the hell does this come from ? Samba, obviously, a grep in /usr/local/lib/php matches in smbclient.so

Also, libsbmclient-php sources show this parameter twice :
https://github.com/eduardok/libsmbclient-php/blob/master/smbclient.c#L189

But how fix this, any idea May I fill a PR ?

This is just a wild guess but I thing there is something wrong with your pecl-smbclient extension. The Fatal error is from loading this extension at the start of php-fpm and not from calling some function in any PHP script.

There is a source code where it is really twice oldstate and twice oldpath
https://github.com/eduardok/libsmbclient-php/blob/master/smbclient.c#L189

ZEND_BEGIN_ARG_INFO(arginfo_smbclient_rename, 0)
        ZEND_ARG_INFO(0, oldstate)
        ZEND_ARG_INFO(0, oldpath)
        ZEND_ARG_INFO(0, oldstate)
        ZEND_ARG_INFO(0, oldpath)
ZEND_END_ARG_INFO()

I am not a C programmer but it seems wrong to me, because PHP function smbclient_rename takes 4 different parameters:

smbclient_rename ( resource $state_old, string $uri_old, resource $state_new, string $uri_new )

I will expect something like this:

ZEND_BEGIN_ARG_INFO(arginfo_smbclient_rename, 0)
        ZEND_ARG_INFO(0, oldstate)
        ZEND_ARG_INFO(0, oldpath)
        ZEND_ARG_INFO(0, newstate)
        ZEND_ARG_INFO(0, newpath)
ZEND_END_ARG_INFO()

But I don't know if this will fix it or destroy the whole universe.

Miroslav Lachman

Reply via email to