Skip to content
This repository was archived by the owner on Oct 29, 2026. It is now read-only.
This repository was archived by the owner on Oct 29, 2026. It is now read-only.

Cronjob support? #578

Open
Open

Description

@nadar

Hi everyone

Does cronjobs work with the php runtime? I tested a few things, but it seems not to work. Can anyone confirm this or is there a workaround?

I use laravel 11 (the webproject itself works perfectly) with the following vercel.json

{
    "version": 2,
    "regions": [
        "fra1"
    ],
    "functions": {
        "api/index.php": {
            "runtime": "vercel-php@0.7.3"
        }
    },
    "routes": [
        {
            "src": "/build/(.*)",
            "dest": "/build/$1"
        },
        {
            "src": "/(.*\\.(?:css|js|png|jpg|jpeg|gif|svg|ico|ttf|woff|woff2|eot|otf|webp|avif|txt|webmanifest))$",
            "dest": "/public/$1"
        },
        {
            "src": "/(.*)",
            "dest": "/api/index.php"
        }
    ],
    "outputDirectory": "public",
    "crons": [
        {
            "path": "/api/cron",
            "schedule": "*/5 * * * *"
        }
    ]
}

i have registered a route in routes/web.php like Route::get('/cron', function () {...} and i tested with

"crons": [
        {
            "path": "/cron",
            "schedule": "*/5 * * * *"
        }
    ]

and

"crons": [
        {
            "path": "/api/cron",
            "schedule": "*/5 * * * *"
        }
    ]

but both seems not to work, i think its because of the none official runtime?

Activity

  1. f3l1x commented on Feb 13, 2025

    @f3l1x
    Collaborator

    Hi @nadar, I am not using cronjobs, I must take a look to this feature at first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions