执行composer install时,经常出现you can run Composer with
--ignore-platform-req=ext-fileinfoto temporarily ignore these required extensions
问题,此时如何只是用composer 命令安装时,执行命令时加上--ignore-platform-req=ext-fileinfo
就可以了,但是要执行php artisan breeze:install vue
等是,就不能这样修改了。
- 执行composer
简单解决:
composer install --ignore-platform-req=ext-fileinfo
2.执行php artisan xxx:install xxx时。出现以下问题。
php artisan breeze:install vue
./composer.json has been updated
Running composer update inertiajs/inertia-laravel laravel/sanctum tightenco/ziggy
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- league/flysystem-local 3.23.0 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- laravel/framework v10.40.0 requires league/flysystem ^3.8.0 -> satisfiable by league/flysystem[3.22.0].
- league/flysystem 3.22.0 requires league/flysystem-local ^3.0.0 -> satisfiable by league/flysystem-local[3.23.0].
- laravel/framework is locked to version v10.40.0 and an update of this package was not requested.
To enable extensions, verify that they are enabled in your .ini files:
- C:\phpstudy_pro\Extensions\php\php-8.3.1-Win32-vs16-x64\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.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
PS
解决也很简单:在php.ini文件中,追加extension=php_fileinfo
就可以了。同时,composer的问题也解决了。完整的参考配置目录如下。
[Date]
date.timezone=Asia/Shanghai
[PHP]
max_execution_time = 300
max_input_time=60
max_input_vars=3000
memory_limit=256M
upload_max_filesize = 100M
post_max_size = 100M
max_file_uploads = 100
display_errors = On
display_startup_errors=On
log_errors=On
track_errors=Off
html_errors=On
error_log=C:/phpstudy_pro/Extensions/php/php-8.3.1-Win32-vs16-x64.log
error_reporting=E_ALL & ~E_NOTICE
allow_url_fopen=On
allow_url_include=Off
extension_dir="C:\phpstudy_pro\Extensions\php\php-8.3.1-Win32-vs16-x64\ext"
extension=php_pdo_mysql
extension=php_openssl.dll
extension=zip
extension=curl
variables_order = "GPCS"
extension=php_fileinfo