Laravel/Illuminate Fatal Error - php

I got a web app that works on my local computer, but not on my server. I get this error on server. I checked the code that the error mentions about, and there's nothing wrong with it.
Do you have any idea what causes this?
Thank you very much in advance.
Here's my error message:
Fatal error: Interface 'Illuminate\Exception\ExceptionDisplayerInterface' not found in /var/www/test-app.domain.com/public_html/vendor/laravel/framework/src/Illuminate/Exception/SymfonyDisplayer.php on line 6
Here's SymphonyDisplayer.php's line 6:
class SymfonyDisplayer implements ExceptionDisplayerInterface {
It says that there's no ExceptionDisplayerInterface. However, it's right next to this file, in the same directory. ExceptionDisplayerInterface.php is in Exception folder with SymphonyDisplayer.php
Here's my composer install output:
>>composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- jeremeamia/SuperClosure 1.0.1 requires nikic/php-parser ~0.9 -> no matching package found.
- jeremeamia/SuperClosure 1.0.1 requires nikic/php-parser ~0.9 -> no matching package found.
- Installation request for jeremeamia/superclosure 1.0.1 -> satisfiable by jeremeamia/SuperClosure[1.0.1].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Here's a new error after executing composer update:
Fatal error: Interface 'Whoops\Handler\HandlerInterface' not found in /var/www/test-app.domain.com/public_html/vendor/filp/whoops/src/Whoops/Handler/Handler.php on line 17
Here's some more outputs while trying to figure out the problem:
>>composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: OK
Checking composer.json: OK
Checking disk free space: OK
Checking composer version: OK
>>composer self-update
You are already using composer version 0d4c2bb7d7a864a9b3e876908e743310cdeaa5e6.

Phew. I fixed it.
Here's how I did it, if anyone else sees this type of error message:
rm -rf vendor && composer update -v
I guess my vendor directory went nuts while I was doing some stuff with SFTP yesterday.
Thanks everyone.

Related

Laravel composer error -> root composer.json requires adldap2/adldap2-laravel ^6.0 [duplicate]

I did a lot of research on the web, but did not find a documentation of the composer error log. In the discussions I found, nobody had an explanation that was consistent with the error log. For example:
[Support] Need explanation for "Conclusion: don't install ..."
Why composer says "Conclusion: don't install" when (seemingly) no obstacles are present?
I know, what composer does and can resolve issues on my own, but I often have to consult packagist.org for this. Despite being quite (and unnecessarily) verbose, the composer log only gives me some hints. It does not really point out the concrete problems.
Does anyone know of a complete documentation or how to explain the reasoning behind the logs, maybe taking the above ones as an example?
Documentation of Composer can be found at getcomposer.org/doc, especially Troubleshooting section. Usually the dependency problems comes from misconfiguration of your composer.json and understanding Composer logs comes with experience or learning on trial and error. Documenting every possible errors out of hundreds can become quickly outdated. If you believe some specific error isn't clear enough, you can always raise a new suggestion at the Composer's GitHub page.
As suggested in linked GitHub issue, "Conclusion: don't install" message it could be related to requirements defined in minimum-stability. Another linked question could be related to Composer's bug as reported at GH-7215.
Errors
Here is a small guide explaining the common Composer's errors:
Can only install one of: org/package[x.y.z, X.Y.Z].
If you see this messages, that could be the main cause of the dependency issue. It basically means that based on the Composer's dependency calculation both of these versions are required, but only one major version can be installed (you cannot have both x.y.z and X.Y.Z, unless you split your configuration for different folders). To see why these packages are required, use the composer why/depends command and adjust the dependencies accordingly.
See: How to resolve a "Can only install one of:" conflict? & How to solve two packages requirements conflicts when running composer install?
Installation request for org/package2 (locked at vX.Y.Z)
This message means that there was an installation request for org/package, however, it is locked at X.Y.Z. If the requested version is not compatible with the locked version (like a different major version), you cannot install both. This message often comes along with already mentioned "Can only install one" one. So, whenever you see "locked at", that means Composer reads your installed package version from the composer.lock file. To troubleshoot, you can use composer why/depends command to find why the package was requested and adjust the compatibility, otherwise, you may try to remove composer.lock file and start from scratch (ideally from the empty folder).
See: Installation failed for laravel/lumen-installer: guzzlehttp/guzzle locked at 6.3.0
org/package1 vx.y.z conflicts with org/package2[vX.Y.Z].
It is a similar issue as above where two packages are conflicting and you need to solve the dependency manually. Reading the whole context of the message may give you some more clues. Checking the dependency tree may also help (composer show -t).
conflict with your requirements or minimum-stability
This message means as it reads, so you should check the required version and/or your minimum-stability settings.
This can be caused by a package being marked as non-stable and your requirements being "stable only. See: But these conflict with your requirements or minimum-stability
Or because of conflicts with other installed packages. See: How to identify what is preventing Composer from installing latest version of a package?.
For any other errors, check out the official Composer's Troubleshooting page.
Troubleshooting
Here are more suggestions how to troubleshoot the Composer dependency issues in general:
Add -v/-vv/-vvv parameter to your command for more verbose output.
Run composer diagnose to check for common errors to help debugging problems.
If you seeing "locked at x.y.z" messages, it relates to packages locked in your composer.lock.
Test your composer.json on the empty folder.
Keep your composer.json to minimum.
Run composer show -t to see your current dependency tree.
Run composer show -a org/package x.y.z to check the details about the package.
Feel free to ask a new question at Stack Overflow.
To fully debug Composer's dependency problem, you can:
Analyse or modify the source code (e.g. DependencyResolver/Problem.php).
Run Composer under XDebug, either by the breakpoint or generating a full or partial trace file.
Useful threads explaining common errors:
How to resolve a "Can only install one of:" conflict?
composer.json fails to resolve installable set of package
Discover latest versions of Composer packages when dependencies are locked
When trying to install php-jwt facing trouble with auth0
Reference - Composer error "Your PHP version does not satisfy requirements" after upgrading PHP
How to identify what is preventing Composer from installing latest version of a package?
Error:
somevendor/somepackage[v1.0.0, ..., v1.9.1] require composer-plugin-api ~[X.X]
This means that that somevendor/somepacakge requires that a specific version range of Composer to be installed.
Run composer -v and compare it to the version constraint in the error message (shown as ~X.X in the example above, but that could be something like ^1.0, or ^2.2, etc).
If your version does not match the constraint, see if you can either:
upgrade or downgrade your composer version to match the composer constraint in the error message
upgrade somevendor/somepackage so that it can work with your Composer version.

Laravel: Install Microsoft Azure Client Library with composer

Does anyone installed Microsoft Azure Client Library to a Laravel 5 project with composer on an Ubuntu server?
When I try to install with Composer (command: composer require microsoft/windowsazure), I got the next error:
Using version ^0.4.1 for microsoft/windowsazure
./composer.json has been updated
> php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for microsoft/windowsazure ^0.4.1 -> satisfiable by microsoft/windowsazure[v0.4.1].
- microsoft/windowsazure v0.4.1 requires pear-pear2.php.net/http_request2 * -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
Does anyone know what am I doing wrong?
Thanks for the help.
The problem was solved by modifying the config of the composer, by setting the secure-http to false
"config": {
"secure-http": "false"
}

Symfony startup

I need help with creating a symfony project in ubuntu/eclipse i get a lot of warnings. i Use:
ubuntu: 15.04
eclipse: 4.5.0 mars
symfony feature: 1.1.0.20150705
I use Symfony Feature to create projects using a built in wizard.
Project details:
PHP version: 5.6
Symfony version: v2.7.3
Override composer.jason values: i use defaults
i get errors with app/bootstrap.php.cache
Maybe there is a good tutorial that might help me, but 'till now i haven't found one...
Maybe elipse isn't good for symfony project.
Here are some error messages:
!ENTRY com.dubture.composer.core 4 4 2015-08-06 20:49:38.196
!MESSAGE PHP Warning: require_once(/var/www/test3/app/bootstrap.php.cache): failed to open stream: No such file or directory in /var/www/test3/app/console on line 10
PHP Fatal error: require_once(): Failed opening required '/var/www/test3/app/bootstrap.php.cache' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/test3/app/console on line 10
and second
!ENTRY com.dubture.composer.core 4 4 2015-08-06 20:50:29.267
!MESSAGE Installing symfony/framework-standard-edition (v2.7.2)
- Installing symfony/framework-standard-edition (v2.7.2)
Loading from cache
Created project in test1
> SymfonyStandard\Composer::hookRootPackageInstall
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for sensiolabs/security-checker v2.0.5 -> satisfiable by sensiolabs/security-checker[v2.0.5].
- sensiolabs/security-checker v2.0.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 2
- sensiolabs/security-checker v2.0.5 requires ext-curl * -> the requested PHP extension curl is missing from your system.
- sensio/distribution-bundle v4.0.0 requires sensiolabs/security-checker ~2.0 -> satisfiable by sensiolabs/security-checker[v2.0.5].
- Installation request for sensio/distribution-bundle v4.0.0 -> satisfiable by sensio/distribution-bundle[v4.0.0].
thats a piece of the whole log file, those are the messages i get in gui.
Composer installation failed with an error (see second set of error messages) because it could not install all dependencies.
It says in the error message:
the requested PHP extension curl is missing from your system.
You need to install this extension for PHP to get all required files to get your project up and running.
When Symfony2 starts up, it need some of bootstrap cookies which will be removed, eventually. From my experience, 'bootstrap.php.cache' file existed for ACME bundle example pages, and It is not essential file.
The solution is simple.
You just need to create 'bootstrap.php.cache' file in /var/www/test3/app/ folder. The content of 'bootstrap.php.cache' can be blank.
touch bootstrap.php.cache
Hope this works well for you. Good luck!
It's possible that, you don't have right permission for read in these file, check this sudo chmod 755 in these file. If you haven't that file, create it how suggests YONGSOO KIM
The solution is simple. You just need to create bootstrap.php.cache
file in /var/www/test3/app/ folder. The content of bootstrap.php.cache
can be blank.
You can fix problem with versions of package sensiolabs/security-checker or generate bootstrap cache file like answer here https://stackoverflow.com/a/6884027/4356973

phpunit and CodeCoverage

I'm running a vagrant box w/ a simple lamp stack. I've installed phpunit globally via composer :
composer global require "phpunit/phpunit=4.1.*"
When I run phpunit I get the following error:
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/share/php/PHPUnit/Autoload.php on line 46
HP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='/home/vagrant/.composer/vendor/phpunit/php-text-template:/home/vagrant/.composer/vendor/phpunit/phpunit-mock-objects:/home/vagrant/.composer/vendor/phpunit/php-timer:/home/vagrant/.composer/vendor/phpunit/php-token-stream:/home/vagrant/.composer/vendor/phpunit/php-file-iterator:/home/vagrant/.composer/vendor/phpunit/php-code-coverage:/home/vagrant/.composer/vendor/phpunit/phpunit:/home/vagrant/.composer/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in /usr/share/php/PHPUnit/Autoload.php on line 46
My research seems to imply that it's a problem with CodeCoverage not installing, but I'm having problems trying to get that installed. I've tried to install via composer and can't get it working.
Via Composer, I've tried adding to the global:
composer global require "phpunit/php-code-coverage": "3.0.*#dev"
and I get this output:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package phpunit/php-code-coverage could not be found in any version, there may be a typo in the package name.
Problem 2
- phpunit/phpunit 4.1.3 requires phpunit/php-code-coverage ~2.0 -> no matching package found.
- phpunit/phpunit 4.1.3 requires phpunit/php-code-coverage ~2.0 -> no matching package found.
- Installation request for phpunit/phpunit == 4.1.3.0 -> satisfiable by phpunit/phpunit[4.1.3].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
No clue what I'm doing wrong!
you need to reinstall code-coverage 2.0 first
composer global require "phpunit/php-code-coverage":"2.0.*#dev"
then you install phpunit
composer global require "phpunit/phpunit=4.1.*"

Cannot install phpmd through composer

I have this in my composer.json file:
"require": {
"phpmd/phpmd:": "1.4.0"
}
When I do:
php composer.phar update
I get:
Problem 1
- The requested package phpmd/phpmd: 1.4.0 could not be found.
In the documentation they say it can be isntalled through composer with the line I used - "phpmd/phpmd:": "1.4.0".
But it's not working.
http://phpmd.org/download/index.html
Why?
The phpmd/phpmd package is at packagist (https://packagist.org/packages/phpmd/phpmd), the default repository for composer to search for packages. Not being able to locate phpmd sounds like you either have an offline system, a problem with your network or packagist.org had a timeout.
/edit:
I see you have a typo. Don't write phpmd/phpmd: but phpmd/phpmd (without the trailing colon).

Categories