Run Cron Jobs When Your Hosting Doesn't Support Them

Stuck on free or budget hosting that blocks cron jobs? InfinityFree, 000webhost, Hostinger free tier, and most shared hosting providers either don't support cron or severely limit it. CronPop runs your scheduled tasks from the cloud, connecting to your database and APIs exactly when you need them.

šŸ”“ No Hosting Limits - Works with any provider
šŸ”— Connect Anywhere - MySQL, APIs, webhooks
šŸ’° Free to Start - 100 free credits
Start Running Cron Jobs Free

100 free executions • No credit card required • Works with any hosting

The Free Hosting Problem

Budget and free hosting providers restrict what you can do. Sound familiar?

🚫

No Cron Access

InfinityFree, 000webhost, and free tiers simply don't offer cron jobs

ā±ļø

Severe Limits

Shared hosting often limits you to 1 cron per hour or day

šŸ¤–

Bot Protection Blocks

External cron services get blocked by JavaScript challenges

šŸ’ø

Upgrade Pressure

"Upgrade to premium for cron access" - but you just need one simple task

The CronPop Solution

CronPop runs your code in the cloud, separate from your hosting. Instead of relying on your hosting provider's cron, you write PHP scripts that connect to your database or APIs directly. Your hosting never knows the difference.

āœ… Connect to your MySQL database from the cloud
āœ… Send emails via API (Mailjet, SendGrid, Postmark)
āœ… Process data and update your database on schedule
āœ… Works even when your site has bot protection
āœ… No changes needed to your existing website
How it works: Your PHP script runs on CronPop's servers and connects to your database using the external hostname your hosting provider gives you. It's like having a VPS just for cron jobs, without the complexity.

Common Use Cases

What can you automate when your hosting won't let you?

šŸ“§ Send Scheduled Emails

Query your database for pending emails and send them via Mailjet or SendGrid API

šŸ—‘ļø Database Cleanup

Delete old sessions, expired tokens, or temporary data automatically

šŸ“Š Generate Reports

Pull data from your database and send daily/weekly summaries

šŸ”„ Sync Data

Keep your database in sync with external APIs or services

Step-by-Step: Send Emails from Your Database

The most common request: query a MySQL database and send emails. Here's exactly how to do it.

Start Free Setup →

Get 100 free executions to test this

Step 1: Get Your Database Connection Details

Find these in your hosting control panel (cPanel, hPanel, or custom dashboard):

Look for "External MySQL hostname" or "Remote MySQL host" - NOT localhost
Your database name, usually prefixed with your account ID
Your database username
Your database password
InfinityFree users: Go to MySQL Databases in your control panel. The external hostname is shown at the bottom of the page. Make sure "Remote MySQL" is enabled.

Step 2: Get an Email API Key

Free hosting usually blocks the PHP mail() function. Use an email API instead - they're more reliable anyway.

Recommended: Mailjet (Free tier: 6,000 emails/month)

  1. Sign up at mailjet.com
  2. Go to Account Settings → API Keys
  3. Copy your API Key and Secret Key

Alternative: SendGrid (Free tier: 100 emails/day)

  1. Sign up at sendgrid.com
  2. Go to Settings → API Keys → Create API Key
  3. Copy your API key

Step 3: Create Your CronPop Job

Here's a complete script that queries your database and sends emails via Mailjet:

<?php
// Database connection (use YOUR hosting's external MySQL hostname)
$host = 'sql123.infinityfree.com';  // NOT localhost!
$db   = 'if0_12345678_myapp';
$user = 'if0_12345678';
$pass = 'your_db_password';

// Mailjet API credentials
$MJ_API_KEY = 'your_mailjet_api_key';
$MJ_SECRET  = 'your_mailjet_secret';

