Getting an error when creating a new laravel project - php

whenever i try to create a new project, i get this error. any ideas on what it might be?
Problem 1
- laravel/framework[v8.75.0, ..., 8.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.x-dev].
- league/flysystem[1.1.0, ..., 1.x-dev] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^8.75 -> satisfiable by laravel/framework[v8.75.0, ..., 8.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\PHP7\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.

Error tells you exactly what's happening.
laravel/framework required flysystem. flysystem requires PHP's fileinfo extension.
That seems to be disabled.
As it states go to your php.ini file (C:\PHP7\php.ini), edit the php.ini file using notepad for example. CTRL+F and search for fileinfo (or extension=php_fileinfo.dll if you want to be thorough).
In front of it should be a semicolon (;) meaning it's commented out and therefore disabled.
Remove the semicolon and go through the steps again. Should work now.

Related

Problem with installation of MongoDB-odm on Symfony 6

I'm stuck with a problem of MongoDb installation.
I'm working with Symfony 6 and PHP 8.1, and i would like integrate in my application mongoDB. I've downloaded the mongoDB image on Docker, and all is working.
The problem
Now, i need to use doctrine for MongoDB. So, follow the documentation , i run composer require doctrine/mongodb-odm-bundle and also composer require doctrine/mongodb-odm . For the first command, i get the following errors:
Problem 1
- doctrine/mongodb-odm-bundle[4.3.0, ..., 4.3.1] require doctrine/persistence ^1.3.6|^2.0 -> found doctrine/persistence[1.3.6, 1.3.7, 1.3.8, 2.0.0, ..., 2.5.7] but it conflicts with your root composer.json require (^3.1).
- doctrine/mongodb-odm-bundle[4.4.0, ..., 4.5.2] require ext-mongodb ^1.5 -> it is missing from your system. Install or enable PHP's mongodb extension.
- Root composer.json requires doctrine/mongodb-odm-bundle ^4.3 -> satisfiable by doctrine/mongodb-odm-bundle[4.3.0, ..., 4.5.2].
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php8\php.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-mongodb to temporarily ignore these required extensions.
And for the second one:
You are running Composer with SSL/TLS protection disabled.
Using version ^1.0 for doctrine/mongodb-odm
Running composer update doctrine/mongodb-odm
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/mongodb-odm[1.0.0, ..., 1.0.8] require symfony/console ~2.3|~3.0 -> found symfony/console[v2.3.0, ..., v2.8.52, v3.0.0, ..., v3.4.47] but it conflicts with your root composer.json require (6.2.*).
- doctrine/mongodb-odm[1.1.0, ..., 1.3.7] require php ^5.6 || ^7.0 -> your php version (8.1.11) does not satisfy that requirement.
- Root composer.json requires doctrine/mongodb-odm ^1.0 -> satisfiable by doctrine/mongodb-odm[1.0.0, ..., 1.3.7].
As you can see, in the first error message he trying to say me that i have some packages not compatible with the installation of mongo's extension. In the second, with the default command installation, he's trying to install 1.0 version instead 2.4.*!
What i've tried?
So, i tried to 'force' the installation. I've insert "doctrine/mongodb-odm": "^2.4.0" in the composer.json , followed by composer update doctrine/mongodb-odm and i still get the error:
Problem 1- Root composer.json requires doctrine/mongodb-odm ^2.4.0 -> satisfiable by doctrine/mongodb-odm[2.4.0, 2.4.1, 2.4.2, 2.4.3].
- doctrine/mongodb-odm[2.4.0, ..., 2.4.3] require ext-mongodb ^1.5 -> it is missing from your system. Install or enable PHP's mongodb extension.
What i suppose?
Maybe can be the extension of mongo DB in the php.ini file, but i ve installed mongoDB also on windows and added the extension in the php.ini file, but nothing is changed.
Any ideas?
Thx
The problem was the MongoDB drivers. So, what i did is:
Download the MongoDB package with DLL included.
Copy the DLL extension of Mongo inside php/ext folder
execute pecl install mongodb
For the next, follow this Documentation.

Trying to composer update this error came up on CentOs

I'm trying to deploy my laravel project on CentOs system. When im going to run composer update command i am encountering this error. I can't figure out the solution and I saerched for soloution in this platform. I found for windows but not work on my CentOs system.
Soliton for windows;
I am going to add this line in php.ini file: extension=php_fileinfo.dll but didn't work.
Error Message;
Continue as root/super user [yes]? yes
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v8.12.0, ..., 8.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.x-dev].
- league/flysystem[1.1.0, ..., 1.x-dev] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^8.12 -> satisfiable by laravel/framework[v8.12.0, ..., 8.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- /opt/cpanel/ea-php74/root/etc/php.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-bcmath.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-calendar.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-ctype.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-curl.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-dom.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-ftp.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-gd.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-iconv.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-imap.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-json.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-mbstring.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-mysqlnd.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-pdo.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-phar.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-posix.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-simplexml.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-sockets.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-sqlite3.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-tokenizer.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-xml.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-xmlwriter.ini
- /opt/cpanel/ea-php74/root/etc/php.d/20-xsl.ini
- /opt/cpanel/ea-php74/root/etc/php.d/30-mysqli.ini
- /opt/cpanel/ea-php74/root/etc/php.d/30-pdo_mysql.ini
- /opt/cpanel/ea-php74/root/etc/php.d/30-pdo_sqlite.ini
- /opt/cpanel/ea-php74/root/etc/php.d/30-xmlreader.ini
- /opt/cpanel/ea-php74/root/etc/php.d/zzzzzzz-pecl.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
One of your required package need a specific php extension in your CentOs system.
See the 2nd line error message thrown by composer update
- league/flysystem[1.1.0, ..., 1.x-dev]
require ext-fileinfo * -> it is missing from your system.
Install or enable PHP's fileinfo extension.
Please enable this missing php extension by uncomment it from inside your CentOs php.ini
The missing extension is ext-fileinfo
Note: also a good idea to run "composer install" when deploying your project in new environment, to minimize sudden package version updated that might trigger installation issues.
Also dont forget to upload your composer.lock as well.
Have a look at documentation here:
https://laravel.com/docs/9.x/deployment#autoloader-optimization

My new Laravel project doesn't start correctly

I'm using windows 10 and I'm totally new in Laravel and PHP
I installed php, composer, node, npm and Laravel and wrote my first command in powershell
laravel new myNewSite
Then I got this error, I don't know what is it:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v8.65.0, ..., 8.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, ..., 1.x-dev].
- league/flysystem[1.1.0, ..., 1.x-dev] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^8.65 -> satisfiable by laravel/framework[v8.65.0, ..., 8.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\Program Files\php-8.0.13\php.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
I looked for a solution and I came up with deleting the beginning ; in extension=fileinfo in php.ini-development and php.ini-production files but nothing changed, the same error still exists. So what should I do?
I solved the problem
I copied my file path
C:\Program Files\php-8.0.13\php.ini
I pasted it in the explorer bar
PHP file Notepad came up in the screen
I looked for ;extension=fileinfo and found it
I deleted the beginning ;
I saved the file
that's it guys!

composer require mgp25/instagram-php react/child-process (Not Working)

When I run the command in my Windows command prompt composer require mgp25/instagram-php react/child-process all I get is:
Problem 1
- mgp25/instagram-php v7.0.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- mgp25/instagram-php v7.0.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- Installation request for mgp25/instagram-php ^7.0 -> satisfiable by mgp25/instagram-php[v7.0.0, v7.0.1].
To enable extensions, verify that they are enabled in your .ini files:
- C:\Users\bill\Desktop\PHP\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
How do I fix this?
open this file "C:\Users\bill\Desktop\PHP\php.ini" with any editor
find this line ";extension=gd2" (Ctrl+F)
remove ";" and save it

Your requirements could not be resolved to an installable set of packages for laravel

I use 5.7v Laravel and 7.2.1v PHP and composer last version, but when I like to create new project these errors appeared:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for league/flysystem 1.0.47 -> satisfiable by league/flysystem[1.0.47].
- league/flysystem 1.0.47 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
Problem 2
- league/flysystem 1.0.47 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- laravel/framework v5.7.9 requires league/flysystem ^1.0.8 -> satisfiable by league/flysystem[1.0.47]. 0
- Installation request for laravel/framework v5.7.9 -> satisfiable by laravel/framework[v5.7.9].
To enable extensions, verify that they are enabled in your .ini files:
- C:\php-7\php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.`
First of all, stop the XAMPP/Wamp and then kindly remove the starting semicolon ( ; ) from your xampp\php\php.ini the following code.
;extension=fileinfo
or in windows with IIS
extension=php_fileinfo.dll
And then restart your XAMPP/Wamp.
NOTE: For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder).
The problem seems to be what the error message says - your system is missing fileinfo PHP extension.
Since you're on Windows, open C:\php-7\php.ini file, search for the following line, and remove the beginning ; if exists:
extension=fileinfo
or in windows with IIS
extension=php_fileinfo.dll
Just uncomment extension=fileinfo in php.ini it worked for me even without xampp
In my case I just uncomment extension=fileinfo in php.ini then it works
In my case, I had both installed PHP and XAMPP and in my path, i pointed at C:/php/as the PHP interpreter. In C:/php/php.ini, it was ;extension=fileinfo whereas in C:/xampp/php/php.ini it was extension=fileinfo. I did two changes,
Deleted C:/php/
Changed my path to PHP to point to c:/xampp/php/
The problem is now resolved
Simple soultion, just delete php 7.4.11 folder from C drive.
update php location from C:\php 7.4.11 to C:\xampp\php in path variable under environmental variable
in my case i am using window machine ...my league/flysystem is missing ..
type this command in cmd on project Dir..
composer require league/flysystem
for mine case its work...

Categories