I'm using Symfony 2.7 and I recently made local changes like moving a Bundle from src/subfolder/MyBundle to src/MyBundle.
My problem: When having a ClassNotFoundException, the behavior of Symfony changed, the exception is triggering Symfony to discover my whole hard drive instead of my project only.
Situation: for the example I simply deleted a use statement from one of my move Bundle's sources :
//use CallMapBundle\Authentification;
Before the changes (expected behavior):
Attempted to load class "Authentication" from namespace "FE\CallMapBundle\Bundle\Controller".
Did you forget a "use" statement for another namespace?
After the changes:
[1] Symfony\Component\Debug\Exception\FatalErrorException: Error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(//var/lib/apt/lists/partial): failed to open dir: Permission denied in /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php:148
Stack trace:
#0 [internal function]: RecursiveDirectoryIterator->__construct('//var/lib/apt/l...', 4096)
#1 /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php(148): RecursiveDirectoryIterator->getChildren()
#2 /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php(117): Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->findClassInPath('/', 'DemandeCours', 'myfunctions')
#3 /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php(63): Sym
at n/a
in /path/to/project/vendor/symfony/symfony/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php line 148
My question is why is now Symfony trying to scan my whole hard drive ?
Related
Where is FPDF? I use Wordpress and Go Daddy, I am trying to use this WooCommerce PDF Watermark, and I am getting a fatal error that causes the watermark not to be visible.
The error is below, how can I fix this?
Notice: iconv(): Wrong charset, conversion from UTF-8' to ISO-8859-1//TRANSLIT' is not allowed in /var/www/wp-content/plugins/woocommerce-pdf-watermark/includes/class-wc-pdf-watermarker.php on line 128
Fatal error: Uncaught Exception: FPDF error: Some data has already been output, can't send PDF file in /var/www/wp-content/plugins/woocommerce-pdf-watermark/includes/lib/fpdf/fpdf.php:292 Stack trace: #0 /var/www/wp-content/plugins/woocommerce-pdf-watermark/includes/lib/fpdf/fpdf.php(1081): FPDF->Error('Some data has a...') #1 /var/www/wp-content/plugins/woocommerce-pdf-watermark/includes/lib/fpdf/fpdf.php(1020): FPDF->_checkoutput() #2 /var/www/wp-content/plugins/woocommerce-pdf-watermark/includes/class-wc-pdf-watermarker.php(521): FPDF->Output() #3 /var/www/wp-content/plugins/woocommerce-pdf-watermark/includes/class-wc-pdf-watermark.php(610): WC_PDF_Watermarker->watermark(NULL, NULL, '/var/www/wp-con...', NULL, true) #4 /var/www/wp-includes/class-wp-hook.php(303): WC_PDF_Watermark->maybe_render_preview('') #5 /var/www/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #6 /var/www/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #7 /var/www/wp-admin/admin.php(175): do_action('admin_init') #8 {m in /var/www/wp-content/plugins/woocommerce-pdf-watermark/includes/lib/fpdf/fpdf.php on line 292
The server hosting your WordPress site must have the PHP class FPDF installed.
It is generating PDF files free of charge.
That class is one of the requirements of the Plugin "WooCommerce PDF Watermark".
See if you can install it at Go Daddy.
For instance by making FPDF a Composer requirement, if you can use Composer with your hosting package.
WordPress error on live website:
I can not understand what the error means. This error happened when I updated the WordPress version.
Error like this :
Deprecated: date.php is deprecated since version 5.3.0! Use wp-includes/class-wp-date-query.php instead. in /home/stageberide/public_html/public/blog/wp-includes/functions.php on line 4967
Deprecated: class-oembed.php is deprecated since version 5.3.0! Use wp-includes/class-wp-oembed.php instead. in /home/stageberide/public_html/public/blog/wp-includes/functions.php on line 4967
Fatal error: Uncaught Error: Call to undefined function wp_recovery_mode() in /home/stageberide/public_html/public/blog/wp-includes/load.php:870 Stack trace: #0 /home/stageberide/public_html/public/blog/wp-includes/load.php(754): wp_is_recovery_mode() #1 /home/stageberide/public_html/public/blog/wp-settings.php(303): wp_get_active_and_valid_plugins() #2 /home/stageberide/public_html/public/blog/wp-config.php(89): require_once('/home/stageberi...') #3 /home/stageberide/public_html/public/blog/wp-load.php(37): require_once('/home/stageberi...') #4 /home/stageberide/public_html/public/blog/wp-admin/admin.php(34): require_once('/home/stageberi...') #5 /home/stageberide/public_html/public/blog/wp-admin/index.php(10): require_once('/home/stageberi...') #6 {main} thrown in /home/stageberide/public_html/public/blog/wp-includes/load.php on line 870
first of all, create backup on your hosting provider. then,
Try downloading WordPress again, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), and delete then replace your copies of everything on the server except the wp-config.php file and the /wp-content/ directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings.
Some uploaders tend to be unreliable when overwriting files, so don’t forget to delete the original files before replacing them.
I have just deployed my application on the server. If I use APP_ENV=dev, everything works fine but if I use APP_ENV=prod, I get the following error:
Fatal error: Uncaught Twig\Error\LoaderError: The
"/home/httpd/vhosts/example.com/httpdocs/api_tapalle\vendor\symfony\framework-bundle/Resources/views"
directory does not exist
("/home/httpd/vhosts/example.com/httpdocs/api_tapalle\vendor\symfony\framework-bundle/Resources/views").
in
/home/httpd/vhosts/example.com/httpdocs/api_tapalle/vendor/twig/twig/src/Loader/FilesystemLoader.php:106
Stack trace: #0
/home/httpd/vhosts/example.com/httpdocs/api_tapalle/var/cache/prod/ContainerTP5linE/srcApp_KernelProdContainer.php(471):
Twig\Loader\FilesystemLoader->addPath('/home/httpd/vho...',
'Framework') #1
/home/httpd/vhosts/example.com/httpdocs/api_tapalle/var/cache/prod/ContainerTP5linE/srcApp_KernelProdContainer.php(729):
ContainerTP5linE\srcApp_KernelProdContainer->getTwigService() #2
/home/httpd/vhosts/example.com/httpdocs/api_tapalle/var/cache/prod/ContainerTP5linE/srcApp_KernelProdContainer.php(346):
ContainerTP5linE\srcApp_KernelProdContainer->getSensioFrameworkExtra_View_ListenerService() #3 /home/httpd/vhosts/y in /home/httpd/vhosts/example.com/httpdocs/api_tapalle/vendor/twig/twig/src/Loader/FilesystemLoader.php
on line 106
Since I have this error, I have used php bin/console cache:clear -e prod to clear the cache and then uploaded var and vendor directories again.
The weird thing is that vendor\symfony\framework-bundle/Resources/views and vendor/twig/twig/src/Loader/FilesystemLoader.php exist on the server!
Why do I get this error?
updlas the project with all the cache production, dont make a cache clear
I'm deploying Symfony2 for the first time on a shared hosting.
I get different errors:
FIrst one when I try to acces the website by its normal url:
Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "C:/wamp/www/SocProNetbeans/app/logs/prod.log" could not be opened: fopen(C:/wamp/www/SocProNetbeans/app/logs/prod.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory' in /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php:4987 Stack trace: #0 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(4931): Monolog\Handler\StreamHandler->write(Array) #1 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(4856): Monolog\Handler\AbstractProcessingHandler->handle(Array) #2 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(5056): Monolog\Handler\AbstractHandler->handleBatch(Array) #3 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(5361): Monolog\Handler\FingersCrossedHandler->handle(Array) #4 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/cl in /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php on line 4987
Second one is that I don't receive some background images in development mode
You need to give write permissions for the two following folders :
app/logs
app/cache
Have a look at symfony configuration and setup doc.
I have install Groovy 2.1.1 in my unix box. While executing groovysh getting the below error.
Exception in thread "main" java.lang.NoClassDefFoundError: error:
Caused by: java.lang.ClassNotFoundException: error:
at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:660)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:346)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
Could not find the main class: error:. Program will exit.
What could be the possible root cause for this error...???
Somewhere, you try to use the class error: (and yes, Groovy thinks that the colon is part of the class name), either in the script you execute (i.e. there must be new error: somewhere) or you wrote something like groovysh error: or you import error: (maybe indirectly)
Since you are using IBM J9, according to the Grails FAQ, the J9 need an argument to work well with Groovy, otherwise you may get a NoClassDefFound error:
Add -Xverify:none to JVM arguments
Download Groovy Binary From http://groovy.codehaus.org/Download
Download zip: Binary Release
Extract Local Disk say D;\GROOVY\ groovy-2.3.9
It contains the Folder Structure
D:.
├───bin
├───conf
├───embeddable
├───indy
├───lib
└───META-INF
Go to Control Panel\User Accounts\User Accounts Change My Environment Variables
Set/new GROOVY_HOME = D:\GROOVY\groovy-2.3.9 (don’t put : semicolon)
Set PATH = C:\Program Files\Java\jdk1.8.0_25\bin;%GROOVY_HOME%\bin;
Add groovy-all.jar to CLASSPATH
D:\ GROOVY\ \groovy-2.3.9\embeddable\groovy-all-2.3.9.jar;.
Close and Open Command and Say –groovy
For console -groovyConsole