I'm working with Laravel 5.2 and i have an error when i run composer update or artisan optimize ..
i've searched on my vendor, i didn't found compiled.php file ! i try to generate this i run the artisan optimize, i have the same error
[InvalidArgumentException]
Please provide a valid cache path
Script php artisan clear-compiled handling the post-update-cmd event returned with error code 1
how i can resolve this ?
Please Try it:
create these folders under storage/framework:
sessions
views
cache
And also you can use this command to install:
sudo composer install
Its will be working.
Related
When i try visiting my site I get this error, when I look domain.com.error.log:
PHP Fatal error: require(): Failed opening required '/home/<user/web/<domain>/public_html/../vendor/autoload.php
Files from my laravel project are placed into domain folder, files from public folder are inserted into /public_html folder. I've tried composer update, generate key, and all the other composer commands that people adviced here before.
I've set all my directories permissions to 777, so this error cannot be because of lacking permissions.
If you need any additional information, please ask, trying to solve this problem for 4 days already.
Edit: Solved this problem, it appeared because php didn't have access to files that are not inside public_html. So, this can be solved by either putting all your project into public_html folder, or updating your server rules to allow php access the folder with the project.
You need to install composer from www.getcomposer.org
composer dump-autoload
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan migrate --force
I installed laravel-ckeditor via composer in my Laravel 5.5 project as described on their GitHub (https://github.com/UniSharp/laravel-ckeditor). Now i don't need it anymore and want to remove it. I executed composer remove unisharp/laravel-ckeditor but i get this error messge:
In ProviderRepository.php line 208:
Class 'Unisharp\Ckeditor\ServiceProvider' not found
I have on idea what causes this error. I tried reinstalling and removing it several times, but i always get the same error message.Thanks for any help.
Edit: The error is caused by artisan. I can't execute php artisan cache:clear anymore and directly before the error, composer prints
> #php artisan package:discover
into the console.
I run php artisan tinker but it didn't work it just show a message like this
c:\xampp\htdocs\app_tpa>php artisan tinker
[ErrorException]
rmdir(C:\Users\KIMUNG~1\AppData\Local\Temp\php-xdg-runtime-dir-fallback-): Directory not empty
I tried to run composer require laravel/tinker, but it doesn't fix my problem
This issue is now resolved as per these github issues:
laravel/tinker#29
bobthecow/psysh#430
The proper solution now is to do composer update
I have created a new branch using Git, applied some updates to my code, checked out that branch on my staging server and I now can't run anything composer related.
I've added some new packages to composer.json which work on my development environment, but as soon as I try composer update on the staging environment I get class not found errors relating to the classes it's not yet downloaded.
I've tried
composer update
composer dump-autoload
php artisan clear-compiled
php artisan dump-autoload
php artisan optimize
But all result in the following error
PHP Fatal error: Class 'Artdarek\OAuth\OAuthServiceProvider' not found in
/var/www/sites/x/bootstrap/compiled.php on line 4321
Script php artisan clear-compiled handling the
pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Class 'Artdarek\OAuth\OAuthServiceProvider'
not found in /var/www/sites/x/bootstrap/compiled.php
on line 4321
What else can I try in order to get composer to download new files?
php artisan optimize --force
That command will re-generate /bootstrap/compiled.php
The --force arg is needed to re-generate the file when your environment is in debug mode.
I'm sure there is a more elegant way of dealing with this (and please accept any answer that provides that over this one) but this can probably be solved by deleting the entire vendor directory and running composer install again.
I know its not pretty but sometimes it's easier and quicker.
I had the exact same issue, which I solved by uploading the project again through filezilla to my server.
That doesn't solve the issues you are having with composer, however. Which begs the question: Assuming that you are working on a dedicated server, do you have composer installed globally in your server? If not you should still be able to do a php composer.phar update or just create an alias.
I might have misunderstood your question, and I realize that your question was asked a while back, but hopefully it will be helpful for someone else.
I made one change in my composer.json including Facebook SDK package (http://packagist.org/packages/facebook/php-sdk).
So during the composer update I got this error
$ php artisan optimize
PHP Fatal error: Interface 'SessionHandlerInterface' not found in
/Users/Leandro/www/bootstrap/compiled.php on line 2644
After this, I can't run artisan or composer commands. Always get the same error.
I tried to remove Facebook SDK from composer json but not works.
Some help? Using --no-scripts the command works fine:
composer update --no-scripts
try to do this :
composer dump-autload
composer update
i think this may or may not solve it for you ..
you may need to delete the .json file which can be found on app\storage\meta, not 100% sure but it might work ..
Check out this troubleshooting checklist, sounds like you need to do a php artisan dump-autoload though.