Exporting command results into a file (.csv) - php

After running my command in the CLI I want to save the results in a file on my machine. I saw a couple of solutions and all of them require this -
composer require maatwebsite/excel
But upon running the command I am given this error...
Your requirements could not be resolved to an installable set of packages.
Problem 1
- maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
- maatwebsite/excel[3.1.26, ..., 3.1.35] require illuminate/support 5.8.*|^6.0|^7.0|^8.0 -> found illuminate/support[v5.8.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
- phpoffice/phpspreadsheet[1.18.0, ..., 1.25.2] require ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
- maatwebsite/excel[3.1.41, ..., 3.1.x-dev] require psr/simple-cache ^1.0|^2.0 -> found psr/simple-cache[1.0.0, 1.0.1, 2.0.0, 2.x-dev] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- maatwebsite/excel[3.1.36, ..., 3.1.40] require phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.18.0, ..., 1.25.2].
- 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:
- /etc/php/8.1/cli/php.ini
- /etc/php/8.1/cli/conf.d/10-mysqlnd.ini
- /etc/php/8.1/cli/conf.d/10-opcache.ini
- /etc/php/8.1/cli/conf.d/10-pdo.ini
- /etc/php/8.1/cli/conf.d/15-xml.ini
- /etc/php/8.1/cli/conf.d/20-calendar.ini
- /etc/php/8.1/cli/conf.d/20-ctype.ini
- /etc/php/8.1/cli/conf.d/20-curl.ini
- /etc/php/8.1/cli/conf.d/20-dom.ini
- /etc/php/8.1/cli/conf.d/20-exif.ini
- /etc/php/8.1/cli/conf.d/20-ffi.ini
- /etc/php/8.1/cli/conf.d/20-fileinfo.ini
- /etc/php/8.1/cli/conf.d/20-ftp.ini
- /etc/php/8.1/cli/conf.d/20-gettext.ini
- /etc/php/8.1/cli/conf.d/20-iconv.ini
- /etc/php/8.1/cli/conf.d/20-mysqli.ini
- /etc/php/8.1/cli/conf.d/20-pdo_mysql.ini
- /etc/php/8.1/cli/conf.d/20-phar.ini
- /etc/php/8.1/cli/conf.d/20-posix.ini
- /etc/php/8.1/cli/conf.d/20-readline.ini
- /etc/php/8.1/cli/conf.d/20-shmop.ini
- /etc/php/8.1/cli/conf.d/20-simplexml.ini
- /etc/php/8.1/cli/conf.d/20-sockets.ini
- /etc/php/8.1/cli/conf.d/20-sysvmsg.ini
- /etc/php/8.1/cli/conf.d/20-sysvsem.ini
- /etc/php/8.1/cli/conf.d/20-sysvshm.ini
- /etc/php/8.1/cli/conf.d/20-tokenizer.ini
- /etc/php/8.1/cli/conf.d/20-xmlreader.ini
- /etc/php/8.1/cli/conf.d/20-xmlwriter.ini
- /etc/php/8.1/cli/conf.d/20-xsl.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.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
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.
Any other suggestions on how to export the files?
php artisan select:values --year=2020 --month=02 that's how I am running my command

Running this solved my problem
composer require psr/simple-cache:^1.0 maatwebsite/excel:3.1.44 --ignore-platform-req=ext-gd --ignore-platform-req=ext-zip

phpoffice/phpspreadsheet[1.18.0, ..., 1.25.2] require ext-gd *
By looking at the commandline error you need to enable this extention in your xampp or apache server configurations.
In case of Windows
just enable it in php.ini file like this
Now find extention:gd2
and remove the semi colon from start like this.
now simply restart the server and you are good to go.

Related

Lumen installation ext-dom missing and composer.json error

