0 votes
111 views
in Control panels by
"Why am I getting an error message that 'ext-fileinfo' is missing from my system when trying to install a package in Aapanel, and how can I resolve this issue?"

2 Answers

0 votes
by

The error message that "ext-fileinfo" is missing from your system when trying to install a package in Aapanel, generally occurs because the PHP extension "fileinfo" is not installed or enabled on your server.

"fileinfo" is a built-in PHP extension used to determine the MIME type of a file by looking for certain magic byte sequences at specific positions within the file.

You can resolve this issue by installing and enabling the "fileinfo" extension. The exact steps to do this will depend on your server's operating system and PHP version, but here are some general steps you can follow:

  1. Check if the fileinfo extension is installed, by running the command php -m and look for 'fileinfo' in the list.
     
  2. If it's not listed, install it. On Ubuntu, Debian, and other Debian-based systems, you can install it by running this command: sudo apt-get install php-fileinfo. On Centos, Fedora, and other RedHat-based systems, you can use this command: sudo yum install php-fileinfo.
     
  3. Once it's installed, you need to add extension=fileinfo.so to your PHP configuration file, which is usually located at /etc/php.ini or /etc/php/php.ini
     
  4. Finally, restart your web server for the changes to take effect.
     
  5. after that, you can check that the module is loaded by running php -m | grep fileinfo and it should return 'fileinfo' if it's loaded.

This should resolve the issue of "ext-fileinfo" missing error, and allow you to install the package in Aapanel.

It's always a good idea to take a backup of your current configuration before making any changes, in case something goes wrong.

0 votes
by

Hello, it may be a problem with the detection method, so the prompt is not supported
Due to taking care of the installation of small machines, aapanel uses the disabled fileinfo parameter by default. It may be that the disabled parameter is detected, so the prompt is not supported.
You can use the following command to reinstall php with fileinfo enabled by default
command line execution
#Download php compile and install script
wget http://node.aapanel.com/install/0/php.sh

#Replace disable fileinfo parameter to enable
sed -i "s/--disable-fileinfo/--enable--fileinfo/g" php.sh

#Install php-7.4, if not 7.4, please replace 7.4 with your php version
bash php.sh install 7.4

...