Laravel 4 - Composer could not load package - laravel-4

I am trying to update composer in a Laravel 4 project, but I get this error:
[RuntimeException] Could not load package psy/psysh in
http://packagist.org: [UnexpectedValueException] Could not parse
version constraint ^2.4.2: Invalid version string "^2.4.2"
I haven't used psy/psysh within my project. Why is this returned? How can I solve this and run composer update?

The ^ character in version strings is a relatively new composer feature. Update your version of the package manager and you should be good to go
composer self-update

Related

PHP Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods in laravel

I want to install laravel on my windows but getting below error
Using below command install laravel
composer create-project --prefer-dist laravel/laravel:^7.0 learning-app
But getting below error in command prompt after run the composer command
PHP Fatal error: Class UpdateHelper\ComposerPlugin contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Composer\Plugin\PluginInterface::deactivate, Composer\Plugin\PluginInterface::uninstall) in C:\xampp\htdocs\vendor\kylekatarnls\update-helper\src\UpdateHelper\ComposerPlugin.php on line 11
Trying all the commands like composer update but not getting any success.
My php version PHP 7.3.27
Anyone have idea how to solve then let me know
You're trying to install the laravel framework locked at a version released more than 2 years ago, is there a reason for this?
Also, what is the version of your composer (run composer --version)? If you're at the version 2 try downgrading to v1 and try again with the same command, if you really want the 7.0 version of Laravel (or simply install the newest version of the framework).

composer require yajra/laravel-oci8:^8 in laravel 8

PHP version 7.3.22
Running on Laravel Framework version 8
root#df77c47e6f1e:/var/www/oracle-laravel-v8# composer require yajra/laravel-oci8:^8
PHP Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: /usr/lib/php/20180731/oci8_12c (/usr/lib/php/20180731/oci8_12c: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/oci8_12c.so (/usr/lib/php/20180731/oci8_12c.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: /usr/lib/php/20180731/pdo_oci (/usr/lib/php/20180731/pdo_oci: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_oci.so (/usr/lib/php/20180731/pdo_oci.so: cannot open shared object file:
No such file or directory)) in Unknown on line 0
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is about to be released and the older 1.x releases will self-update directly to it once it is released. To avoid surprises update now to the latest 1.x version which will prompt you before self-updating to 2.x.
Run composer self update command and clear composer cache
composer self-update
Then
composer clear-cache
There is nothing wrong about laravel and composer here. It seems that your system's php installation/configuration is wrong (pdo_oci extension is missed or misconfigured) so it can't process anything, even fails at composer startup.
Composer itself is package manager written in php. And laravel is framework written in php. So it's laravel is running on php, not vice versa.

Upgrading my Laravel Yajra Table

I'm currently in 7.5.0 and I want to upgrade to 8.0.3, I followed the steps in https://yajrabox.com/docs/laravel-datatables/master/upgrade but I encountered this error
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Updating yajra/laravel-datatables-oracle (v7.5.0 => v8.0.3): Downloading (conneDownloading (100%)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Yajra\Datatables\DatatablesServiceProvider' not found
Script php artisan optimize handling the post-update-cmd event returned with error code 1
Installation failed, reverting ./composer.json to its original content.
In the Yajra DataTables V8 the Namespace and Facade was updated.
https://yajrabox.com/docs/laravel-datatables/master/upgrade#namespace
https://yajrabox.com/docs/laravel-datatables/master/upgrade#facade
In folder config/app.php, temporarily comment out
Yajra\Datatables\DatatablesServiceProvider.
Run command composer update.
Uncomment the provider Yajra\Datatables\DatatablesServiceProvider.
Done.
To make sure it works, can run again command composer update.
Reference from: https://yajrabox.com/docs/laravel-datatables/master/upgrade#v5-to-v6

after installation of simple qrcode, blade engine doesnt work on laravel5

After installing illuminate/html, my blade engine was wrrking well. But when I installed simple qrCode via:
"require": {
"simplesoftwareio/simple-qrcode": "~1"
}
I get this error:
Class 'Illuminate\Html\HtmlServiceProvider' not found
the output of terminal after installation, simple qrcode was:
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "/usr/bin/composer self-update" to get the latest version.
Key require is a duplicate in ./composer.json at line 53
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing illuminate/html (v5.0.0)
- Installing bacon/bacon-qr-code (1.0.1)
Downloading: 100%
- Installing simplesoftwareio/simple-qrcode (1.4.3)
Downloading: 100%
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home/farhad/public_html/letterPanel/laravel/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Illuminate\Html\HtmlServiceProvider' not found
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Illuminate\Html\HtmlServiceProvider' not found in /home/farhad/public_html/letterPanel/laravel/vendor/lara
vel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146
I also ran composer require illuminate/html after this error. But I get that same error.
Your composer.json file has two require keys, as mentioned in the composer error in your question:
Key require is a duplicate in ./composer.json at line 53
Remove to have a correctly formed composer.json file and retry.
You're installing module for Laravel 4 on Laravel 5 project. Html package was removed from Laravel 5.
You can look for another package or you could install Html package and adapt qrcode to work with Laravel 5.
The line "simpleoftwareio / simple-qrcode": "~ 1" must be within "require" that is already in your composer.json.

Captcha for Laravel 5 install exception

I use Laravel 5.1 and tried to install this package:https://github.com/mewebstudio/captcha
After running composer require mews/captcha I get the following exception:
[RuntimeException]
Could not load package intervention/image in http://packagist.org:UnexpectedValueException] Could not parse version constraint 4.x.x: Invalid version string "4.x.x"
[UnexpectedValueException]
Could not parse version constraint 4.x.x: Invalid version string "4.x.x"
Any ideas why this happen? Thank you

Resources