I am trying to install Lumen but i am getting the next error:
My OS is Ubuntu 21.10
Your requirements could not be resolved to an installable set of packages.
Problem 1
- phpunit/phpunit[9.5.10, ..., 9.5.x-dev] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
- Root composer.json requires phpunit/phpunit ^9.5.10 -> satisfiable by phpunit/phpunit[9.5.10, ..., 9.5.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/8.1/cli/php.ini
- /etc/php/8.1/cli/conf.d/10-opcache.ini
- /etc/php/8.1/cli/conf.d/10-pdo.ini
- /etc/php/8.1/cli/conf.d/20-calendar.ini
- /etc/php/8.1/cli/conf.d/20-ctype.ini
- /etc/php/8.1/cli/conf.d/20-exif.ini
- /etc/php/8.1/cli/conf.d/20-ffi.ini
- /etc/php/8.1/cli/conf.d/20-fileinfo.ini
- /etc/php/8.1/cli/conf.d/20-ftp.ini
- /etc/php/8.1/cli/conf.d/20-gettext.ini
- /etc/php/8.1/cli/conf.d/20-iconv.ini
- /etc/php/8.1/cli/conf.d/20-intl.ini
- /etc/php/8.1/cli/conf.d/20-mbstring.ini
- /etc/php/8.1/cli/conf.d/20-phar.ini
- /etc/php/8.1/cli/conf.d/20-posix.ini
- /etc/php/8.1/cli/conf.d/20-readline.ini
- /etc/php/8.1/cli/conf.d/20-shmop.ini
- /etc/php/8.1/cli/conf.d/20-sockets.ini
- /etc/php/8.1/cli/conf.d/20-sysvmsg.ini
- /etc/php/8.1/cli/conf.d/20-sysvsem.ini
- /etc/php/8.1/cli/conf.d/20-sysvshm.ini
- /etc/php/8.1/cli/conf.d/20-tokenizer.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-dom` to temporarily ignore these required extensions.
Already tried to install php-xml but didnt worked

I can't install spatie/laravel-sitemap on Laravel 5.6

I'm getting this error when installing:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- spatie/laravel-sitemap[5.9.0, ..., 5.9.2] require illuminate/support ^8.0 -> found illuminate/support[v8.0.0, ...,
8.x-dev] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires spatie/laravel-sitemap ^5.9 -> satisfiable by spatie/laravel-sitemap[5.9.0, 5.9.1, 5.9.2].
You can also try re-running composer require with an explicit version
constraint, e.g. "composer require spatie/laravel-sitemap:*" to figure
out if any version is installable, or "composer require
spatie/laravel-sitemap:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to
their original content.
you can just
composer require spatie/laravel-sitemap:*
# ^
Composer will figure out if any version (*) is installable (thanks to dependency resolution, compare Dependency Hell etc.).
You can also leave the star (*) out, as it poses some problems in the shell/command interpreter. Example:
composer require spatie/laravel-sitemap
See as well: How to install a specific version of package using Composer?

Composer Update Error "Requirements could not be resolved to an installable set of packages" in Laravel [duplicate]

This question already has answers here:
Reference - Composer error "Your PHP version does not satisfy requirements" after upgrading PHP
(3 answers)
How to explain Composer's error log?
(2 answers)
Closed 1 year ago.
I Just Update My Composer Which Returns with some errors and issues:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- jeremykenedy/laravel-roles v1.2.0 requires laravel/framework 5.3.*|5.4.*|5.5.*|5.6.* -> found
laravel/framework[v5.3.0-RC1, ..., 5.6.x-dev] but it conflicts with your root composer.json require
(^8.0).
- jeremykenedy/laravel-roles v1.3.0 requires laravel/framework 5.3.*|5.4.*|5.5.*|5.6.*|5.7.* -> found
laravel/framework[v5.3.0-RC1, ..., 5.7.x-dev] but it conflicts with your root composer.json require
(^8.0).
- jeremykenedy/laravel-roles[v1.4.0, ..., v1.7.0] require laravel/framework
5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.* -> found laravel/framework[v5.3.0-RC1, ..., 5.8.x-dev] but it
conflicts with your root composer.json require (^8.0).
- Root composer.json requires jeremykenedy/laravel-roles ^1.2 -> satisfiable by jeremykenedy/laravel-
roles[v1.2.0, ..., v1.7.0].
I Searched on google but failed to solve my issue. Plz, Provide me clear answer So I solve my error.
Thanks, Brother For the Help.
After execution of
composer install --ignore-platform-reqs
Following Errors Also Occur:
Class App\Http\Controllers\riderOrders located in L:/Live/cyber-food-
fiji/app\Http\Controllers\RiderOrders.php does not comply with psr-4
autoloading standard. Skipping.
Class "Grimzy\LaravelMysqlSpatial\SpatialServiceProvider" not found
Script #php artisan package: discover handling the post-autoload-dump
event returned with error code 1
After Execution of
composer update
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- pusher/pusher-php-server[v3.2.0, ..., v3.3.1] require php ^5.4 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
- pusher/pusher-php-server v3.4.0 requires php >=5.4 <7.3 -> your php version (8.0.0) does not satisfy that requirement.
- pusher/pusher-php-server v3.4.1 requires php >=5.4 <7.4 -> your php version (8.0.0) does not satisfy that requirement.
- Root composer.json requires pusher/pusher-php-server ^3.2 -> satisfiable by pusher/pusher-php-server[v3.2.0, ..., v3.4.1].
Thanks For Helping me with the last bug.
Plz Also guide in the above errors.
Thanks...
Run this command:
composer install --ignore-platform-reqs
or
composer update --ignore-platform-reqs
Note:
--ignore-platform-reqs: ignore all platform requirements (php, hhvm, lib-* and ext-) and force the installation even if the local machine does not fulfill these. See also the platform config option.
--ignore-platform-req: ignore a specific platform requirement(php, hhvm, lib- and ext-*) and force the installation even if the local machine does not fulfill it.

Trying to install Cashier on Laravel 5.4.36

I am using Laravel 5.4.36 and I am trying to install Cashier using these steps: https://www.nicesnippets.com/blog/laravel-7-cashier-stripe-subscription-tutorial
However when I try to run this line:
sudo composer require laravel/cashier
I get this error:
Problem 1
- laravel/cashier[v12.6.0, ..., v12.6.1] require illuminate/contracts ^6.0|^7.0|^8.0 -> found illuminate/contra
cts[v6.0.0, ..., v6.20.7, v7.0.0, ..., v7.30.0, v8.0.0, ..., v8.19.0] but these were not loaded, likely because it
conflicts with another require.
- Root composer.json requires laravel/cashier ^12.6 -> satisfiable by laravel/cashier[v12.6.0, v12.6.1].
What am I doing wrong and how do I fix this?
Thanks,
When you do
composer require laravel/cashier
this will install the current version of the cashier package that works with the current version of Laravel. You have to check what version of cashier (if any), your current Laravel version installed, supports.

php symfony error mongoDB

I have problem with configuration MongoDB Symfony
Program doesnt see class \MongoDbBudle\ to I went to Tools ->
Composer -> add -> "doctrine/mongodb-odm". I tried to install it but I saw error:
C:\wamp64\bin\php\php7.0.10\php.exe C:\Users\Root\PhpstormProjects\untitled2\composer.phar require doctrine/mongodb-odm:1.2.x-dev -n --no-progress
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Removal request for alcaeus/mongo-php-adapter == 1.1.9999999.9999999-dev
- Removal request for alcaeus/mongo-php-adapter == 9999999-dev
- doctrine/mongodb-odm 1.2.x-dev requires doctrine/mongodb ^1.4.0 -> satisfiable by doctrine/mongodb[1.4.0].
- doctrine/mongodb 1.4.0 requires ext-mongo ^1.5 -> satisfiable by alcaeus/mongo-php-adapter[1.1.x-dev, dev-master].
- Installation request for doctrine/mongodb-odm 1.2.x-dev -> satisfiable by doctrine/mongodb-odm[1.2.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\wamp64\bin\php\php7.0.10\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
php.ini seems to be ok. I added dynamic extension mongo-dll:
http://pastebin.com/bfb34A0s
Please help me how to solve this problem.
Using ODM with PHP 7 is a bit trickier than it should, please check if adding
"provide": {
"ext-mongo": "1.6.14"
}
to your project's composer.json would solve the issue. Otherwise you can see full chapter on how to use ODM with PHP 7 in the official documentation

Categories