[PDOException]
SQLSTATE[HY000]: General error: 2050
example:dbextra:install [--drop]
Database is setup properly, pdo is up and running, pdo_mysql is up and running, redis is up and running, elasticsearch is up and running...
If I look in my parameters.ini or I load the page and look under db in Symfony2 it tells me that everything is running fine. But I can't get dbextra:install to work and my app simply will not write to the database even though all the logs are saying that it IS writing to the database.
My app has a user name and password login and the ability to create new users. It correctly loads the forms and allows you to create a new user... but never actually writes that info to the database (even though it's saying it IS writing it to the database.)
Checked all the settings and all the servers are functioning normally (otherwise the app wouldn't run at all.)
The only error message I can get is that one.
Any ideas?
Someone using Ubuntu with Symfony2 will ABSOLUTELY run into this problem. So I thought I´d take a moment to explain the solution.
Symfony2 requires PDO... and it requires MySQL... but you can get pretty damned far without actually having pdo_mysql. If you just have PDO and MySQL installed... your application will probably run... but it will never write to the database.
And if you do a search for PDO_MySQL Ubuntu... you'll find a lot of outdated links to old versions of pdo_mysql that won't function properly with MySQL 5.5.
The solution is to run:
apt-get install php5-mysql
And then just restart apache and that will get rid of the error.
Related
I must be doing something stupid, but I just can't work it out.
I'm running a Symfony project which is connecting to a Postgres DB on different machine on the local network. The Postgres database details are currently defined in .env and work as expected. I want to move to using Symfony 'secrets' and remove the user/pw details from .env
Whilst testing, I ended up removing .env altogether and also removing the secret, yet the webpage is still successfully loading all the data from the DB. I'm now trying to work out why it is still working. Are the DB details cached somewhere on the server? Where else could they be loading from?
It can be the cache (configurations are also cached), use bin/console cache:clear to be sure.
Make sure you Server does no define the env variables by it self. Some server do not load the env variable from the env file. Instead you have to define them explicit in the server configuration.
I had a perfectly working instance of a WP-CLI wordpress plugin to upload files to S3 using the AmazonS3FullAccess policy. I migrated servers, and the copy started failing. "Failed to copy or write".
I even included the Full Administrator access to the IAM policy just to see what's going on when there are no restrictions, and the copy is still failing. Any idea what might be wrong?
Things I have tried: ensure time (via NTPD synchronization) on the new server is correct. Cross check the environment: php version, etc. The application files are exactly the same. I also used the host files method to check the previous server and it is working well.
Solved the problem by creating new access keys. For some reason, it seems that migrating a server will make the old access keys stop working? Ah, well.
P.S. I also downgraded the policies right back, to only what the application needs.
For some unexplained reason I can't use alfresco from yesterday.
Let me tell you how happens.
First of all, I didn't change any conf file or something like that.
I started tomcat and postgre services and after that, I tried to load "localhost:8080/share" but it was loading forever.
I tried to check the logs files, but no use, too. There is no error messages, nothing unusual.
After that, I deleted alfresco and share folder inside the "webapps", just in case, but it failed, too.
Finally, I can't stop these services from service manager, cause I am at work and I have no access privilege.
My main concern is that I don't even know the cause of this issue, so I don't even know how to ask for help.
When you don't have permission to delete the folder(share + alfresco) and stopping the services also. Without stopping the services, you can't delete the complete files from alfresco and share folders.
You need to find the problem is in Alfresco share, Alfresco Repo or database or tomcat.
Check Tomcat
Type http://localhost:8080 and make sure Tomcat is running or not.
Check Database
Connect your database service from Service manager, via PgAdmin tool to check the database service is running or not.
Check Repo
http://localhost:8080/alfresco - It should display some basic information about Alfresco Repo otherwise, it is clearly decided the Alfresco Repo itself is failed.
Check Share
http://localhost:8080/share - It should display the login page, if everything works fine.
Logs
Check and share, alfresco.log, share.log, solr.log, catalina, tomcatstdout and tomcatstderror logs files. Definitely, some of the error information would have recorded any of these logs files.
I recently updated my schema in Symphony 2.7 project with Doctrine, but I was still getting an error. It turned out that I had to run:
app/console redis:flushall
In order for the schema to update accordingly and not be mapped incorrectly.
Is there a way for me to implement schema changes without having to kill user sessions when I run redis:flushall?
It's very inconvenient when deploying code to a production server to have to kill user sessions.
Thanks for your help!
I have one problem with Doctrine (or with my server configuration, I don't know where is the problem) in my Symfony2 web. I have been looking for an answer since several days but I haven't found it yet.
I need to connect my symfony web to a remote Microsoft SQL database through Doctrine. For this reason, I have added the "database_driver: pdo_sqlsrv" param in app/config/parameters.yml, but when I try to execute (in my Mac) a command like:
php bin/console doctrine:database:create
or
php bin/console doctrine:generate:entities AppBundle/Entity/Product
I get the following error:
[Doctrine\DBAL\Driver\PDOException] could not find driver
[PDOException] could not find driver
I have checked the phpinfo and the driver doesn't appear (only mysql, sqlite). I don't know if it's possible to add MSSQL, because in Microsoft SQL Server Functions (PDO_SQLSRV) appears that it needs to be running on a Windows.
Is not possible to access a mssql database without Windows? (If yes, how can I do it).
Would I need a Windows hosting?
Thanks in advance.
I'm using sql server on my last project.
here is what i've done to make it work on my dev environment
install pdo-dblib
composer require leaseweb/doctrine-pdo-dblib
configure doctrine to use the driver_class from the lib above instead of refering the sql_serv driver
driver_class: Lsw\DoctrinePdoDblib\Doctrine\DBAL\Driver\PDODblib\Driver