Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to run Symfony on my new Macbook Pro but I have no luck getting it to work with the command line scripts.

With every symfony task related to a database connection the following message appears:

"Couldn't locate driver named mysql"

So I tried testing mysql from the interactive php commandline script. No luck there to.

php > mysql_connect();
PHP Fatal error:  Call to undefined function mysql_connect() in php shell code on line 1

But running the mysql_connect function in the browser does work.

I already found out that php uses a different php.ini for cli scripts but I've had no luck editing that to work with the mysql commands.

Does anybody know whats wrong here?

Thanks in advance!

Btw, I don't use MAMP or anything like that, just the standard php installation from osx snow leopard 5.3+ and installed mysql.

share|improve this question
    
Did you ever figure this out? I've been bashing my head against this all day. –  abeger Oct 27 '12 at 23:31

1 Answer 1

Have you tried using the --php-ini flag to explicitly specify the INI file to load? I.E.

php --php-ini /etc/php.ini -f myfile.php
share|improve this answer
    
Thanks, but that isn't the solution. I found the cli php.ini and copied the one used for non cli to the cli php.ini but that doesn't make any difference –  frietkot Jul 21 '11 at 16:57
    
@frietkot Have you tried running phpinfo() from within the CLI? That will give you the 'Loaded php.ini' file (If there is one) –  sam Jul 21 '11 at 19:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.