symfony 学说:insert-sql - “无法找到名为 mysql 的驱动程序”错误

发布于 2024-08-31 05:45:54 字数 443 浏览 3 评论 0原文

嘿,我是 symfony 的新手。 我正在 symfony-project.com 上关注这个 joobet 教程,我在那里第 3 天 http://www.symfony-project.org/jobeet/1_4/Doctrine/en/03 每当我输入 php symfonydoctrine:insert-sql 时,我都会得到 以下错误:

创建表的原则 无法找到名为 mysql 的驱动程序,

我正在 WAMP 上使用它。我的 symfony 位于 C:\wamp\bin\php\php5.3.0\PEAR\symfony 我的项目位于 C:\wamp\www\jobeet 请帮助我解决这个问题,因为我被困在这里,无法进一步前进。

hey, I am a newbie in symfony.
I am following this joobet tutorial on symfony-project.com, I am on there day 3 http://www.symfony-project.org/jobeet/1_4/Doctrine/en/03
Whenever I type php symfony doctrine:insert-sql, I get the
following error:

doctrine creating tables
Couldn't locate driver named mysql

I am using it on WAMP. I have symfony present at C:\wamp\bin\php\php5.3.0\PEAR\symfony
and my project is present in C:\wamp\www\jobeet
Kindly help me resolve this, as I am stuck here, and cant move further.

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

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

发布评论

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

评论(1

慵挽 2024-09-07 05:45:54

您需要启用PDO的mysql驱动程序。您将需要编辑 1 或 2 个 php.ini 文件,具体取决于您的系统。

首先,您需要编辑 apache 使用的 php.ini,您可以通过创建一个执行 phpinfo() 的新文件来找到它,通过浏览器检查它并搜索“php.ini”。

第二个是命令行使用的,打开终端(开始 - 运行 - cmd.exe),然后运行 ​​php -i > 。 phpinfo.txt,然后打开文本文件并搜索“php.ini”。

您正在寻找它的扩展部分,请取消注释 pdo_mysql 行(删除开头的 ; )。完成所有这些后,重新启动 apache 就可以了。

You need to enable the mysql driver of PDO. You will need to edit 1 or 2 php.ini files, depending on your system.

First you need to edit the php.ini apache uses, you can find it by creating a new file that does a phpinfo(), checking it via a browser and searching for "php.ini".

The second one is the one the command line uses, open a terminal (start - run - cmd.exe), and run php -i > phpinfo.txt, then open the text file and search for "php.ini".

You are looking for the extensions part of it, uncomment the line with pdo_mysql (remove the ; at the beginning). After all these, restart apache and you're good to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文