PHP Symfony 构建所有 Propel 失败 - MySQL

发布于 2024-12-03 01:55:26 字数 1471 浏览 1 评论 0原文

我刚刚建立了一个全新的 Symfony 1.4 项目并设计了架构,但不幸的是我无法构建架构。

我在使用 symfony 命令 php symfony propel:build --all --no-confirmation 时遇到了一些问题。

不幸的是,它留下了一个相当神秘的错误消息 php symfony propel:build --all --no-confirmation 有谁知道导致此错误的原因以及如何纠正它?谷歌找到了一些我无法理解的波兰网站(即使有翻译)!

非常感谢!

完整错误:

>> schema    putting /Applications/XAMPP/xamppfiles/htdocs/swingers/config/generated-schema.xml
>> propel    Running "insert-sql" phing task
Execution of target "insert-sql" failed for the following reason: /Applications/XAMPP/xamppfiles/htdocs/swingers/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:272:1:  [wrapped: SQLSTATE[HY000] [2002] No such file or directory]
    [phing] /Applications/XAMPP/xamppfiles/htdocs/swingers/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:272:1:  [wrapped: SQLSTATE[HY000] [2002] No such file or directory]

  Some problems occurred when executing the task:                                       

  build-propel.xml:272:1:  [wrapped: SQLSTATE[HY000] [2002] No such file or directory]  

  If the exception message is not clear enough, read the output of the task for         
  more information                                                                      

>> file-     /Applications/XAMPP/xamppfiles/htdocs/swingers/config/generated-schema.xml
PezCuckowMBP:swingers pezcuckow$ 

I have just set up a completely new Symfony 1.4 project and designed the schema but unfortunately I can't build the schema.

I having some trouble with the symfony command php symfony propel:build --all --no-confirmation.

Unfortunately it leaves a rather cryptic error message php symfony propel:build --all --no-confirmation does anyone know what is causing this error and how to correct it? Google turns up some polish websites that (even with translate) I cannot understand!

Many thanks!

Full Error:

>> schema    putting /Applications/XAMPP/xamppfiles/htdocs/swingers/config/generated-schema.xml
>> propel    Running "insert-sql" phing task
Execution of target "insert-sql" failed for the following reason: /Applications/XAMPP/xamppfiles/htdocs/swingers/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:272:1:  [wrapped: SQLSTATE[HY000] [2002] No such file or directory]
    [phing] /Applications/XAMPP/xamppfiles/htdocs/swingers/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:272:1:  [wrapped: SQLSTATE[HY000] [2002] No such file or directory]

  Some problems occurred when executing the task:                                       

  build-propel.xml:272:1:  [wrapped: SQLSTATE[HY000] [2002] No such file or directory]  

  If the exception message is not clear enough, read the output of the task for         
  more information                                                                      

>> file-     /Applications/XAMPP/xamppfiles/htdocs/swingers/config/generated-schema.xml
PezCuckowMBP:swingers pezcuckow$ 

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

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

发布评论

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

评论(1

乙白 2024-12-10 01:55:26

该死的,经过更多思考,我已经回答了我自己的问题:

我在 OSX 10.6 上使用 Xampp。问题是它执行了错误的 php 二进制文件。

$ php symfony propel:insert-sql

会调用 /usr/bin/ 中的 php 二进制文件,而不是

/Applications/xampp/xamppfiles/bin/ 中的二进制文件,这是我首先想要的

命令 $ php 运行了错误的 PHP(OSX 的默认 PHP)。

为了解决这个问题,我:

进入 /usr/bin 并重命名

php to php_old
phpize to phpize_old 
php-config to php-config_old

然后,创建符号链接:

sudo ln -s /Applications/XAMPP/xamppfiles/bin/php-config php-config
sudo ln -s /Applications/XAMPP/xamppfiles/bin/php php
sudo ln -s /Applications/XAMPP/xamppfiles/bin/phpize phpize

希望这对其他人有用!

Damn, I've answered my own question after some more thought:

I am using Xampp on OSX 10.6. The problem is it was executing the wrong php binary.

$ php symfony propel:insert-sql

would call the php binary in /usr/bin/ not the one in

/Applications/xampp/xamppfiles/bin/ which is what I wanted in the first place

The command $ php is running the wrong PHP (OSX's default PHP).

To resolve this problem I:

Went in /usr/bin and renamed

php to php_old
phpize to phpize_old 
php-config to php-config_old

Then, make symbolic link:

sudo ln -s /Applications/XAMPP/xamppfiles/bin/php-config php-config
sudo ln -s /Applications/XAMPP/xamppfiles/bin/php php
sudo ln -s /Applications/XAMPP/xamppfiles/bin/phpize phpize

Hope this is of use to someone else stuck!

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