Symfony: how to debug unexpected '\' (T_NS_SEPARATOR) - symfony

I am getting the following error message in Symfony:
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING)
when I execute DoctrineMigrations for example this one line shows up?
how can I debug this?
this is the full trace:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING) in /Library/WebServer/Documents/hrd_3/var/cache/dev/appDevDebugProjectContainer.php:7087
Stack trace:
#0 /Library/WebServer/Documents/hrd_3/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(117): Symfony\Component\HttpKernel\Kernel->initializeContainer()
#1 /Library/WebServer/Documents/hrd_3/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#2 /Library/WebServer/Documents/hrd_3/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(117): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /Library/WebServer/Documents/hrd_3/bin/console(29): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
in /Library/WebServer/Documents/hrd_3/var/cache/dev/appDevDebugProjectContainer.php on line 7087
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING) in /Library/WebServer/Documents/hrd_3/var/cache/dev/appDevDebugProjectContainer.php:7087
Stack trace:
#0 /Library/WebServer/Documents/hrd_3/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(117): Symfony\Component\HttpKernel\Kernel->initializeContainer()
#1 /Library/WebServer/Documents/hrd_3/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(68): Symfony\Component\HttpKernel\Kernel->boot()
#2 /Library/WebServer/Documents/hrd_3/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(117): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /Library/WebServer/Documents/hrd_3/bin/console(29): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
in /Library/WebServer/Documents/hrd_3/var/cache/dev/appDevDebugProjectContainer.php on line 7087
update:
in the debug container on 7087:
class VichUploaderBundleHandlerDownloadHandler_00000000110518fa000000015e248fd4966f7bb604f68fe14d5ab23e4a657cd2 extends \\Vich\UploaderBundle\Handler\DownloadHandler implements \\ProxyManager\Proxy\VirtualProxyInterface
{
if i disable this module, then another class will have this problem... like randomly.

I've found that the issue is caused by new zendframework v3.0.3 - see https://github.com/symfony/symfony/issues/9815
So for the quick fix at the moment just add
"zendframework/zend-code": "3.0.2"
into your composer file

Same bug is in symfony/framework-bundle version 2.8.13, file DependencyInjection/FrameworkExtension.php,
line 374:
$container->setParameter('router.cache_class_prefix', $container->getParameter('kernel.container_class'));
Version 2.8.12 is OK:
$container->setParameter('router.cache_class_prefix', $container->getParameter('kernel.name').ucfirst($container->getParameter('kernel.environment')));
Tested on PHP 5.6.26 ...

Related

unable to login wordpress localhost xaamp

I am getting an error whenever i try to open http://localhost/wordpress/wp-admin/
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php:1668 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-includes\wp-db.php(632): wpdb->db_connect() #1 C:\xampp\htdocs\wordpress\wp-includes\load.php(425): wpdb->__construct('root', '', 'practice_debut', 'localhost') #2 C:\xampp\htdocs\wordpress\wp-settings.php(116): require_wp_db() #3 C:\xampp\htdocs\wordpress\wp-config.php(90): require_once('C:\xampp\htdocs...') #4 C:\xampp\htdocs\wordpress\wp-load.php(37): require_once('C:\xampp\htdocs...') #5 C:\xampp\htdocs\wordpress\wp-blog-header.php(13): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\wordpress\index.php(17): require('C:\xampp\htdocs...') #7 {main} thrown in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 1668
Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in C:\xampp\htdocs\wordpress\wp-includes\formatting.php:4316 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-includes\class-wp-fatal-error-handler.php(190): esc_url('https://wordpre...') #1 C:\xampp\htdocs\wordpress\wp-includes\class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false) #2 C:\xampp\htdocs\wordpress\wp-includes\class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false) #3 [internal function]: WP_Fatal_Error_Handler->handle() #4 {main} thrown in C:\xampp\htdocs\wordpress\wp-includes\formatting.php on line 4316
when i tried for solutions i came across this one "untick mysqli and tick nd_mysqli"
but i don't know how to do this in localhost xamamp. I am new to wordpress and localhost.
Also when i tried to open http://localhost/phpmyadmin/
i get this error
phpMyAdmin - Error
The mysqli extension is missing. Please check your PHP configuration. See [a#doc/html/faq.html#faqmysql#documentation]our documentation for more information.
Try to use Wampserver64 application. Maybe your problem solved.

How to fix WordPress kses error and fatal error handler

I'm new at making website. Even I only know Html Coding. I'm running a website using WordPress, but it is facing problem everyday at same time. Everyday at the same time site is showing Http 500 error.
So as I don't know any kind of coding, every day I have to delete WordPress from my site then again have to install it then I have to restore website using Updraftplus. But I want to fix this oroblem.
I have an option in my cPanel called "Errors". I find this error from there.
I copied what there was said:
1st error:
[Mon Dec 23 03:46:44.895719 2019] [lsapi:error] [pid 1014092:tid 47766993704704] [client 141.8.188.1:46957] [host gokumovie.com] Backend fatal error: PHP Fatal error: Uncaught Error: Call to undefined function esc_url() in /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php:190\nStack trace:\n#0 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)\n#1 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)\n#2 [internal function]: WP_Fatal_Error_Handler->handle()\n#3 {main}\n thrown in /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php on line 190\n
2nd error :
Backend fatal error: PHP Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /home/gokumovi/public_html/wp-includes/formatting.php:4316\nStack trace:\n#0 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(190): esc_url('https://wordpre...')\n#1 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)\n#2 /home/gokumovi/public_html/wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)\n#3 [internal function]: WP_Fatal_Error_Handler->handle()\n#4 {main}\n thrown in /home/gokumovi/public_html/wp-includes/formatting.php on line 4316\n

Symfony error, 'App' is unexpected in Laravel 5.5

I am using Laravel5.3:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Parse error: syntax error, unexpected 'App' (T_STRING), expecting ']'*
I have tried using:
php -S localhost:8000 -t public/*
But I couldn't interpret the response. Here is the response below:
Fatal error: Uncaught ReflectionException: Class view does not exist in C:\Users\S Hassan\Documents\projects\laravel\laravel5.5\zera\vendor\laravel\framework\src\Illuminate\Container\Container.php:752 Stack trace: #0 C:\Users\S Hassan\Documents\projects\laravel\laravel5.5\zera\vendor\laravel\framework\src\Illuminate\Container\Container.php(752): ReflectionClass->__construct('view') #1 C:\Users\S Hassan\Documents\projects\laravel\laravel5.5\zera\vendor\laravel\framework\src\Illuminate\Container\Container.php(631): Illuminate\Container\Container->build('view') #2 C:\Users\S Hassan\Documents\projects\laravel\laravel5.5\zera\vendor\laravel\framework\src\Illuminate\Container\Container.php(586): Illuminate\Container\Container->resolve('view', Array) #3 C:\Users\S Hassan\Documents\projects\laravel\laravel5.5\zera\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(721): Illuminate\Container\Container->make('view', Array) #4 C:\Users\S Hassan\Documents\projects\laravel\laravel5.5\zera\vendor\laravel\framework\src\I in C:\Users\S Hassan\Documents\projects\laravel\laravel5.5\zera\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 752
Even a tip in solving the issue will do a lot for me because I am still new with Laravel.
I have found the solution. After using Image intervention, there was a comma I omitted in config\app.php while adding a new item to the providers' array.
Thanks

Fatal error: Uncaught exception 'ReflectionException' with message 'Class Cl\CommonBundle\Entity\integer does not exist

I have developed application in symfony2.3, it's working perfect in development environment but while I move to production it throws error. I tried but it can't resolve.
Following all error comes form different page :
This error comes while I tried to access my home page.
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Cl\CommonBundle\Entity\integer does not exist' in /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php:795 Stack trace: #0 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php(795): ReflectionParameter->getClass() #1 [internal function]: Doctrine\Common\Proxy\ProxyGenerator->generateMethods(Object(Doctrine\ORM\Mapping\ClassMetadata)) #2 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php(276): call_user_func(Array, Object(Doctrine\ORM\Mapping\ClassMetadata)) #3 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php(155): Doctrine\Common\Proxy\ProxyGenerator->generateProxyClass(Object(Doctrine\ORM\Mapping\ClassMetadata), '/opt/lampp/htdo...') #4 /opt/lampp/htdocs/Cl/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php(71 in /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php on line 51
When I clear cache of production environment in command line, it throws following exception :
[Doctrine\Common\Proxy\Exception\UnexpectedValueException]
The type hint of parameter "user" in method "setUser" in class "Cl\CommonBundle\Entity\GroupEventComment" is invalid.
[ReflectionException]
Class Collegelife\CommonBundle\Entity\integer does not exist
Once this has been solved then it throws to other class, so I can't understand that what's happen.
When I tried to login into page :
it shows me error like :
Fatal error: require(): Failed opening required '/opt/lampp/htdocs/collegelife/app/cache/prod/doctrine/orm/Proxies/__CG__CollegelifeCommonBundleEntityUniversity.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/collegelife/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 207
I had the same question and resolved it.
Because My Entity's setting.
You can't type hint on a scalar type (integer/string/boolean etc) in PHP. e.g.
public function setSortOrder(\integer $sortOrder)
Should be:
public function setSortOrder($sortOrder)

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to load class "Twig_Extension_Escaper"'

I have this error in my system in the production server, but I have no idea why cause in my development server everything run fine.
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to load class "Twig_Extension_Escaper"' in /home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php:259 Stack trace: #0 /home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php(98): Symfony\Component\ClassLoader\ClassCollectionLoader::getOrderedClasses(Array) #1 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache(2303): Symfony\Component\ClassLoader\ClassCollectionLoader::load(Array, '/home/content/7...', 'classes', false, false, '.php') #2 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache(2139): Symfony\Component\HttpKernel\Kernel->doLoadClassCache('classes', '.php') #3 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache(2173): Symfony\Component\HttpKernel\Kernel->boot() #4 /home/content/79/11253479/html/index.php(27): Symfony\Component\HttpKernel\Kernel->handle(Object(S in /home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php on line 259
please try composer update -o and afterwards app/console cache:clear --env=prod.
Further check that the file vendor/twig/twig/lib/Twig/Extension/Escaper.php actually exists on your production server.

Resources