try {
    $pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8mb4", $user, $pass);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Connected to database\n";

    // Query for pending emails (adjust to your table structure)
    $stmt = $pdo->query("
        SELECT id, recipient_email, subject, body
        FROM email_queue
        WHERE sent_at IS NULL
        LIMIT 10
    ");

    $emails = $stmt->fetchAll(PDO::FETCH_ASSOC);
    echo "Found " . count($emails) . " pending emails\n";

    foreach ($emails as $email) {
        // Send via Mailjet API
        $data = [
            'Messages' => [[
                'From' => ['Email' => 'noreply@yourdomain.com', 'Name' => 'Your App'],
                'To' => [['Email' => $email['recipient_email']]],
                'Subject' => $email['subject'],
                'HTMLPart' => $email['body']
            ]]
        ];

        $ch = curl_init('https://api.mailjet.com/v3.1/send');
        curl_setopt($ch, CURLOPT_USERPWD, "$MJ_API_KEY:$MJ_SECRET");
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $response = curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        if ($httpCode === 200) {
            // Mark as sent
            $update = $pdo->prepare("UPDATE email_queue SET sent_at = NOW() WHERE id = ?");
            $update->execute([$email['id']]);
            echo "Sent email to {$email['recipient_email']}\n";
        } else {
            echo "Failed to send to {$email['recipient_email']}: $response\n";
        }
    }

    echo "Done!\n";

} catch (PDOException $e) {
    echo "Database error: " . $e->getMessage() . "\n";
}
Check for new emails frequently

More Examples

šŸ—‘ļø Clean Up Old Database Records

<?php
// Connect to your database
$pdo = new PDO(
    "mysql:host=sql123.infinityfree.com;dbname=if0_12345678_myapp",
    "if0_12345678",
    "your_password"
);

// Delete sessions older than 24 hours
$stmt = $pdo->prepare("DELETE FROM sessions WHERE created_at < DATE_SUB(NOW(), INTERVAL 24 HOUR)");
$stmt->execute();
echo "Deleted " . $stmt->rowCount() . " old sessions\n";

// Delete unverified accounts older than 7 days
$stmt = $pdo->prepare("DELETE FROM users WHERE verified = 0 AND created_at < DATE_SUB(NOW(), INTERVAL 7 DAY)");
$stmt->execute();
echo "Deleted " . $stmt->rowCount() . " unverified accounts\n";

echo "Cleanup complete!\n";

šŸ“Š Daily Stats Report to Slack

<?php
$pdo = new PDO(
    "mysql:host=sql123.infinityfree.com;dbname=if0_12345678_myapp",
    "if0_12345678",
    "your_password"
);

// Get yesterday's stats
$stats = $pdo->query("
    SELECT
        COUNT(*) as new_users,
        (SELECT COUNT(*) FROM orders WHERE DATE(created_at) = CURDATE() - INTERVAL 1 DAY) as orders
    FROM users
    WHERE DATE(created_at) = CURDATE() - INTERVAL 1 DAY
")->fetch(PDO::FETCH_ASSOC);

// Send to Slack
$message = "šŸ“Š Daily Stats:\n• New users: {$stats['new_users']}\n• Orders: {$stats['orders']}";

$ch = curl_init('https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['text' => $message]));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);

echo "Stats sent to Slack!\n";

Hosting-Specific Tips

InfinityFree / iFastNet

  • External MySQL hostname: sqlXXX.infinityfree.com (find in control panel)
  • Remote MySQL must be enabled in your control panel
  • Bot protection will block simple HTTP cron services - PHP scripts bypass this

000webhost

  • MySQL hostname for external connections varies - check your dashboard
  • Free tier has sleep hours - your DB may be unreachable at night

Hostinger Free / Budget Plans

  • External MySQL access may need to be enabled in hPanel
  • You may need to whitelist CronPop's IP range (contact support if needed)

PHP Environment

PHP Version: 8.4 (latest stable)
Available: PDO, MySQL, cURL, JSON, OpenSSL, mbstring
Memory: 128MB per execution
Timeout: 30 seconds maximum

Finally, Cron Jobs That Work

Stop fighting with your hosting provider's limitations. CronPop lets you run scheduled tasks exactly when you need them, connecting to any database or API.

šŸ”“

Bypass Restrictions

Works even when your hosting blocks cron

šŸ”—

Connect Anywhere

MySQL, PostgreSQL, APIs, webhooks

šŸ“§

Reliable Email

Send via API, not blocked mail()

šŸ’°

Stay on Free Hosting

No need to upgrade just for cron

Ready to Run Cron Jobs?

Start Free →

100 free credits • No credit card • Works in 5 minutes

Questions?

Will this work with my hosting provider?

If your hosting allows external MySQL connections (most do), yes. CronPop connects directly to your database - your hosting provider isn't involved in running the cron.

How much does it cost?

Free to start with 100 credits. Then 1 credit per execution. Running every 5 minutes costs ~8640 credits/month (~9€).

Is my database password secure?

Your scripts are private and encrypted. We recommend creating a dedicated database user with only the permissions your script needs.

What if my script fails?

Enable email notifications and we'll alert you immediately when something goes wrong. Full logs are available in your dashboard.