Community

Setting Up a Cron Job for phpListings (Optional but Highly Recommended)

Showing 1 of 1
Setting Up a Cron Job for phpListings (Optional but Highly Recommended)
by Nicholas
25 days ago
N

Nicholas

Support Dept.

By default, phpListings triggers background tasks when visitors access the site. This works well on active websites, but on low-traffic or new installations, tasks may pause until a visitor triggers them again.

To ensure imports and scheduled operations continue smoothly, even when the site has no visitors, you can configure an optional cron job. This is not strictly required, but it is the recommended setup for optimal performance and reliability.

Without a cron job:

  • Imports may pause when no one is visiting the site

  • Scheduled tasks only run when triggered by page views

  • Background processing may be delayed during low-traffic periods

With a cron job in place:

  • Imports continue uninterrupted

  • Tasks run consistently every minute

  • Your installation behaves the same regardless of traffic levels

This guide explains how to set up this optional cron job via cPanel, your server’s crontab, or an external cron service.

Determine Your Cron URL

Your cron URL depends on how phpListings was installed.

Installed in the domain root

https://example.com/cron

Installed in a subdirectory

If installed in /directory:

https://example.com/directory/cron

Installed on a subdomain

https://directory.example.com/cron

Testing the URL

Open it in your browser. It should:

  • Display a small white dot PNG

  • Return an HTTP 200 OK response

If so, the URL is correct.

Creating a Cron Job in cPanel

  1. Log in to cPanel

  2. Open Cron Jobs

  3. Under Add New Cron Job, set:

    • Minute: *

    • Hour: *

    • Day / Month / Weekday: *

  4. In the command field, enter one of the following:

Option A (wget)

wget -q -O /dev/null https://example.com/cron

Option B (curl)

curl -s https://example.com/cron > /dev/null 2>&1

  1. Click Add New Cron Job

Creating a Cron Job on a Linux Server (SSH / Crontab)

  1. Connect via SSH

  2. Open the crontab editor:

crontab -e

  1. Add one of the following (runs every minute):

Using wget

* * * * * wget -q -O /dev/null https://example.com/cron

Using curl

* * * * * curl -s https://example.com/cron > /dev/null 2>&1

  1. Save and exit

Using an External Cron Service (Alternative Option)

If your hosting environment does not provide cron jobs, you can use:

  • cron-job.org (free)

Create a new task, set it to run every minute, and point it at your cron URL.

Showing 1 of 1
pixel image