Tuesday, September 15, 2009

Snow Leopard and Symfony

Last week I performed the upgrade to Snow Leopard. As a Mac newbie (recent convert from Ubuntu), I'm working through the upgrade in Snow Leopard to PHP 5.3. Due to our web hosting environment at this time we can't make the jump to PHP 5.3.

After the upgrade of Snow Leopard, on the command line I started to receive the message:

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function.

This morning I needed to work through generating a couple of tasks for our application. Trying to fire up a task generated the following error:

Unable to open PDO connection [wrapped: SQLSTATE[HY000] [2002] No such file or directory]

My solution was I needed to downgrade my local install to PHP 5.2. I'm all for running the latest and greatest PHP, but now is not the time. I work on a Macbook with MAMP installed. Understanding I am approaching this from an Ubuntu perspective and there might be a better way to accomplish the following. Remember attempt at your own risk....

  • The php executable is location at /usr/bin
  • I copied the php executable to make sure I could jump back to PHP 5.3, I ran "sudo mv php php5.3", renaming php to php5.3 in the directory.
  • Then I want to create a symlink to the MAMP php version "sudo ln -s /Applications/MAMP/bin/php5/bin/php php", creating a symlink php which points to the MAMP installed version.

Now running Symfony command line commands I'm using the php executable that ships with MAMP. I hope this helps.

7 comments:

Raul San Narciso said...

Yes! it worked for me! "thank you"

Jasper said...

Hey there,

I use XAMPP (comes with PHP 5.3). I got the same strange SQLSTATE error and fixed it by replacing php in /usr/bin with a symlink to XAMPP's PHP binary.

Thx for your help!

Unknown said...
This comment has been removed by the author.
RĂ©mi said...

Thank you! This solved my problem in no time!

rat4m3n said...

I still get the same error trying to run symfony doctrine:data-load
... ;/ any sugestions most welcome...

rat4m3n said...

mv: rename php to php5.3: No such file or directory ;///

Unknown said...

It worked for me! Thanks!