How to solve error when opening application in Yii2 - php

I am presenting the following problem and that is when opening my Yii2 application, the charge in my browser as follows http://localhost/basic/web/ and I get the following error: Fatal error: Cannot use 'Object' as class name as it is reserved in C:\xampp\htdocs\basic\vendor\yiisoft\yii2\base\Object.php on line 77

Run the "composer update" command
or composer.phar update
where your composer.json resides

Related

Symfony 4 Parse Error: vendor/symfony/flex/src/Flex.php line 275

I am currently using Symfony 4 and while I am trying to create a user login form for my app, I use the command Composer require security and I get this error:
Parse error: parse error in /Applications/MAMP/htdocs/myapp/vendor/symfony/flex/src/Flex.php on line 275
The culprit is in the symfony flex file Flex.php
$installContribs = $this->composer->getPackage()->getExtra()['symfony']['allow-contrib'] ?? false;
I then found I cannot use any Composer commands, such as composer update, composer require, and so on. Any help would be appreciated!

Laravel fatal error: Fatal error: Interface 'Illuminate\Auth\Illuminate\Contracts\Auth\Factory' not found

I'm trying to start using laravel php framework. I'm trying to just call the index file and I get this error message.
C:\xampp\php\php.exe C:\xampp\htdocs\tutorials\lara\application\public\index.php
Fatal error: Interface 'Illuminate\Auth\Illuminate\Contracts\Auth\Factory' not found in C:\xampp\htdocs\tutorials\lara\application\bootstrap\cache\compiled.php on line 357
Process finished with exit code 255
Can anyone shine some light on what this means?
Your Illuminate\Auth\Illuminate\Contracts\Auth\Factory may not copied in your project,that why this is happening.So you need to be
Step 1 : Remove full vendor folder
Step 2 : Run from your terminal composer install

'Fatal error: Call to undefined method' when I run composer update

Following error occured when I try to run composer update or run any command:
PHP Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272
Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272
Try to remove the invalid / incomplete version by using
composer global remove fxp/composer-asset-plugin
In case that fails, you might remove the plugin folder manually from Composers home folder:
rm -rf ~/.composer/vendor/fxp
Then, reinstall the plugin and cross fingers that everything works now :)
composer global require "fxp/composer-asset-plugin:~1.1.1"

Laravel Setup: Can't install Monolog

I just tried to install a fresh instance of Laravel as described in the docs ( http://laravel.com/docs/quick#installation - "Via Composer"). Got this error from Composer:
...
Writing lock file
Generating autoload files
PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\vendor\laravel\framework\src\Illuminate\Log\LogServiceProvider.php on line 23
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Monolog\\Logger' not found","file":"...\\src\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogServiceProvider.php","line":23}}Script php artisan clear-c
ompiled handling the post-install-cmd event returned with an error: PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\Illuminate\Log\LogServiceProvider.php on line 23
PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\Illuminate\Log\LogServiceProvider.php on line 23
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Monolog\\Logger' not found","file":"...\\src\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogServiceProvider.php","line":23}}Script php artisan optimiz
e handling the post-install-cmd event returned with an error: PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\Illuminate\Log\LogServiceProvider.php on line 23
Uhm, what to do now? Tried to post it on the official forums but that wasn't possible due to an error there (forums are based on Laravel... yeah that's Karma!).
Solution: "composer dumpautoload -o"

PHPUnit does not work after upgrade to 4.0.4

This morning I updated my phpunit version from 3.7.x to 4.0.x.
I usually run PHPUnit with a bootstrap which contains
require('PHPUnit/Framework/Assert/Functions.php');
Since the update, when I try to run my phpunit tests, it fails because of the following error:
Fatal error: require(): Failed opening required 'PHPUnit/Framework/Assert/Functions.php' (include_path='.:/usr/local/lib/php/:/usr/local/share/pear/') on line 6
What can I do to resolve this?
That file changed location. It is now in src/Framework/Assert/Functions.php.

Categories