How to Enable PHP Fileinfo Extensions?

Andrei Iordache

Andrei Iordache

WordPress Developer

🚀 I Help People Get Found Online | WordPress Development, Core Web Vitals, Security&Maintenance

What is FileInfo PHP file?


The FileInfo PHP file is a small, open source library that provides a set of functions and objects to deal with file information. It is often used with WordPress CMS in order to manage various types of file types, such as audio, video, images, documents, and other file types.

FileInfo allows WordPress CMS to recognize many common file types, and it can help accurately identify the type of a file. This is useful for websites that often require images, audio, video, or other types of files to be uploaded.

The FileInfo library can be installed with the command line, the installer, and most PHP distributions, including those used by WordPress CMS.

How to enable PHP FileInfo Extension?


Below we will talk about PHP 8, but it can be applied to PHP 7.xx.

So, to enable the PHP Fileinfo extension on WordPress when using PHP 8, you will need to follow these steps:

1. Open your WordPress site’s wp-config.php file in a text editor.

2. Add the following line of code to the file, just above the line that says /* That’s all, stop editing! Happy publishing. */:

// Enable PHP Fileinfo extension
if (PHP_MAJOR_VERSION >= 8) {
dl('php_fileinfo.so');
}

3. Save the wp-config.php file and upload it to your web server.

4. Restart your web server for the changes to take effect.

After following these steps, the PHP Fileinfo extension should be enabled on your WordPress site when using PHP 8.

How to enable PHP FileInfo extension in cPanel?


To enable the PHP Fileinfo extension in cPanel, you will need to follow these steps:

  1. Log in to your cPanel account.
  2. In the “Software” section, click on the “Select PHP Version” icon.
  3. In the “PHP Extensions” section, select the “Fileinfo” extension from the list and click on the “Save” button.
  4. The Fileinfo extension should now be enabled on your server.
  5. If you have any PHP scripts that require the Fileinfo extension, you may need to restart your web server for the changes to take effect.

After following these steps, the PHP Fileinfo extension should be enabled on your server and available to your PHP scripts.

How to enable PHP FileInfo extension XAMPP?


To enable the PHP Fileinfo extension on XAMPP, you will need to follow these steps:

  1. Open the XAMPP Control Panel on your computer.
  2. Click on the “Config” button next to the Apache row, and then select the “PHP (php.ini)” option.
  3. In the PHP configuration file that opens, search for the following line:
  4. ;extension=fileinfo
  5. Remove the ; character at the beginning of the line to uncomment it and enable the Fileinfo extension. The line should now look like this:
  6. extension=fileinfo
  7. Save the PHP configuration file and close it.
  8. Restart the Apache web server in the XAMPP Control Panel for the changes to take effect.

After following these steps, the PHP Fileinfo extension should be enabled on your XAMPP installation and available to your PHP scripts.

Submit Your Guest Post

Previous Post
15 Steps to install and configure WordPress on your server
Next Post
Tips to Boost the User Experience (UX) on Your Business Website
Lusi StudiosLusi Studios
15:32 22 Jun 22
Andrei did an amazing job! He helped in a very rushed time and he excelled at everything. Thanks again!
I am grateful and I would to thank Websites Seller for their support in site recovery and site transfer. Websites Seller just saved my business. Thank you!
Wouter GhysensWouter Ghysens
11:52 10 Sep 21
Looking for a Wordpress transfer from site A to site B, I found back Andrei from Wesites Seller on Google.He was very proactive in his approach, came with hundreds of ideas and lifetime experiences from other migrations. He knows the wordpress, the hosting and php database as the back of his pocket.And we worked out this migration very smooth. Together we solved it, and myself and my business are very pleased with his approach.100% recommendation & kudo's from out of Belgium!
Ioachim CiobanuIoachim Ciobanu
18:39 14 Jul 21
Websites Seller built my resume site. Deliverables were quickly completed, and I was asked for my feedback at each stage of development. All feedback I gave was implemented in a short time.Another great thing is that he comes with smart solutions, regarding stuff which I didn't initially think of (site security, Google site speed optimization and so on). Basically, he was great, staying in touch, keeping me updated and paid attention to what was most important for my site.Overall, I am very happy with the work done. I highly recommend this developer!
K CollinsK Collins
09:11 19 May 21
I needed help with website speed - to improve my core web vitals - without compromising the usability of my site. Andrei was extremely responsive, proactive and fast. And more importantly, he increased by website speed. Highly recommend him, and I will be using him going forward on all my projects.
js_loader

Submit Your Guest Post

Services

WordPress Website Maintenance Services

WordPress Maintenance Services

WordPress website maintenance service that provides cloud backups, emergency support, weekly website updates, speed and many more.

sally

WordPress Migration Service

Safely transfer your WordPress website to a new location for $75. … Migrate your website to its new host.

lawyer-office

Lawyer Web Design

We specializes in website design, Internet marketing and SEO for lawyers and attorneys throughout the Europe and US.