PHP fatal error uncaught exception after installing magento2 - php

I have installed magento2 in my linux centos7. After installing magento2 successfully while accessing the web page is getting following error with empty content.
{{menuState.title}}
PHP version:7.1.3
OS: centos7
And the PHP-fpm error log has following error.
PHP Fatal error: Uncaught TypeError: Argument 1 passed to Zend_Controller_Plugin_Abstract::setResponse() must be an instance of Zend_Controller_Response_Abstract, instance of Magento\Framework\HTTP\PhpEnvironment\Response given, called in /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Firebug.php on line 61 and defined in /var/www/magento2/vendor/magento/zendframework1/library/Zend/Controller/Plugin/Abstract.php:70
Stack trace:
#0 /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard/Output/Firebug.php(61): Zend_Controller_Plugin_Abstract->setResponse(Object(Magento\Framework\HTTP\PhpEnvironment\Response))
#1 /var/www/magento2/lib/internal/Magento/Framework/Profiler/Driver/Standard.php(195): Magento\Framework\Profiler\Driver\Standard\Output\Firebug->display(Object(Magento\Framework\Profiler\Driver\Standard\Stat))
#2 [internal function]: Magento\Framework\Profiler\Driver\Standard->display()
#3 {main}
thrown in /var/www/magento2/vendor/magento/zendframework1/library/Zend/Controller/Plugin/Abstract.php on line 70
How can I resolve this error?

This was a Magento Bug reported ...
But it's already been ...
https://github.com/magento/magento2/issues/7068
So, come on ...
Did you update the magento? What is the current version?
I found this information at the base of Magento: https://devdocs.magento.com/guides/v2.3/config-guide/bootstrap/mage-profiler.html
You have this option ...
The temporary fix is install symfony / yaml from dev branch and then our module:
              composer require symfony/yaml: dev-issue-814
    
          composer require mirasvit/module-profiler
Try using / installing php7.2
See this Magento Project reference >>>
https://magento.stackexchange.com/questions/49000/magento-2-is-there-a-profiler
Be sure to back up before the above procedures ...
Since I don't know the correct version of your current Magento, I looked for alternatives to fix.
I hope it helps you ...
Good luck! Send news about your progress ...

Related

Phalcon\Loader\Loader not found

I have a newly cloned phalcon repository:
software: MacOS
Phalcon: 5.0.0RC4
PHP: 8.1
Zephir: 0.16.0
brew: phalcon#4.1.0
Location: ~/Documents/cphalcon
I am trying to set up my new repository by following the tutorial here.
However when I go to my page at localhost:8000, this error pops up:
Fatal error: Uncaught Error: Class "Phalcon\Loader\Loader" not found in /Users/apple/Documents/cphalcon/public/index.php:16 Stack trace: #0 /Users/apple/Documents/cphalcon/.htrouter.php(15): require_once() #1 {main} thrown in /Users/apple/Documents/cphalcon/public/index.php on line 16
I found some similar thread and they said to check my phpinfo to see if phalcon is there, and it was.
I checked for more materials but couldn't find any other clues.
I also tried changing the call to:
use Phalcon\Loader;
But it was the same
Fatal error: Uncaught Error: Class "Phalcon\Loader" not found in /Users/apple/Documents/cphalcon/public/index.php:16 Stack trace: #0 /Users/apple/Documents/cphalcon/.htrouter.php(15): require_once() #1 {main} thrown in /Users/apple/Documents/cphalcon/public/index.php on line 16
Any clues?
I believe that in version 5 the proper syntax now is Phalcon\Autoload\Loader().
Since Phalcon 5 is still in Release Candidate mode (hence the "RC4" on the version), the docs are still lagging a bit behind.
I've converted a couple of Phalcon 3 and 4 sites, and I found the Phalcon 5.0.0RC4 ChangeLog to be helpful when moving from Phalcon 4 to 5. The move from 3 to 5 is far more involved and requires finding the Phalcon 4 update doc on the Phalcon web site.
I hope this helps.

Phalcon - Class "Phalcon\Config" not found

