• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No such file or directory when running seeder from CLI

#1
I'm trying to load some test data with a seeder file and it gives the error "No such file or directory". It looks like it's when it tries to connect to  MySQL but I can't find what file it's looking for. The application works fine in the browser, so the database config is good. I looked at the code in MySQLi/Connection.php and I can't find where this exception comes from.

Any idea what file it's looking for and can't find?


Code:
$ php spark db:seed BlogSeeder


CodeIgniter CLI Tool - Version 4.0.0-rc.3 - Server-Time: 2020-01-02 12:23:01pm


No such file or directory
/Applications/MAMP/htdocs/xxxxxx/system/Database/MySQLi/Connection.php - 225
Test your translation files with Translation Tester
Reply

#2
That's the try...catch block for making the actual connection with MySQLi. Is it possible you don't have MySQLi extensions available? Or the database itself? Also try removing and re-installing the framework portion (vendor, or system) in case of permissions issues.
Reply

#3
All those things are already working when I test the app in the browser. I can create and edit new blog post. So I can confirm MySQLi is available, the database is up and running, the credentials are good. I just can't understand why from the command line it give this error. I will search the string 'No such file or directory' in all CI files to try and find where it's coming from.
Test your translation files with Translation Tester
Reply

#4
Your CLI version of PHP doesn’t necessarily have the same extensions installed. Run php -m and make sure MySQL extension is enabled.
Reply

#5
(01-11-2020, 06:05 AM)MGatner Wrote: Your CLI version of PHP doesn’t necessarily have the same extensions installed. Run php -m and make sure MySQL extension is enabled.

Ha! I didn't think about that.
The CLI version was not the same version of PHP. Now it work when I call the same version. 
Thank you!
Code:
/Applications/MAMP/bin/php/php7.3.8/bin/php spark db:seed BlogSeeder
Test your translation files with Translation Tester
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.