Interface 'Monolog\ResettableInterface' not found when running a new project - php

Whenever I try to run any command related to php artisan or composer this error shows up:
PHP Fatal error: Interface 'Monolog\ResettableInterface' not found in path\to\project\root\vendor\monolog\monolog\src\Monolog\Logger.php on line 28
I open the file, and it points me to :
class Logger implements LoggerInterface, ResettableInterface
I try to find the Logger interface and it's there.
I really can't find any other solutions and the ones recommended here by SO are outdated.
I use laravel 5.7 running composer version 1.8.0 on a xampp server with PHP 7.2.10 on Windows 10
Please feel free to ask more questions and I'll try to answer them without ruining my NDA.
Update: it works now thanks to that one person who answered.

If anyone needs this solution, you can do what Saumini Navaratnam suggested; removing the vendor folder and running composer update on the root folder. I, myself found another solution that might work and it is: running composer update --no-dev as the ResettableInterface came from a dev dependency. Weird, but it works fine now.
Again this works only on Laravel 5.7, at least for now.

Related

psycopg2 - Laravel Local Env

I am trying to get the psycopg2 module for python running in my Laravel application. It is working online on Heroku (I installed it there), but I am wondering about how I can get it running locally.
In Laravel I use:
use Symfony\Component\Process\Process;
use Symfony\Component\Process\Exception\ProcessFailedException;
Locally it throws this Error:
import psycopg2
ImportError: No module named psycopg2
On heroku, the code works properly, so it is just about the environment.
Does anyone know how to fix that?
PS: I use XAMPP locally
Thank you for your attention!
I'm running debian jessie and managed to get python 2.7 installed twice. When I specify the directory (/usr/bin/python or /usr/local/bin/python) I can make the "No module" error appear and disappear. Since I haven't seen this explanation before, I thought I'd share my experience. Seems strange that ALL the attempts at installation acted on the version in /usr/local/bin, while the PATH selects the version at /usr/bin. I think I will try removing the one at /usr/bin. Hope this helps someone.

php artisan optimize times out only on composer install

I'm running a laravel app on Azure. Things are moving in the right direction, composer install didn't use to work at all. Now however, the "php artisan optimize" command times out:
However, running "php artisan optimize" separately is no problem at all:
What could be the cause of this?
Edit:
Deleting the symfony-folder does not help, it is not present when I run the "Composer install"-command:
Increasing the timeout-limit does not help either, I increased it in both azure and in the composer.json file:
This still gives me a timeout, after installing the symfony-components again:
...
As I deployed a new clean Laravel 5 application to Azure Web apps and tried to reproduce your issue, however, it worked fine on my side either I run the command php artisan optimize or composer install or composer update.
I installed the composer at the Site extensions at the KUDU console site of the application on Azure Web apps, the url should be like: https://<your_site_name>.scm.azurewebsites.net/SiteExtensions/#gallery
There are several solutions of other developers who occur the same issue with you, you can try these solutions:
try to increase the max_execution_time or set the value to 0, refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-configurations to change the PHP build-in configurations on Azure Web Apps. And you can change the process-timeout in Composer.json file :
"config" : {
"process-timeout": 0
}
deleted the entire Symfony folder and try again. As the comments at PHP Artisan Optimize - Timed out? #1050, it seems the symfony dependencies raise the issue.
#Rkey,
According to my experience, I think the issue is more related to the symphony version/configuration. I suggest you can remove/edit the symphony configuration from the composer.lock file (NOTE: please backup this file if you cannot success, you also can recovery your environment). And then you can run this "composer install".
After installed component, You can see an alert window which shows that
your session is timeout, please refresh your browser.
You can see this information because the server is in initialization process.
Any concerns, please feel free to let me know.
I'm also having this problem. Will upgrading the plan help?
According to this upgrading to S3 helps... I haven't tried it though... Let me know if it really works.
#Rkey & #cabs, per my understanding on this question, I wanna point out that Composer is not fully supported on Azure. The issue is that it’s using Taskkill command which is blocked on Azure. We are aware of this and please feel free to submit an idea or suggestion based on the experience with Azure at https://feedback.azure.com/forums/34192--general-feedback.
I have been stuck in this problem as well for a week.
Have tried all solutions on forum but no success.
This morning finally solved after reinstall XAMPP. It was problem on my previous PHP version 5.6.19. While using new XAMPP with PHP version 5.6.28, it worked fine.

laravel command not found while using laravel command

I've recently installed composer and also installed laravel installer from composer from the commmand line just like they said in laravel documentation.
But when I used the laravel command on the command line, it show error:
sh.exe": laravel: command not found
I also added environment variable in the path variable.
~/.composer/vendor/bin
But still the same error occurs while using the laravel command.
I'm a laravel newbie and I'm stuck in laravel installation.I've searched lot of times but still could not get the solution. I've read lot of users' questions with the same problem and used their solutions but still could not fix this.
Your path /c/xampp/php:~/.composer/vendor/bin is definitly wrong. Either you have to fix it (should be something like C:/{path_to_your_composer_directory}) or you can simply use composer create-project laravel/laravel --prefer-dist to install a new laravel project.
I would go with the 2nd option, because you don't have to configure something else.
On windows system, please remove . from path (just before .Composer)

Symfony2 Project Runs On Localhost, Has File Finding Problems On EC2

I have a Symfony2 project that uses quite a few 3rd Party bundles. I use Sonata Admin Bundle for the application admin. I am almost finished with my project development and I'm trying to get it live on Amazon EC2. I am using GIT to deploy my application, I have managed to get everything setup but I am coming across a very weird problem. The project is running just fine on the local server but when I get it live I get the error:
InvalidArgumentException: Unable to load class "Sonata\AdminBundle\Admin\Admin"
While trying to run app/console commands I get the Error:
PHP Fatal error: Class 'Sonata\BlockBundle\SonataBlockBundle' not found in /var/www/html/candulifestyle.com/app/AppKernel.php on line 25
Fatal error: Class 'Sonata\BlockBundle\SonataBlockBundle' not found in /var/www/html/candulifestyle.com/app/AppKernel.php on line 25
I'm having a real hard time tracing the problem here. The project is running perfectly on my local system. Has anyone come across a problem like this. Please let me know if anyone has any insight on such a problem.
I had the same very strange problem (PHP Fatal error: Class 'Sonata\BlockBundle\SonataBlockBundle' not found although it was present in the right folder) on a DigitalOcean server (running Ubuntu 12.04), whereas I didn't have the problem on my Ubuntu 12.04 VM instance.
I finally found the solution to the problem.
I just had to update Composer as I should have already done before:
composer self-update
And then run again this:
composer install
And everything was fine again.

Symfony2.0.15 Doctrine-Fixtures Windows Command Line Fatal Error

Recently started playing around with S2, amazing stuff! A while ago started an online Symfony2 Blog tutorial, however I got stuck on the page with Doctrine Data Fixtures generation,
Here is the message I'm getting when executing php app/console doctrine:fixtures:load in the console:
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand' not found in C:\xampp\htdocs\blog-sf2\vendor\bundles\Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand.php on line 40
I am really stuck on it and I am running Windows 7, so can't really use deps file to pull dependencies from older versions (OR CAN I somehow??),
I've downloaded the newest versions of FixtureBundles and DoctrineFixtures.
Really appreciate any help on this one!
I think you need to read the installation documentation of this bundle for the 2.0 branch
You don't really "use the deps" file. The bin/vendors script uses it, and uses git. So what you need to do to "use the deps" is install git (and btw, install git-bash, you'll get a far better terminal).

Categories