I've installed Phalcon and trying to create new project: phalcon project store. But instead of this I get these errors:
PHP Fatal error: Uncaught Error: Class "Phalcon\Config" not found in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php:48
Stack trace:
#0 C:\Composer\vendor\phalcon\devtools\src\Commands\Builtin\Project.php(74): Phalcon\DevTools\Builder\Component\AbstractComponent->__construct(Array)
#1 C:\Composer\vendor\phalcon\devtools\src\Script.php(109): Phalcon\DevTools\Commands\Builtin\Project->run(Array)
#2 C:\Composer\vendor\phalcon\devtools\src\Script.php(148): Phalcon\DevTools\Script->dispatch(Object(Phalcon\DevTools\Commands\Builtin\Project))
#3 C:\Composer\vendor\phalcon\devtools\phalcon(65): Phalcon\DevTools\Script->run()
#4 {main}
thrown in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php on line 48
Fatal error: Uncaught Error: Class "Phalcon\Config" not found in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php:48
Stack trace:
#0 C:\Composer\vendor\phalcon\devtools\src\Commands\Builtin\Project.php(74): Phalcon\DevTools\Builder\Component\AbstractComponent->__construct(Array)
#1 C:\Composer\vendor\phalcon\devtools\src\Script.php(109): Phalcon\DevTools\Commands\Builtin\Project->run(Array)
#2 C:\Composer\vendor\phalcon\devtools\src\Script.php(148): Phalcon\DevTools\Script->dispatch(Object(Phalcon\DevTools\Commands\Builtin\Project))
#3 C:\Composer\vendor\phalcon\devtools\phalcon(65): Phalcon\DevTools\Script->run()
#4 {main}
thrown in C:\Composer\vendor\phalcon\devtools\src\Builder\Component\AbstractComponent.php on line 48
My PHP version is 8.0.8 Thread Safe x64, I've installed PSR extension and Phalcon 5.0.0 from here: https://github.com/phalcon/cphalcon/releases/tag/v5.0.0beta3, file phalcon-php8.0-ts-windows2019-vs16-x64.zip, that means I have compatible version of framework. phalcon.bat was added to environment variables. What's the problem?
Usually this error occurs when the extension is not loaded by php, see with phpinfo(), also run the componser install insider phalcon-devtools, but probably it is the php not loading the phalcon extension or PHP is not in the windows PATH , also check if the php-fpm log does not contain any extension loading errors, test in cmd the command php -v
also create a index.php and try it
<?php
use Phalcon\Mvc\Micro;
$app = new Micro();
$app->get('/', function () { echo "<h1>test</h1>";});
$app->handle();
Try do the following Go to Edit The system environment variables -> system variables -> path -> edit add phalcon.bat folder path testing here i used C:\Users\renato\Downloads\phalcon-devtools-4.2.0\phalcon-devtools-4.2.0 ( just path folder where the .sh/.bat it is, do not include the file and extension) and worked fine with php 8.0.16 windows 10 phalcon 5
and then go to the power shell and input phalcon
https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/
Do not forget to run composer install inside phalcon devtools folder.
also on powershell input php -m to see the loaded modules and if it has an error

How to use logger without composer and namespaces?

I am trying to install Mangopay https://github.com/Mangopay/mangopay2-php-sdk, but the recommended solution of installing it without composer doesn't work. I used this line:
require_once "mango/mangopay2-php-sdk-2.11.0/MangoPay/Autoloader.php";
$api = new MangoPay\MangoPayApi();
The file get's loaded, but I get the following error:
Fatal error: Uncaught Error: Class 'Psr\Log\NullLogger' not found in
/usr/local/apache2/htdocs/MangoPay/MangoPayApi.php:223 Stack trace:
#0 /usr/local/apache2/htdocs/pay.php(5): MangoPay\MangoPayApi-
>__construct() #1 {main} thrown in
/usr/local/apache2/htdocs/MangoPay/MangoPayApi.php on line 223
The issue is with the logger, which I manually downloaded and copied into the directory but it still doesn't work. I am only asking here because I am not getting any response from the developers.
Any help with manually installing the logger and getting the namespace to work with mangopay is welcome.

Laravel Cannot declare class Symfony\Component\HttpFoundation\AcceptHeader, because the name is already in use

I just took a project from a couple of months ago which was made in Laravel. This project also utilizes Laravel Voyager - the admin panel package.
After browsing to http://example.com/admin, I got this weird error which came out of nowhere and I'm also unsure how to debug it. It looks like this:
Fatal error: Cannot declare class Symfony\Component\HttpFoundation\AcceptHeader, because the name is already in use in /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php on line 22
Fatal error: Uncaught Error: Class 'Symfony\Component\HttpFoundation\AcceptHeaderItem' not found in /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php:61 Stack trace: #0 [internal function]: Symfony\Component\HttpFoundation\AcceptHeader::Symfony\Component\HttpFoundation\{closure}(Array) #1 /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php(57): array_map(Object(Closure), Array) #2 /c/Users/User/Code/example-website/vendor/symfony/http-foundation/Request.php(1664): Symfony\Component\HttpFoundation\AcceptHeader::fromString('text/html,appli...') #3 /c/Users/User/Code/example-website/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php(54): Symfony\Component\HttpFoundation\Request->getAcceptableContentTypes() #4 /c/Users/User/Code/example-website/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php(44): Illuminate\Http\Request->wantsJson() #5 /c/Users/User/Code/example-website/vendor/laravel/framework/src/Illumina in /c/Users/User/Code/example-website/vendor/symfony/http-foundation/AcceptHeader.php on line 61
This error is very expected and I've never seen it before in my project (or anywhere else for that matter).
How can I debug this issue?
As a sanity check, delete the vendor directory and then run composer install to re-fetch your dependencies and see if the error is resolved. If not, then attempt composer update to fetch the latest versions of your dependencies in which this issue may have been resolved.

Lumen 5.3 & PHP 7: Symfony Error ExceptionHandler

We have a project that uses Lumen 5.3, however when we always install PHP7 on the server it gives this error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Uncaught TypeError: Argument 1 passed to Symfony\Component\Debug\ExceptionHandler::handle() must be an instance of Exception, instance of Error given in /var/www/retail-api/vendor/symfony/symfony/src/Symfony/Component/Debug/Excepti
onHandler.php:105
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ExceptionHandler->handle(Object(Error))
#1 {main}
thrown
When we revert it back to PHP5.6 it works. Based on my research this was supposed to be fixed in Symfony > 2.6 is this correct? If so why is this happening on our environment. Most of our Laravel projects are already using PHP7. This, however is an exception, is there something that I am missing?

Categories