I found the solution to the problem above but have another problem. First the solution. I was running on my development system, MAMP Pro on a Mac. Looking in the admin tools menu under Server/Version Info, I found under the mysqli topic an entry for mysqli.default_socket. It is essentially a path to mysql.sock. Copying that entry and pasting it into the line in the my_custom_cron.php file that defines DB_SOCKET fixed the problem.
Code:
// Some servers' PHP configuration doesn't know where to find the mysql socket correctly (evidenced by getting errors about mysqli and mysql.sock, esp when running cron or command-line scripts, such as this one)
// uncomment the following line ONLY if your server's configuration requires it and you don't already have this in your configure.php file
define('DB_SOCKET', '/tmp/mysql.sock');
Now the new problem. The function_exists(my_custom_function) is failing to find the called function. I have no clue why it can't find the function. It's located in admin/includes/functions/extra_functions/my_functions.php. I checked the function name in both places; it's the same. I followed the guidance given in the above-cited documentation and can see no difference between the model code for currency exchange rate and my code. The relevant code follows:
Code:
// main execution area
if (function_exists('my_cron_function'))
{
if (IS_CLI == 'VERBOSE' && $is_browser) echo '<br><pre>' . "\n";
if (IS_CLI == 'VERBOSE') echo 'Processing... ' . "\n";
my_cron_function();
if (IS_CLI == 'VERBOSE') echo 'Done.' . "\n\n";
exit(0); // returns 0 status code, which means successful
} else {
echo "Error: Function not found: my_cron_function.\nMake sure you have placed the my_custom_cron.php file in your (renamed) Admin folder.\n\n";
exit(1);
}
Any help or suggestions would be greatly appreciated.