Composer installation - laravel

I updated a lower version of my local server to the required one while installing composer but I get this error enter image description here

From your screenshot, looks like Windows doesn't recognize php.
Try adding php to your PATH variable.
Check this link

Related

Laravel giving error "Your lock file does not contain a compatible set of packages. Please run composer update"

I am trying to host my application using Microsoft Azure. When I build my laravel web to Azure web app, the error I get is "Your lock file does not contain a compatible set of packages. Please run composer update". I have run the command "composer update" but still get the same error.
enter image description here
Does anyone know how to solve this?
You have the solution on your screenshot - enable php extension ext-fileinfo. How? Check documentation
Or, for just test deploy - add flag to install command
composer install --ignore-platform-reqs

Failed to initialize global composer: mac /Sites

Trying to view a local website:
"Uncaught Error: Class 'ComposerAutoloaderInite0e6765..etc' not found in /Users/{ username }/Sites/{ sitename }/htdocs/vendor/twig-autoload.php".
So on into Terminal to do composer dump-autoload. (It worked the first time I did it).
I now get this message:
"The 'git' command requires command line developer tools. Would you like to install the tools now?" (It asks for Xcode)
I click No.
Terminal tells me the file command has been run OK, but no...
Repeating the dump autoload with -vvv reveals the truth:
Failed to initialize global composer: Composer could not find the config file: /Users/{ username }/.composer/composer.json
Searching about, the only things I've found on the composer error seem to be related to Lavarel.
info:
Composer is installed in /Sites/{ sitename }/vendor/
Composer version: 1.10.6
So what I'd like to understand:
Why is composer trying to initialise a 'global composer'? Does it think the locally installed one is global, or could there be another Composer it's trying to default to?
How do I tell composer where the json file is?
What should I do about the xCode message, if anything?
I've reinstalled composer (and Twig - the only package I'm using - seems overkill for one package, but trying out alternatives didn't end well).
The site is now back running (locally).
Still have the issue of xCode request from Terminal, but that's for another question.
So the answer seems to be: Reinstall composer and packages.

Class 'ZipArchive' not found phpexcel

Class 'ZipArchive' not found in /home/rm4r8egx5aq4/readyformove.in/application/libraries/PHPExcel/Reader/Excel2007.php
Check php zip extension is missing in your server or not.
If yes,
Run the following commands in Linux Server.
sudo apt-get install php5.6-zip
sudo service apache2 restart
change php5.6-zip depend on your current PHP version.
If it's Shared hosting, these links may help you.
https://in.godaddy.com/community/GoDaddy-Web-Hosting/PHP-Zip-Module/td-p/60228
https://in.godaddy.com/community/VPS-Dedicated-Servers/Error-when-installing-AbanteCart-for-eCommerce-site/m-p/2797#M121
https://www.youtube.com/watch?v=44PsYaM94K4
Login to cPanel.
Locate Select PHP version and click on it.
Choose your desired PHP version and click on Set as Current.
To set the PHP extensions, Click on Switch to PHP settings.
Click on the extension you wish to change, enter the value and save the settings.

How to fix "https://repo.packagist.org/packages.json does not contain valid Json"?

I've an issue with composer running on a vagrantbox (Centos 7), which started to just suddenly happen.
I've already tried manually running the command/solution mentioned on the link below but to no avail.
(To clarify, i'm using vagrant not docker, but it was the closest question i found to my situation. Most of the information i found are related to composer.json not being valid, but here is packagist.org/packages.json which, is currently valid)
Composer not working in docker container: "https://packagist.org/packages.json" does not contain valid JSON
Here are the details of the issue.
While running composer update on terminal i get:
composer update
[Seld\JsonLint\ParsingException]
"https://repo.packagist.org/packages.json" does not contain valid JSON
Parse error on line 1:
^
Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['
And when running composer install also on terminal every package returns this:
Failed to download psr/cache from dist: "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8"
appears broken, and returned an empty 200 response
Now trying to download from source
When running composer config --global repo.packagist composer packagist.org
the results are now
composer update
Loading composer repositories with package information
[Composer\Downloader\TransportException]
Your configuration does not allow connections to http://repo.packagist.org/packages.json. See https://getcomposer.o
rg/doc/06-config.md#secure-http for details.
Any ideas why this started to happen, how can i fix it?
Could also be IPv6 related, if your provider/system is configured for IPv6 but has no valid IPv6 route out to the internet.
This happened to me, and doing
sysctl -w net.ipv6.conf.all.disable_ipv6=1 (as root), then trying composer again fixed the issue.
To permanently apply it, add the rule to /etc/sysctl.conf (or wherever your OS preferred is)
same problem here, since php updated to 7.2.17.
On a centos 7 with php 7.2.16 composer run just fine...
Rollback to 7.2.16 is for now the only solution found...
Edit :
Seems to be a symfony flex issue : https://github.com/symfony/flex/issues/484
I had the same problem. After days of searching, I found a solution. It seems a PHP problem. Try to comment a line of curl extension on php.ini. I am using php version 5.6.
extension=php_curl.dll
Type ; before the extension name, at least it will be like this:
;extension=php_curl.dll
I had the same issue try to install symfony twig bundle. I ran :
set http_proxy=
set https_proxy=
composer require symfony/twig-bundle
and it worked
I ran a composer global require laravel/installer simply upgrading laravel/installer according to Laravel https://laravel.com/docs/9.x/installation#the-laravel-installer and the error was resolved.
Simply Just check out your internet and it well be ok
in the XAMP i have done follwing changes
comment the follwing line
;extension=php_curl.dll
and it worked properly
My solution: connect to a vpn before running the command!
For me basically the problem was because my IP was from Iran. Connected to a vpn and it worked perfectly.
it will works when we run this command in console
composer config disable-tls true
I bypassed the problem by redirecting the output to /dev/null.
composer require symfony/orm-pack > /dev/null

Composer Download Error

i got this error when i'm trying to install composer for laravel framework :
"Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl"
i tried much but i don't know what should i do right now ?
i got win 8.1 , wamp 1.7 , php 5.4
open C:\wamp\bin\php\php5.4.12\php.ini & C:\wamp\bin\apache\Apache2.4.4\bin\php.ini
Find the line ;extension=php_openssl.dll and remove the semicolons ';'.
The line should look like extension=php_openssl.dll.

Resources