From Symfony 4, I am on (migration) version 20190708084642 and the only next version is 20190708121109 (I generated a Migration file named "Version20190708121109.php")
If I execute the command ./bin/console doctrine:migrations:migrate, I get this SQL error :
because the ./bin/console doctrine:migrations:migrate command run a old migration file. Why this command execute an old migration file ? (the 20190701095432)
Is it normal ?
EDIT : in my database, my current migration version is 20190708084642, I see this same current version also when I execute the command ./bin/console doctrine:migrations:status
i don't know if this will solving your problem, but, in my case, i change my sql from phpMyAdmin to MySql 5.7. and my problem is done
Related
I recently got this error when running bin/console doctrine:migrations:migrate:
The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.
However, running the sync-metadata-storage command yields the same error.
What can I do?
As mentioned in this GitHub issue one possible fix is to specify the MySQL server version in the server URL:
DATABASE_URL=mysql://root:#127.0.0.1:3306/test?serverVersion=mariadb-10.4.11
Then, you should be able to run the bin/console sync-metadata-storage command.
Read more about this configuration option in the doctrine documentation:
[…] you can pass the serverVersion option with a vendor specific version string that matches the database server version you are using […]
If you are running a MariaDB database, you should prefix the serverVersion with mariadb- (ex: mariadb-10.2.12).
I had to downgrade the doctrine/doctrine-migrations-bundle to version "^2.1"
Not sure if that applies here, but I had issues with doctrine lately aswell.
I did a composer update and ever since then, my project wouldn't run anymore. My issue was based on a new version of the following bundle:
https://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html
They restructred the doctrine_migrations.yaml file and I still had the old one. I tried to change the contents to the new 3.0 version but that lead exactly to your error.
Since the bundle comes with the package: symfony/orm-pack you first have to unpack the to be able to manually change the version inside your composer.json: composer unpack symfony/orm-pack
After unpacking you will see the following line inside your composer.json: "doctrine/doctrine-migrations-bundle": "*", which I changed to "doctrine/doctrine-migrations-bundle": "^2.1". Then i ran composer update again. You may specify only the migrations bundle if thats all you want to update.
Hello so i could fixe my issue just by removing (?versionname=5.7) to the database_url and it worked just fine
How can I connect to Sqlite db?
I have done the below things
1) Created project.
2) Created database.sqlite inside the database folder (database\database.sqlite).
3) Changed 'default' => env ('DB_CONNECTION', 'mysql'), to 'default' => env ('DB_CONNECTION', 'sqlite'), in the database.php file.
4) Ran php artisan migrate.
But I am getting an error
[InvalidArgumentException]
Database (sqlite) does not exist.
Then I tried DB_DATABASE=database\database.sqlite as stated in the documentation but I get the following error.
[PDOException]
Could not find driver
I have set the .env file as below
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database/database.sqlite
DB_USERNAME=homestead
DB_PASSWORD=secret
Sqlite is available for the CLI, but not for PHP. You need to install it.
Run the below command in terminal
$ sudo apt-get install php5-sqlite
If you're running php7, you need to install php7.0-sqlite.
After that restart your apache or whatever web server you have.
I just installed symfony in my wamp according to the tutorials in below websites
http://uniapple.net/blog/?p=298
http://uniapple.net/blog/?p=298
all had finished without any error. But after finished all, when give the command symfony in cmd, it shows the below error.
Could not open input file: ⌠E:\wamp\bin\php\php5.5.12\symfony÷
and i couldn't figure it out. Please help..
Thank u in advance
If you are trying to use the Symfony console, you need to be in CMD and go to your project root:
cd C:\Sites\project
Before you try any commands, please make sure PHP is in your PATH variable.
Then to do commands in symfony you need to do:
php app/console command:action
//for example, do a cache warmup - choose your environment
php app/console cache:warmup --env=[dev|prod]
Is this what you mean when you want to use Symfony in cmd?
I've been trying symfony 1.2.12, using xampp 3.1.0 over windows XP (the jobeet tutorial). When I try to run php symfony propel:build-schema I've got the following error (over and over):
Propel Running "reverse" phing task
[taskdef] Error importing propel/phing/PropelDataModelTemplateTask.php
[phing] Error reading project file [Wrapped: Error importing propel/phing/PropelDataModelTemplateTask.php]
Some problems ocurred when executing the task: If the exception is not clear enough read the output.
(I've checked the phing version and it's 2.5.0, the latest available.)
I've searched for the PropelDataModelTemplateTask.php and is not in the project (the entire path doesn't exists!). I've created another symfony project and the file isn't there either. It looks like it's not included whit the symfony-1.2.12.tgz.
Is there something wrong within this version or should I install or update any extra component?
Thanks in advance!
Im working with Symfony2. Im trying to execute the following command:
php app/console doctrine:database:create
The problem is that I get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/no-debug-non-zts-20090626/apc.so' - dlopen(/opt/local/lib/php/extensions/no-debug-non-zts-20090626/apc.so, 9): image not found in Unknown on line 0
Could not create database for connection named <comment>symfony</comment>
could not find driver
APC is already installed, since the Symfony/web/config.php was OK, what I realised is that the version of php from CLI is different from the one Apache is running.
The one Apache is running has APC installed, so I would like CLI to run that same php, How can I do that?
in my case deleting the version that macports installed was enough to have CLI and Apache run the same PHP.
And that's:
sudo port uninstall php5