I am trying to create cron jobs with linux crontab. So i need to call custom-cron.php in the public folder.
I am calling wp-load.php to initiate WordPress but i am getting this error all time:
PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Users/johndoe/Sites/test/app/public/wp-includes/class-wpdb.php on line 1987
I created crontab with this command: "/Users/johndode/Library/Application Support/Local/lightning-services/php-8.3.0+1/bin/darwin-arm64/bin/php" /Users/johndode/Sites/test/app/public/cron.php
When I check cron.php it gets the php.ini file from a different place. It does not get the php.ini that the site uses.