Comments (16)
Hi @garsamba do you get any error back?
For starter did you check the path to your autoloader?
Did you also check the path to your test.php
?
Can you also check the php binary? Are you on linux?
Did you setup correctly your crontab?
What happens if you run your scheduler file directly
php scheduler.php
(assuming your scheduler file is called scheduler.php
I would start by debugging the above, you can add a file_exists
function at the bottom, like
var_dump(file_exists(__DIR__.'/vendor/autoload.php'));
var_dump(file_exists('test.php'));
and then manually execute the scheduler, if you get false
it means your paths are wrong.
I would also run a which php
in your command line to see the exact PHP bin path.
And then if everything is ok and you're able to manually execute the scheduler, I would check that the crontab is set up correctly with crontab -l
Hope this helps
from php-cron-scheduler.
var_dump(file_exists(__DIR__.'/vendor/autoload.php')); var_dump(file_exists(__DIR__.'/test.php'));
Results: bool(true) bool(true)
I'm renewing the page manually but I can't get any results.
from php-cron-scheduler.
are you running your scheduler with cron?
from php-cron-scheduler.
are you running your scheduler with cron?
i tried both, page refresh and https://cron-job.org/ crontab, but I didn't get the result
from php-cron-scheduler.
did you try your local crontab file? Don't know if scheduler have some limitation on running via web.
from php-cron-scheduler.
did you try your local crontab file? Don't know if scheduler have some limitation on running via web.
yes test.php file is processing when I refresh it manually
from php-cron-scheduler.
did you try your local crontab file? Don't know if scheduler have some limitation on running via web.
Would you like to check with teamviewer?
from php-cron-scheduler.
Your scheduler (calling test.php each minute) run using your cron file? Just following the project's front page instructions? Try this (not refreshing a page) to see if it works.
from php-cron-scheduler.
Programlayıcınız (her dakika test.php'yi çağırarak) cron dosyanızı kullanıyor mu? Sadece projenin ön sayfa talimatlarını takip ediyor musun? Çalışıp çalışmadığını görmek için bunu deneyin (sayfayı yenilemeyin).
yes using -> https://prnt.sc/mpu3hs
from php-cron-scheduler.
I see. That is not using the crontab file, this is using an external service. You could as well call test.php straight from cron-job.org I don't know if scheduler is designed to work with this. Maybe @peppeocchi quem shed some light on this.
from php-cron-scheduler.
Your scheduler (calling test.php each minute) run using your cron file? Just following the project's front page instructions? Try this (not refreshing a page) to see if it works.
Why do we need to do a cron, page refresh?
from php-cron-scheduler.
Hi @garsamba do you get any error back?
For starter did you check the path to your autoloader?
Did you also check the path to yourtest.php
?
Can you also check the php binary? Are you on linux?
Did you setup correctly your crontab?
What happens if you run your scheduler file directly
php scheduler.php
(assuming your scheduler file is called scheduler.phpI would start by debugging the above, you can add a
file_exists
function at the bottom, likevar_dump(file_exists(__DIR__.'/vendor/autoload.php')); var_dump(file_exists('test.php'));
and then manually execute the scheduler, if you get
false
it means your paths are wrong.
I would also run awhich php
in your command line to see the exact PHP bin path.
And then if everything is ok and you're able to manually execute the scheduler, I would check that the crontab is set up correctly withcrontab -l
Hope this helps
i tried these codes on another server which is installed php version 5.4.45. Codes are working great there. Do you think this script doesnt work on my server because my php version is 7.0.33 ?
from php-cron-scheduler.
@garsamba I don't think that's the issue, the code is tested against php 7.0, 7.1 and 7.2
I believe you have different configurations on the two servers? Can you schedule to run a simple Closure? And then run php scheduler.php
Did you check your system log files?
I would also compare the php .ini files between the two servers.
from php-cron-scheduler.
@garsamba I don't think that's the issue, the code is tested against php 7.0, 7.1 and 7.2
I believe you have different configurations on the two servers? Can you schedule to run a simple Closure? And then run
php scheduler.php
Did you check your system log files?I would also compare the php .ini files between the two servers.
i compared both php.ini and there is no huge difference. i fixed different functions and its still doesnt work. also i dont have any log in server log files about it.
My cpanel licence key expired this month do you think it can be because of it ?
from php-cron-scheduler.
in your cron try
* * * * * /usr/bin/php -f path/scheduler.php 1>> /dev/null 2>&1
then in scheduler.php at the top add
chdir(__DIR__)
post back results
from php-cron-scheduler.
I comment on my experience:
Calling scheduler.php via web browser doesn't work, you have to run scheduler.php script via command line for it to work properly. For exemple:
linux -> /usr/bin/php scheduler.php
xampp -> D:/xampp/php/php.exe scheduler.php
Also if you use xampp you have to refine the consistent PHP_BINARY with your php binary at the beginning of your scheduler.php script. For example:
define(PHP_BINARY, "D:/xampp/php/php.exe");
from php-cron-scheduler.
Related Issues (20)
- how to get the number of running tasks?
- daily() and php() not working
- How does the lock file removed HOT 2
- Intelephense suggestion issue
- Fire script from a different root HOT 4
- Minute Error HOT 1
- Task start and end time
- cannot output log file HOT 1
- no way to set timezone for each job
- This library does not work for windows HOT 3
- work() cpu 100% HOT 2
- PHP 8.1 compatibility HOT 1
- Upgrade for php version 8.1 HOT 1
- Passing date will not execute the code in background
- Error when Scheduling an Object Method using ->call()
- Remove lock file of failed only-one callable job HOT 3
- Passing parameters via register_argc_argv alternative
- How to start a worker timer function upon startup?
- Windows scheduler
- [QUESTIONS] Where are jobs stored and how to use multiple servers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-cron-scheduler.