Hello I am facing problem in upgrading the laravel 5.1 to 5.2. I have added
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*"
},
in my project composer.json
[Error screenshot][1]
Error on console window.
PHP Notice: date_default_timezone_set(): Timezone ID '' is invalid in
/opt/lampp/htdocs/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
on line 41 PHP Fatal error: Call to undefined method
Illuminate\Foundation\Bootstrap\ConfigureLogging::configureHandler()
in
/opt/lampp/htdocs/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php
on line 59
you should probably do composer update (be sure you want to do this) then composer dump-autoload which i believe is triggered by default if you have not altered your composer.json file. you would also want to run php artisan cache:clear
Related
I have updated the composer.json file as instructed on the upgrade guide on Laravel 5.2 Documentation and run composer update.
Everything was updated correctly, but composer dumped the error below while generating autoload files.
Class 'Illuminate\Routing\ControllerService Provider' not found in /home/vagrant/Code/homework/vendor/laravel/framework /src/Illuminate/Foundation/ProviderRepository.php on line 146
Make sure you remove Illuminate\Routing\ControllerServiceProvider from your /config/app.php.
https://www.laravel.com/docs/5.2/upgrade (see the "Service Providers" section)
Problem is with your composer.json.It may got corrupted. Make sure
"require": {
"laravel/framework": "5.2.*"
},
exists.Then run composer update.
I am working on a Laravel Lumen project. I am trying to spin up the existing project locally. First I installed the composer by running, "composer install". When I run the migration command, "php artisan migrate", I am getting the following error.
Fatal error: Uncaught Error: Class 'Laravel\Lumen\Bootstrap\LoadEnvironmentVariables' not found in /var/www/bootstrap/app.php:5
Stack trace:
#0 /var/www/artisan(18): require()
#1 {main}
thrown in /var/www/bootstrap/app.php on line 5
I tried deleting the vendor folder and running composer install again. It did not work. The class does not seem to exist either. But the composer was installed successfully. I am using Lumen version 7.0. What is wrong with it and how can I fix it?
Make sure you actually require the lumen package i.e. make sure your composer.json contains:
"require": {
"php": "^7.2.5",
"laravel/lumen-framework": "^7.0"
},
Afterwards run composer install again. If it worked then a folder /vendor/laravel/lumen-framework should be present
See official composer.json template for Lumen 7.0: https://github.com/laravel/lumen/blob/7.x/composer.json
Installed laravel 5.6
Have PHP 7.0 installed as well.
When I try
laravel new sample-project
it creates the required files and dependencies but bails with an error below:
PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/johndoe/laravel/sample-project/vendor/symfony/console/Output/Output.php on line 40
Have a feeling this might be due to issues with the symfony file but not sure how to go about getting the right version or making a change in Output.php
Trying any other command such as
php artisan list
results in the same error
Composer relevant section denoting laravel 5.6 / php 7.1.3
"require": {
"php": "^7.1.3",
"fideloper/proxy": "~4.0",
"laravel/framework": "5.6.*",
"laravel/tinker": "~1.0"
},
Any help would be appreciated.
EDIT
Based on the answer I had to create a project with laravel version 5.5 which means I had to use
composer create-project laravel/laravel sample-project "5.5.*"
That worked.
Laravel 5.6 requires PHP > 7.1.3
you will need to make sure your server meets the following
requirements:
PHP >= 7.1.3
I ended up having to edit the $PATH in my .bashrc file, because it was picking up an old version of php.
> whereis php
> echo $PATH
I found the correct version of php here: /opt/php71/bin
So now my .bashrc file looks like this:
export PATH=/opt/php71/bin:$PATH
This fixed the error I was getting in composer, AND now php artisan also works!
:-D
PS. The version of php that you're using in the shell may be different from the version used to serve your site. That can be fixed in cpanel's php selector.
Method Illuminate\Foundation\ComposerScripts::postAutoloadDump is not callable, can not call post-autoload-dump script
#php artisan package:discover
There are no commands defined in the "package" namespace.
Script #php artisan package:discover handling the post-autoload-dump event returned with error code 1
This would normally happen if the version of laravel in your composer.json file is under 5.5.
You will want to make sure you have:
"laravel/framework": "5.5.*",
In the require portion of the json. Sometimes, if you update through composer, it will load the package from the cache. You might want to delete your $PROJECT_DIR/vendor/* folder and then run:
composer update --prefer-source
Notice the output to see that laravel/framework is indeed at 5.5.*.
I wanted to install teepluss/theme so I added it to my composer.json
but now I get this error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'SuperClosure\Serializer' not found
I was capable to solve the first error by adding >"jeremeamia/superclosure": "^2.0"
but now when I add >Teepluss\Theme\ThemeServiceProvider::class, in app.php providers I get a new error :
> [ErrorException] Illegal offset type in unset
here's what i got in the script in composer.json
If you already run composer update, you can try run this script
php artisan config:cache
and
php artisan cache:clear.It can help you resolve that problem