• Support
  • PHP 8.1 PHP Startup: fileinfo: Unable to initialize module

aaP_nhatki888
hello, do you have multiple php installed? 20190902 is php7.4, 20210902 is php8.1
Try it out here:

Then execute the command to cancel the php alias: unalias php && php -v

aaP_nhatki888
Hello, try to execute the following command to see if the configuration file is correct:
ls -al /usr/bin/php
cat /www/server/php/81/etc/php-cli.ini |grep fileinfo
cat /www/server/php/81/etc/php.ini |grep fileinfo

The correct path is: extension=/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so

If it is normal, please go to the panel to reset "PHP CLI Version" to PHP-81
Execute the command again:
php -v

    6 months later

    I have the same problem. Please help me solve it. Thank you.
    root@cd13de9e:~# cat /www/server/php/81/etc/php-cli.ini |grep fileinfo
    ;extension=fileinfo
    extension = /www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so
    root@cd13de9e:~# cat /www/server/php/81/etc/php.ini |grep fileinfo
    ;extension=fileinfo
    extension = /www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so
    root@cd13de9e:~# php -v
    PHP Warning: PHP Startup: fileinfo: Unable to initialize module
    Module compiled with module API=20190902
    PHP compiled with module API=20210902
    These options need to match
    in Unknown on line 0
    PHP Warning: PHP Startup: redis: Unable to initialize module
    Module compiled with module API=20190902
    PHP compiled with module API=20210902
    These options need to match
    in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library '/www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/igbinary.so' (tried: /www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/igbinary.so (/www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/igbinary.so: undefined symbol: zend_class_unserialize_deny), /www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902//www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/igbinary.so.so (/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902//www/server/php/74/lib/php/extensions/no-debug-non-zts-20190902/igbinary.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library 'xlswriter.so' (tried: /www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/xlswriter.so (/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/xlswriter.so: cannot open shared object file: No such file or directory), /www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/xlswriter.so.so (/www/server/php/81/lib/php/extensions/no-debug-non-zts-20210902/xlswriter.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    PHP 8.1.12 (cli) (built: Nov 12 2022 07:08:17) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.1.12, Copyright (c) Zend Technologies
    root@cd13de9e:~# uname -a
    Linux cd13de9e 5.15.0-50-generic #56-Ubuntu SMP Tue Sep 20 13:23:50 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
    root@cd13de9e:~#

      10 months later
      Connect with us: 📨 Telegram 💬 Discord Email: support@aapanel.com