I am running a php file using shell script like ./first.sh
In first.sh I am running a php file using following command
COMMAND="/usr/bin/php /home/mydirectory/public_html/members/cron/cron.php"
Under cron file I have this code
mail('myemail@gmail.com','fff','aaa');
include_once '/home/mydirectory/public_html/members/wp-config.php';
mail('myemail@gmail.com','fff1','aaa1');
when I am executing .sh file I am only getting first email and not getting second email. Below second email I have written some more coding to fetch wordpress posts but not working. And if I am hitting the cron.php in browser using domain url, it is working absolutely fine.
I have tested so many other stackoverflow answers but nothing is working for me.
Please help me.