Giter VIP home page Giter VIP logo

Comments (16)

peppeocchi avatar peppeocchi commented on May 20, 2024

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.

garsamba avatar garsamba commented on May 20, 2024

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.

rafaelmb avatar rafaelmb commented on May 20, 2024

are you running your scheduler with cron?

from php-cron-scheduler.

garsamba avatar garsamba commented on May 20, 2024

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.

rafaelmb avatar rafaelmb commented on May 20, 2024

did you try your local crontab file? Don't know if scheduler have some limitation on running via web.

from php-cron-scheduler.

garsamba avatar garsamba commented on May 20, 2024

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.

garsamba avatar garsamba commented on May 20, 2024

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.

rafaelmb avatar rafaelmb commented on May 20, 2024

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.

garsamba avatar garsamba commented on May 20, 2024

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.

rafaelmb avatar rafaelmb commented on May 20, 2024

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.

garsamba avatar garsamba commented on May 20, 2024

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.

garsamba avatar garsamba commented on May 20, 2024

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

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.

peppeocchi avatar peppeocchi commented on May 20, 2024

@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 avatar garsamba commented on May 20, 2024

@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.

adamz01h avatar adamz01h commented on May 20, 2024

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.

alex-monte avatar alex-monte commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.