We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Cant get the devtools working

Hello all,

I trying to learn phalcon and try to work with de the devtools. Only the devtools doesn't work.

On the webversion i get to following error: Builder can't locate the configuration file

And with de CLI i get: PHP Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in /Users/ralphjanssen/phalcon-devtools/scripts/Phalcon/Builder/Model.php on line 328

Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in /Users/ralphjanssen/phalcon-devtools/scripts/Phalcon/Builder/Model.php on line 328

Error: SQLSTATE[HY000] [2002] No such file or directory

Extra info: Working on a mac with MAMP PRO

I haven't find any solution yet.

Can someone help me? Thanks, greetings

Ralph



16.4k

Can you upload the code to github so we can take a look?

The issue is that the DevTools can't find your config.php file there, where it is supposed to be.

In Phalcon\Builder\Component line 60:

foreach (array('app/config/', 'config/') as $configPath)

As in you need to have your config.php or config.ini under project_root/config/ or project_root/app/config/.

Hope this helps

Hi,

Thanks for your response. Here is my repo.

https://github.com/ralphja16/webapp

I have a config file in my project.

edited Feb '15

My apologies, I misread the PHP warnings.

It seems that MAMP installs the MySQL socket file to another location. With a bit of googling, MAMP has the socket file at /Applications/MAMP/tmp/mysql/mysql.sock instead of the usual /tmp/mysql.sock. You will need to change the socket path

An example on how to pass the socket path can be found here: https://docs.phalcon.io/en/latest/api/Phalcon_Db_Adapter_Pdo.html

Update

Another option is to create a symbolic link and you won't need to change anything.

sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/