XF 2.1 xf-addon:build-release causes mysqli error

I've tried to build my addon release via cmd.php xf-addon:build-release, but i got this error in console:

PHP Fatal error: Uncaught XF\Db\Exception: No such file or directory in /dev.xenforo2/src/XF/Db/Mysqli/Adapter.php:160

Seems like something wrong with this line, but i've checked $config variable and it's fine, values are correct.

I'm running under
1) OS - Mac OS 13.6
2) Latest MAMP Pro
3) Mysql 5.7.23
4) PHP 7.1.20
5) XF 2.1.3
 
Firstly, I'd check that php -v on the command line outputs the same as the details you can see on the Admin CP index page "Server environment report".

Sometimes the PHP binary linked to php can be different to the one actually in use by Apache.

Secondly, this can sometimes be caused by using MySQL sockets rather than TCP/IP. If your config is:
PHP:
$config['db']['host'] = 'localhost';

Consider changing it to:

PHP:
$config['db']['host'] = '127.0.0.1';
 
I also faced the exact same issue while creating an addon, but I fixed it by matching the PHP version for the Web and CLI.

Don't forget to restart the terminal.
 
Back
Top Bottom