Getting an error on creating of a laravel project - php

Hi There im trying to create a project using laravel, but i get this error when doing it.
PS X:\projects> composer create-project laravel/laravel MuxlyRadio
Installing laravel/laravel (v8.5.12)
- Installing laravel/laravel (v8.5.12): Extracting archive
Created project in X:\projects\MuxlyRadio
Loading composer repositories with package information
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:
- C:\Program Files (x86)\PHP\v7.4\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
PS X:\projects>
anyone any idea how to fix this?

Open your php.ini and enable PHP's fileinfo extension by uncommenting :
extension=php_fileinfo.dll
Depending your os you can find info writing in your index.php or somewhere to learn more
phpinfo();

Related

Problem creating a new laravel project "Your requirements could not be resolved to an installable set of packages."

I'm trying to create new laravel project, but it says the following when I run laravel new laragigs
Creating a "laravel/laravel" project at "./laragigs"
Installing laravel/laravel (v9.5.2)
- Installing laravel/laravel (v9.5.2): Extracting archive
Created project in C:\Users\Omistaja\Desktop/laragigs
> #php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v9.36.4, ..., v9.51.0] require league/flysystem ^3.8.0 -> satisfiable by league/flysystem[3.8.0, ..., 3.12.2].
- laravel/framework[v9.19.0, ..., v9.36.3] require league/flysystem ^3.0.16 -> satisfiable by league/flysystem[3.0.16, ..., 3.12.2].
- league/flysystem[3.0.16, ..., 3.12.2] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.11.0].
- league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.2.2) does not satisfy that requirement.
- league/mime-type-detection[1.4.0, ..., 1.11.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^9.19 -> satisfiable by laravel/framework[v9.19.0, ..., v9.51.0].
To enable extensions, verify that they are enabled in your .ini files:
- C:\Program Files\php\php-8.2.2-nts-Win32-vs16-x86\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.
PS C:\Users\Omistaja\Desktop>
What hould I do?
Adding the extension=php_fileinfo.dll to php.ini worked.

Magento installation not working after editing php.ini

I tried to install Magento 2.4.5 on windows I am using windows 8.1 by the way and I downloaded xampp8.1.12, composer 2.4.4, and when I typed this command
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition
I got this error :
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires magento/product-community-edition 2.4.5-p1 -> satisfiable by magento/product-community-edition[2.4.5-p1].
- magento/product-community-edition 2.4.5-p1 requires ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
Problem 2
- magento/magento2-functional-testing-framework[3.7.0, ..., 3.12.0] require ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
- Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, ..., 3.12.0].
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files PHP uses in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-intl` to temporarily ignore these required extensions.
The strange thing is that I removed the comma from all of these extensions in the php.ini file:
extension=gd
extension=intl
extension=soap
extension=sockets
extension=sodium
extension=xsl
and I still have the same error
and by the way, when I restart xampp I get this error:
The Procedure entry point crypto_core_ristretto255_scalar _ reduce could not be located in the dynamic link library C:\xampp8.1\php\ext\php_sodium.dll
I tried running this command
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition
but it didn't work
Please make sure below all extensions are enabled in php.ini
sodium
ext-bcmath
ext-ctype
ext-curl
ext-dom
ext-gd
ext-hash
ext-iconv
ext-intl
ext-mbstring
ext-openssl
ext-pdo_mysql
ext-simplexml
ext-soap
ext-xsl
ext-zip
ext-sockets

I tried to run server on my laravel file is having issues with vendor/autoload.php on Windows

When i type "php atisan",it prints:
PHP Warning: require(C:\Windows\System32\myproject\learn/vendor/autoload.php): Failed to open stream: No such file or directory in C:\Windows\System32\myproject\learn\artisan on line 18
PHP Fatal error: Uncaught Error: Failed opening required 'C:\Windows\System32\myproject\learn/vendor/autoload.php' (include_path='.;C:\php\pear') in C:\Windows\System32\myproject\learn\artisan:18
Stack trace:
#0 {main}
thrown in C:\Windows\System32\myproject\learn\artisan on line 18
I type "composer update --no-scripts" it prints:
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[v9.11.0, ..., 9.x-dev] require league/flysystem ^3.0 -> satisfiable by league/flysystem[3.0.0, ..., 3.x-dev].
- league/flysystem[3.0.0, ..., 3.x-dev] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.11.0].
- league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.1.5) does not satisfy that requirement.
- league/mime-type-detection[1.4.0, ..., 1.11.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^9.11 -> satisfiable by laravel/framework[v9.11.0, 9.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\PHP\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.
if your project doesn't have a vendor folder try to install composer via composer install, if vendor folder exist and some required modules are missing you should have to update the composer via composer update
after you are done with composer, should have a environment file, the default environment file will be named as .env.example. you have to rename it as .env
when you have an enviroment file in your project laravel requered to have a application key inorder to start the development key, so you will be able to generate on via php artisan key:generate
you are ready to start the development server via php artisan serve, which will starts the development server on port 8000. if the port 8000 not work on your server you can start the development server with other ports via php artisan serve --port=45600
TL;DR;
Make sure your server has all requirements needed to run your version of Laravel.
Long Answer:
Composer is giving you clear instructions of what is wrong. Here is the snippet of the Composer output you provided (formatted):
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[v9.11.0, ..., 9.x-dev] require league/flysystem ^3.0 -> satisfiable by league/flysystem[3.0.0, ..., 3.x-dev].
- league/flysystem[3.0.0, ..., 3.x-dev] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.11.0].
- league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.1.5) does not satisfy that requirement.
- league/mime-type-detection[1.4.0, ..., 1.11.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^9.11 -> satisfiable by laravel/framework[v9.11.0, 9.x-dev].
This means that Composer wants to install the package called "laravel/framework". That package then requires "league/flysystem", which then requires "league/mime-type-detection".
This is where we get to the root of your issue. Package "league/mime-type-detection" can not be installed because you are missing the PHP ext-fileinfo extension. You need to install that extension on your PHP server and confirm it is installed before trying to composer install again.

I'm trying to install maatwebsite/excel package to my laravel with but got this error

I'm trying to install maatwebsite/excel package to my laravel with this command
composer require maatwebsite/excel
but i got this error message instead:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- maatwebsite/excel[3.1.28, ..., 3.1.30] require phpoffice/phpspreadsheet 1.16.* -> satisfiable by phpoffice/phpspreadsheet[1.16.0].
- maatwebsite/excel[3.1.31, ..., 3.1.x-dev] require phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0, 1.19.0, 1.20.0].
- maatwebsite/excel 3.1.27 requires phpoffice/phpspreadsheet ^1.16 -> satisfiable by phpoffice/phpspreadsheet[1.16.0, ..., 1.20.0].
- maatwebsite/excel 3.1.26 requires phpoffice/phpspreadsheet ^1.15 -> satisfiable by phpoffice/phpspreadsheet[1.15.0, ..., 1.20.0].
equirement.
- phpoffice/phpspreadsheet[1.15.0, ..., 1.20.0] require ext-gd * -> it is missing from your system. Install
or enable PHP's gd extension.
- Root composer.json requires maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, ..., 3.1.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\xampp\php\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-gd` to temporarily ignore these required extensions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require maatwebsite/excel:*" to figure out if any version is installable, or "composer require maatwebsite/excel:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
i'm using :
composer version 2.2.1
PHP version 8.0.1
laravel 8.68.1
what caused this???
The error thrown also gives you the solution, there are some missing packages that the extension requires, just install them separately or allow composer to auto install all with this line:
composer require maatwebsite/excel:*

PROBLEM while create a new project in LARAVEL

I am learning to create projects with laravel, I am using PHP 8. When creating a new project through "laravel new project".I got this error and vendor folder is missiing in that project.
composer create-project laravel/laravel new-project - 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.12\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
removing ; before extension = fileinfo from php.ini inside PHP folder in this path "C:\Program Files\php-8.0.12/" but I didn't remove it from "C:\Program Files\php-8.0.12/php.ini".
On this file C:\Program Files\php-8.0.12\php.ini add this line:
extension=php_fileinfo.dll
This should enable the missing extension on the system.

Categories