Due to unable to access Terminal in hosting server, I ran composer update in my local machine and uploaded everything including vendor folder, composer.json and composer.lock. My hosting server run PHP 7.1 and so does my local machine with Laravel 5.5.
Now I am facing PHP Fatal error: Uncaught ReflectionException: Class view does not exist in /public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:752
Stack trace:
#0 /public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(752): ReflectionClass->__construct('view')
#1 /public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('view')
#2 /public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(586): Illuminate\Container\Container->resolve('view', Array)
#3 /public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(732): Illuminate\Container\Container->make('view', Array)
#4 /public_html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(110): Illuminate\Foundation\Application->make('view', Array)
#5 /public_html/vendor/laravel/framework/src/Illuminate/Found in /public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 752
I ran the following command.
composer require maatwebsite/excel --no-update
composer update maatwebsite/excel
And I uploaded the following files and folder from local to live server.
Vendor / maatwebsite folder and all other newly created by folders.
vendor / composer folder
composer.json
composer.lock
I cleared config cache, route cache, view cache from PHP file using artisan command.
Can anyone please help me to debug the error?
Thank you.
You're missing bootstrap/cache/packages.php and bootstrap/cache/services.php
These files are updated when you run composer require or update as part of the package discovery.
Related
I have a project that I need to edit. To see this project, I wanted to run it on localhost and ran it from wamp. Later, when I entered localhost, I got the error.
On top of that, I wanted to run it from cmd and see it. The response I got at that time was as follows.
Fatal error: Uncaught Error: Failed opening required 'C:\wamp64\www/vendor/autoload.php' (include_path='.;C:\php\pear') in C:\wamp64\www\artisan:18
Stack trace:
#0 {main}
thrown in C:\wamp64\www\artisan on line 18
check if there is any /vendor/autoload.php file in your wamp folder if not try composer install in the terminal where your project is located. (if you don't have composer install the composer first via this url)
you can start your project directly with php artisan serve too. if php is added to your windows path variables.
I am trying to set up a new MediaWiki 1.35 install and add the Wikibase extension. The install is running on a Debian 10 LXC container hosted on proxmox.
I have been following the Wikibase/Installation MediaWiki guide but I seem to be stuck. When I get to the 'Run Maintenance Scripts' step and try to run php update.php it thows the following error:
[10e7e1e19b828fdfd6418545] [no req] Error from line 47 of /var/lib/mediawiki/extensions/Wikibase/lib/WikibaseLib.entitytypes.php: Class 'Wikibase\DataModel\Entity\ItemId' not found
Backtrace:
#0 /var/lib/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(532): require()
#1 /var/lib/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(748): Wikibase\Client\WikibaseClient::getDefaultEntityTypes()
#2 /var/lib/mediawiki/extensions/Wikibase/client/includes/WikibaseClient.php(796): Wikibase\Client\WikibaseClient::newInstance()
#3 /var/lib/mediawiki/extensions/Wikibase/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php(64): Wikibase\Client\WikibaseClient::getDefaultInstance()
#4 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(554): Wikibase\Client\Usage\Sql\SqlUsageTrackerSchemaUpdater::fillUsageTable(MysqlUpdater)
#5 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(522): DatabaseUpdater->runUpdates(array, boolean)
#6 /var/lib/mediawiki/maintenance/update.php(181): DatabaseUpdater->doUpdates(array)
#7 /var/lib/mediawiki/maintenance/doMaintenance.php(107): UpdateMediaWiki->execute()
#8 /var/lib/mediawiki/maintenance/update.php(253): require_once(string)
#9 {main}
I made sure to clone the proper version of Wikibase (REL1_35). I've looked everywhere for a solution but it seems like I have messed up in a unique way. I should also mention that is my first time setting up a MediaWiki server so any help is greatly appreciated.
I made a git and uploaded everything in the root of the MediaWiki install: https://github.com/ggosset2017/MediaWiki-Install.git
Update:
Looks like it's a problem with some dependency. I did make sure to install composer and install dependencies following the WIkibase guide linked above. I used the following commands/file edits.
First, I updated the composer.local.json file in the root of MediaWiki install to match the following:
{
"extra": {
"merge-plugin": {
"include": [
"extensions/Wikibase/composer.json"
]
}
},
"require": {
"monolog/monolog": "~2.0.2"
}
}
sshed into the container and ran the following.
rm composer.lock
composer install --no-dev
Everything seemed to download fine and the only error I got was the following:
Warning from https://repo.package.org: you are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
I expected this error as MediaWiki does not support composer 2, at least according to this: https://www.mediawiki.org/wiki/Composer#Installing_Composer
Update 2:
Looks like my composer.local.jason file was somehow changed to composer.local.jason-sample. I have removed the -sample appended to that file name. Now composer is throwing the following error when I try to run rm composer.lock and composer install --no-dev
image of composer error
In Solver.php line 243:
Problem 1
- The requested package monolog/monolog ~2.0.2 exists as monolog/monolog[1.25.5] but these are rejected by your constraint.
Here's a list of posts claiming they have the same error I've already looked at and tried the answers from but none of them have worked:
Laravel 5.6 - Uncaught RuntimeException: A facade root has not been set
'A Facade root has not been set' when running `composer install` after a fresh checkout
Laravel 5.5 application not booting anymore with "A facade root has not been set."
Laravel error 'A facade root has not been set
Laravel 5.6 Uncaught RuntimeException: A facade root has not been set. in vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:218
https://laracasts.com/discuss/channels/laravel/updating-from-55-to-56-resulting-in-a-facade-root-has-not-been-set?page=1
I'm updating Laravel from 5.7 to 5.8.
A coworker started the upgrade using the instructions here. I then pulled their branch down from github and ran the following commands:
composer clearcache
php artisan cache:clear
composer install -o -vvv
rm -rf vendor/ rm composer.lock && composer update -o -vvv
a different co-worker went through this same process and does not get any errors. I get the following error when running the composer update command:
PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /dev/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:234
Stack trace:
#0 /dev/api/app/Exceptions/Handler.php(51): Illuminate\Support\Facades\Facade::__callStatic('error', Array)
#1 /dev/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(378): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#2 /dev/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(143): Illuminate\Foundation\Console\Kernel->reportException(Object(Symfony\Component\Debug\Exception\FatalThrowableError))
#3 /dev/api/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
thrown in /dev/api/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 234
None of the answers listed above have worked for me in this situation and we're running out of ideas as to what the issue is.
Any ideas of how to proceed in troubleshooting this issue?
After much searching we figured out what the problem was. In updating our version of Laravel one of our 3rd party dependency packages (vlucas/phpdotenv) we use had a version update too and that package had a breaking change. It slipped through the cracks. After going through the steps to update that 3rd party package our problem was solved.
I'm trying to deploy a Symfony2 application in a shared hosting and everyone knows that nobody can run any command on that type of hosting so this is what I do in order to get things done and after reads the docs at Symfony.com site:
All this was done in my development server:
Run the command php composer.phar install --no-dev --optimize-autoloader
Run the command php app/console assetic:dump --env=prod --no-debug
Then after all was done I copied the entire folder to my shared hosting but now I'm getting this error:
Fatal error: Uncaught exception 'UnexpectedValueException' with
message 'The stream or file
"/var/www/html/tanane/app/../var/logs/prod.log" could not be opened:
failed to open stream: No such file or directory' in
/home/tanane72/public_html/tanane/var/cache/prod/classes.php:5014
Stack trace: #0
/home/tanane72/public_html/tanane/var/cache/prod/classes.php(4958):
Monolog\Handler\StreamHandler->write(Array) #1
/home/tanane72/public_html/tanane/var/cache/prod/classes.php(4883):
Monolog\Handler\AbstractProcessingHandler->handle(Array) #2
/home/tanane72/public_html/tanane/var/cache/prod/classes.php(5083):
Monolog\Handler\AbstractHandler->handleBatch(Array) #3
/home/tanane72/public_html/tanane/var/cache/prod/classes.php(5388):
Monolog\Handler\FingersCrossedHandler->handle(Array) #4
/home/tanane72/public_html/tanane/var/cache/prod/classes.php(5488):
Monolog\Logger->addRecord(500, 'Uncaught PHP Ex...', Array) #5
/home/tanane72/public_html/tanane/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/ExceptionListene
in /home/tanane72/public_html/tanane/var/cache/prod/classes.php on
line 5014
The file prod.log exists in shared hosting but Symfony is looking in my development server as this line said /var/www/html/tanane/app/../var/logs/prod.log, where I can change that behavior? How the process works in order to change this route to the current one on shared hosting?
You need to copy all files to shared hosting, except app/cache and app/logs dirs. And then in app/config/parameters.yml change database connection to new one.
Then set permissions on app/cache and app/logs dirs to 777
That's all
P.S. And don't forget to check PHP version on hosting, better use 5.4 or 5.5.
I ran composer install --no-dev before having to manually deploy to a client's server by FTP that lacks SSH access. When I did so, I received the following error:
PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 158
PHP Stack trace:
PHP 1. {main}() C:\www\test.dev\laravel\artisan:0
PHP 2. require_once() C:\www\test.dev\laravel\artisan:30
PHP 3. require() C:\www\test.dev\laravel\bootstrap\start.php:60
PHP 4. Illuminate\Foundation\ProviderRepository->load() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:58
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:122
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Way\\Generators\\GeneratorsServiceProvider' not found","file":"C:\\Ampps\\www\\test.dev\\laravel\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRe
pository.php","line":158}}Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Way\Generators\GeneratorsServiceProvider' not found in C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php on line 158
PHP Stack trace:
PHP 1. {main}() C:\www\test.dev\laravel\artisan:0
PHP 2. require_once() C:\www\test.dev\laravel\artisan:30
PHP 3. require() C:\www\test.dev\laravel\bootstrap\start.php:60
PHP 4. Illuminate\Foundation\ProviderRepository->load() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:58
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() C:\www\test.dev\laravel\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:122
Each of the app.php files has the line 'Way\Generators\GeneratorsServiceProvider'.
This was working fine before running that composer command. Why did this happen and how can it be fixed?
Laravel 4.1.
In your composer.json file, you have way/generators as a development machine dependency only. If you have the service provider 'Way\Generators\GeneratorsServiceProvider' in each of the app.php file, then it would mean that way/generators is a development machine as well as the deployment machine dependency. By doing composer install --no-dev, you're saying that the packages that are development machine dependency only, shouldn't go in the vendor directory, which means that the package way/generators is not installed in the vendor directory. That's why you're getting the error.
Since way/generators is a development dependency only, you should remove 'Way\Generators\GeneratorsServiceProvider' from app/config.php, so that the deployment machine wouldn't look for it.
Also if you're working on the development machine and performed composer install --no-dev, the way/generators package wouldn't be installed in the vendor directory and you'd get the above error. So you'd have to make the development machine environment as not local to test whether or not it'd work in the deployment machine.