Last active
October 11, 2018 10:15
-
-
Save dermanov-ru/45aad04d3a5ab9ee73ec5fbf30e2e7fb to your computer and use it in GitHub Desktop.
Phinx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
команда для запуска на опенсервере | |
`php vendor/robmorgan/phinx/bin/phinx migrate` | |
Если запускать, как указано в мануале | |
`vendor/bin/phinx migrate` | |
то на опенсервере не тот пхп интерпретатор подключается из батника, а там не подключен PDO_MYSQL модуль. | |
--- | |
# добавить в .bashrc | |
alias php5='/d/openserver_5_2_4/modules/php/PHP-5.6-x64/php.exe ' | |
alias phinx='vendor/robmorgan/phinx/bin/phinx ' | |
# перейти в папку с композером, запускать в консоли | |
php5 phinx init|migrate|rollback | |
--- | |
There was a problem connecting to the database: SQLSTATE[HY000] [2002] | |
Если при запуске миграции проблема - проверить хост, порт, имя БД, логин и пароль. | |
Русские символы в консоли не выводятся, так чот нужно добавить запись в лог | |
D:/webprojects/PROJECT.loc/local/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php:120 | |
в блоке с исключением | |
``` | |
file_put_contents("d:\webprojects\PROJECT.loc\local\phinx.log", $dsn, FILE_APPEND); | |
file_put_contents("d:\webprojects\PROJECT.loc\local\phinx.log", print_r($options, 1), FILE_APPEND); | |
file_put_contents("d:\webprojects\PROJECT.loc\local\phinx.log", $exception->getMessage(), FILE_APPEND); | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment