2011-09-04 45 views
0

我刚刚建立了一个全新的Symfony 1.4项目并设计了模式,但不幸的是我无法构建模式。PHP Symfony Build All Propel Fails - MySQL

我在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$ 

回答

2

妈的,我已经回答了我的问题多一些思考后:

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

$ php symfony propel:insert-sql 

将调用PHP二进制中/usr/bin/不是一个在

/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 

希望这是利用别人卡住!