Doctrine file uploading error - php

Ran into a strange problem - after submitting a form via POST with enctype="multipart/form-data", Doctrine crashes with Fatal Error:
Fatal error: require(): Failed opening required '[PATH/TO/DOCTRINE]/Doctrine\Symfony\Component\HttpFoundation\File\UploadedFile.php' (include_path='.;H:\SERVER\php\PEAR') in [PATH/TO/DOCTRINE]\Doctrine\Common\ClassLoader.class.php on line 164
I don't use Symfony, but I use the Symfony HTTPFoundation and Doctrine separately. And it seems that the error happens when the code calls:
\Symfony\Component\HttpFoundation\Request::createFromGlobals();
I don't understand what does Doctrine have to do with this line...
UPD.
It wasn't autoloading the contents of Symfony HTTPFoundation "File" folder from HTTP Component, so once that was fixed it started working.
But why it was trying to access it via Doctrine Symfony component is still a mystery to me.

Related

Unable to resolve plugin "doctrine"

I am using doctrine in my ZF project and when I run it I get the exception.
Exception message: Unable to resolve plugin "doctrine"; no
corresponding plugin with that name

Symfony 3: Unable to find template

I've created an entity with generate:doctrine:entity and its controller too with generate:doctrine:crud.
All works well on local, but on the server I receive this error:
request.CRITICAL: Uncaught PHP Exception InvalidArgumentException:
"Unable to find template "entity/index.html.twig"
And the error is right, as there is no template for the entity and its actions.
But my question is: why on local Symfony "guesses" the template and anyway arranges a page while on remote it doesn't?
This error should appear also on local, why it isn't?

how add the external Stripe library to my symfony project?

I'm trying to use Stripe with my Symfony projet. I have to add a php library.
To do that I use composer. I added to my composer.json:
"stripe/stripe-php": "3.*"
Then I have to add:
require_once('vendor/autoload.php');
To my Default controller, but it seems not to work.
Adding that next the uses of the controller, the error says:
Compile Error: main(): Failed opening required 'vendor/autoload.php' (include_path='.;C:\php\pear')
I think I miss something, but what?
Thanks
Best regards

CodeIgniter Database Session Error

When I try to execute any controller of my CodeIgniter project i receive this error:
Fatal error: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read) in D:\Git\crud-farm\system\libraries\Session\drivers\Session_files_driver.php on line 49
A PHP Error was encountered
Severity: Error
Message: Class CI_Session_files_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::read)
Filename: drivers/Session_files_driver.php
Line Number: 49
Backtrace:
I tried to replace CodeIgniter system files but it didn't work. The problem appears in all projects
Problem solved by restarting Apache.
I attach the url which saved me: http://forum.codeigniter.com/thread-64763.html
In my case i did the following
Restart apache
That's it!
The files in system should not be modified. My files were modified somehow and were throwing error. I resolved my problem as below.
Download fresh codeigniter and extract files
copy system files from fresh codeigniter into your project and overwrite the whole system folder.
This should fix your problem.

FatalErrorException: Error: Class 'Symfony\Component\Form\Exception\FormException' not found

When I tried to use ShtumiUsefulBundle's Ajax autocomplete type i got the following error..
FatalErrorException: Error: Class 'Symfony\Component\Form\Exception\FormException' not found in /var/www/example.com/vendor/Shtumi/UsefulBundle/Form/Type/AjaxAutocompleteType.php line 52
My project is Symfony2.3.
Please help.
ShtumiUsefulBundle is incompatible with your Symfony version. Try to find another bundle or implement your own for needed features or downgrade your Symfony to 2.0.

Categories