requires ext-fileinfo. How do I add that into my composer.json file?
Nothing to do with your composer.json.
You need to install & enable FileInfo PHP extension, which is installed by default starting with PHP 5.3.0. Versions prior to 5.3+ may use the discontinued PECL extension.
To enable FileInfo extension, you need to edit your php.ini and change a single line.
Locate the line:
;extension=php_fileinfo.dll
Remove the starting comment:
extension=php_fileinfo.dll
To find out where your php.ini is located, you can run the following command from a terminal:
$ php --ini
and search for "Loaded Configuration File".
Please note that the PHP CLI can load a different php.ini file than the web, so don't rely on the path provided in phpinfo()
. Run the command specified above in a terminal to find out the file loaded by PHP CLI.
Trying to create new Laravel project this error came up
I found the answer,
the problem was that I was removing ; before extension = fileinfo from php.ini inside PHP folder in xampp folder "c:/xampp/php/"
but I didn't remove it from "c:/php/php.ini".
Composer error: PHP extension fileinfo is missing from your system
Apparently it is because there are separate php.ini
files for web/apache and CLI and as composer uses the CLI and phpinfo() uses the main php.ini
the problem occurs.
If you run php -m
in CLI and don't see the module's name you should find the CLI php.ini
(in my case php-cli.ini
and add the extension. e.g. extension=php_fileinfo.dll
Laravel php artisan serve not doing anything and project not being created properly (windows 10)
You can solve the problem by editing your php.ini
file in your Windows, following these steps :
- Press the Windows logo (bottom left)
- Type Notepad on the search field
- Click right on the Notepad and select "Run as administrator"
- From Notepad, click on "File", then "Open" and paste the path of your php.ini file in the address bar (my case was
C:\Program Files\PHP\v7.4\php.ini
) - When your file is open in your Notepad as administrator, remove the
;
before the lineextension=php_fileinfo.dll
. If you can't find this line, then simply add it after the others php extension. - Save
- Restart your computer
- Try again
Related Topics
Using Password_Hash and Password_Verify
Can't Pass MySQLi Connection in Session in PHP
How to Count Unique Visitors to My Site
How to Copy a File from One Directory to Another Using PHP
How to Loop Through $_Files Array
PHP Function Ssh2_Connect Is Not Working
How to Retrieve the Full Directory Tree Using Spl
Fix Malformed Xml in PHP Before Processing Using Domdocument Functions
Using PHP to Populate a <Select></Select> Dropdown
Laravel Request::All() Should Not Be Called Statically
Bounce Email Handling with PHP
Is PHP's Count() Function O(1) or O(N) for Arrays