学说-cli 的问题

发布于 2024-08-17 19:33:43 字数 398 浏览 6 评论 0原文

我在从 YAML 文件构建数据库时遇到问题。

这是错误:

./scripts/doctrine-cli build-all-load
build-all-load - Generated models successfully from YAML schema
build-all-load - Couldn't locate driver named mysql
build-all-load - Created tables successfully
build-all-load - Data was successfully loaded

它构建了我的模型,但数据库中没有任何内容。我正在使用 MAMP,并且已检查并且 pdo_mysql 正在运行。我不完全确定为什么会发生这种情况。谢谢。

I am having issues getting my database to build from my YAML file.

Here is the error:

./scripts/doctrine-cli build-all-load
build-all-load - Generated models successfully from YAML schema
build-all-load - Couldn't locate driver named mysql
build-all-load - Created tables successfully
build-all-load - Data was successfully loaded

It builds my models, but nothing in the database. I am using MAMP and I have checked and pdo_mysql is running. I am not completely sure why this would happen. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千と千尋 2024-08-24 19:33:43

这看起来很像 pdo_mysql 没有启用;你说你检查了php.ini,但是你检查了从命令行运行PHP时使用的那个吗?

(这通常与 PHP 作为 Apache 模块运行时使用的不同)

您可以使用 php -m 获取已加载扩展的列表:

$ php -m
[PHP Modules]
bcmath
bz2
...
pcre
PDO
pdo_mysql
...

并且从 CLI 运行 PHP 时,php -i 应该指示使用哪个 .ini 文件:

$ php -i | grep 'ini'
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
additional .ini files parsed => /etc/php5/cli/conf.d/apc.ini,
/etc/php5/cli/conf.d/curl.ini,
...

This quite looks like pdo_mysql is not enabled ; you said you checked php.ini, but did you check the one that's used when PHP is run from the command line ?

(That's often not the same as the one used when PHP is run as an Apache module)

You can use php -m to get the list of loaded extensions :

$ php -m
[PHP Modules]
bcmath
bz2
...
pcre
PDO
pdo_mysql
...

And php -i should indicate which .ini file is used, when running PHP from the CLI :

$ php -i | grep 'ini'
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
additional .ini files parsed => /etc/php5/cli/conf.d/apc.ini,
/etc/php5/cli/conf.d/curl.ini,
...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文