1

I'm looking for some help to get rid of this error. As i'm running mac os x 10.5 I had to install A newer version of php to support pdo. I did this using Marc Liyanage's installer package.

The problem I'm having now is that using php from the command line is invoking the default apple php, not the pdo enabled version causing bake to fail.

How can I get the bake command to use the correct version of php on my system?

Many Thanks

Ralph

tereško
  • 58,060
  • 25
  • 98
  • 150
Ralphonz
  • 633
  • 1
  • 9
  • 22

2 Answers2

1

you could specify the path to the new php.. ?

/path/to/new/php/php script_to_run.php

There may be an alternatives package under osx as well where you can specify which versions of which apps you can use.

FreudianSlip
  • 2,870
  • 25
  • 24
  • do you mean like this? - /usr/local/php5/bin/php ./cake bake all -app /Users/Ralphonz/Sites/Testing/Cake_Blog/app Doesn't seem to work. I'm not great at using terminal! – Ralphonz Feb 09 '12 at 15:23
  • You could always be brave, find the original php move it (mv php php.original) and then link the new one to the right place. For example (assume old php is in /old/phpdir/php and new one is in /usr/local/php5/bin/php: ... cd /old/phpdir; mv php php.original;ln -s ./php /usr/local/php5/bin/php5 – FreudianSlip Feb 09 '12 at 15:29
  • I *always* get the src/dest wrong on the ln command, so if it bleats about it already existing, swap the parameters around. – FreudianSlip Feb 09 '12 at 15:30
  • whoops, well now it can't find php from the command line :( -bash: php: command not found – Ralphonz Feb 09 '12 at 15:58
  • That can't be right - the ln must need swapping around - in case of brown trousers though, just go back to /old/phpdir and mv php.original php – FreudianSlip Feb 09 '12 at 16:01
  • aaarrrggg! This make no sense! I reverted everything and tried again swapping the ln src/dest but I still get php:command not found? I can see the new php alias in the right folder in finder and everything... – Ralphonz Feb 09 '12 at 16:24
  • It seems as though the alias I created using the ln command was broken so I made an alias of the new php on my desktop and moved it: mv /usr/bin now i get -bash: /usr/bin/php: Permission denied ??? – Ralphonz Feb 09 '12 at 16:33
0

I was getting the following error while trying to bake v2.3.1

Warning Error: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in [/Library/WebServer/third-party/frameworks/cake_2.3.1/lib/Cake/Model/Datasource/Database/Mysql.php, line 158]

Error: Database connection "Mysql" is missing, or could not be created.

Fixed the issue by modifying pdo_mysql.default_socket in php.ini to point to right socket file path.

Code Lღver
  • 15,573
  • 16
  • 56
  • 75
Emad
  • 91
  • 5