We are trying to setup php file into cron job in windows 8.1 system, to call GCM push notification and to get notification in our registerrd devices.
It works fine when we run cron using any browser like Chrome , Firefox then I get GCM push notification to my registered device but, If we try same configure using php.exe then we are not getting notification to our devices.
To schedule cron we are using Task Scheduler in that our trigger setting are like :- And in our Action tab We have set up bellow lines:-
Program / script :- D:\xampp\php\php.exe
Add arguments (optional) :- -f D:\xampp\htdocs\PushNotificationSql\tasknotification.php
Start in (optional):- D:\xampp\htdocs\PushNotificationSql
After that We run manually then We get response as per below image but can not get notification into registered device.
Any help will be appreciate!
After many hurdles we got the solution of our problem
We have face three problems to make working this.
1). We have change our ActionTab to this
Program / script :- D:\xampp\php\php.exe
Add arguments (optional) :- -c D:\xampp\php\php.ini -f D:\xampp\htdocs\PushNotificationSql\tasknotification.php
Start in (optional):- [Remain empty]
This will successfully call php script from cmd using php.exe
2). In our php script there is code which is called php function from javascript and we knows that script code does not run using cmd its only handle by browser so we have change it and then it works fine.
3). And we have another php file include into this cron php file [tasknotification.php] so we have to write pull path of that included file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With