CRON Configuration

@infowhatnowebsite-co

Rest assured we rely on the cron configuration ourselves in our production environment with no issues.

Despite what your host is saying, if the red triangle appears it means the crons are not triggering the flag we use to test.

If this command is not returning any message at all

/opt/cpanel/ea-php81/root/usr/bin/php /home/alltbilling/public_html/artisan schedule:run

It would indicate there is something deeper in the webserver that is blocking it from running at all.

I have pushed back and will let you know what they say.

It’s frustrating because I have to deal with two lots of admins, them and yourselves.

We’ll get there…

They are saying it’s a scheduling issue and that the cron is set correctly but I don’t know.

I’m getting a bit tired of this now.

They say it’s your software, you say it’s the server.

I just need a solution guys.

Guys… Please, I need a solution.

This is the second installation I have running and as you’re insisting I use version 6 it needs to work.

To debug you can try running the cron from the command, you need to remove /dev/null 2>&1 from the end to see the output.

I’ll try that now.

I currently have the following cron jobs setup and still get the error triangle:

  • * 	* 	* 	* 	/opt/cpanel/ea-php81/root/usr/bin/php /home/alltbilling/public_html/artisan schedule:run > /dev/null 2>&1 	
    
  • * 	* 	* 	* 	cd /home/alltbilling/public_html/ && /ea-php81/root/usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1
    

[quote=ā€œhillel, post:45, topic:11632ā€]
you need to remove
[/quote]The first command produces nothing and the second an error as it can’t find the file.

@david any thoughts?

I think I have it working…

I ran this:
/home/alltbilling/public_html/ && /usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1
And got this:

Now I do not get the warning arrow but a yellow bell icon suggesting I download the desktop app.

Great to hear, thanks for the update!

Maybe if you get time you could use this fo rthe cPanel install instructions as there’s a few things here that aren’t there?

Apologies for the delay in getting back to you but this is still not working and it’s very frustrating.

I opened up the invoices menu and opened an invoice. I clicked on Send Mail and it asked to save the invoice PDF.

Then when I clicked the ā€œsendā€ button the system said successfully queued to send but nothing was sent.

No CRON jobs appear to be running either.

I would suggest setting in your .env

QUEUE_CONNECTION=sync

then update the cache, this will attempt to send your emails in the same request rather than queueing them.

The problem is the CRON also not running though.

on cPanel I use: * * * * * /usr/bin/ea-php81 -d register_argc_argv=On /home/accessweb/public_html/posv2/artisan schedule:run >> /dev/null 2>&1

Edit ā€œea-php81ā€ to the PHP version your domain/subdomain uses in cPanel (see MultiPHP Manager) for what version, if it is 8.0 it should be ā€œea-php80ā€. Also edit ā€œ/home/accessweb/public_html/posv2/ā€ to be the directory where your v5 installation is located (you will find an artisan folder in it then the path is correct). See screenshot for the manual cPanel itselfs provides when creating crons.

TIP: To test, temporarly remove the ā€œ>> /dev/null 2>&1ā€ at the end (you will receive an email every minute) when you get those emails, the triangle will be gone and you can add ā€œ>> /dev/null 2>&1ā€ again.

Thanks very much for your time on this. It’s been driving me nuts.

I tried browsing for the artisan folder with no luck so I then went into cPanel and browsed there. Again no luck and even though I have cPanel’s file manager set to show hidden files & folders I simply couldn’t find the artisan folder.

So I did a search using terminal and hey presto it was there right in the /public_html folder.

Here’s the code I ended up using:

          • /usr/bin/ea-php81 -d register_argc_argv=On /home/alltbilling/public_html/artisan schedule:run

No emails coming through though.

The account is definitely running PHP 8.1

In your cPanel for the user account (NOT the WHM interface if you have access to that on the server) search for ā€œCron Jobsā€ and click it. Set the email address there where emails should go about the cron’s. It’s on that page. See screenshot. You should be receiving mails then every minute, anyhow the triangle should be gone by now too?

Kind regards,

ONSEA Jellis

I’ve analysed the thread a bit further, and viewed your provided screenshots, you are logged in as root on the server when doing commands on the alltbilling account (root is almost always a bad idea), in this case the file permissions might wrong and this could be the issue why the cPanel and the Invoice Ninja app is doing it’s job/not showing up content in the file manager etc. When using WHM/cPanel at least as root perform: ā€œsu - alltbillingā€ (You might need to enable shell access inside WHM for the account). I would suggest for you:

** ALWAYS MAKE BACKUPS FIRST **

  • Remove all ninja content from the public_html directory (if it will only serve as the ninja app, as root empty the directory before proceeding)

  • Login to the cPanel USING THE ACCOUNT login/password (not as root, or via WHM), go to file manager and extract the invoiceninja.zip from inside the cPanel file manager. Rename the example.env to .env.

  • Remove the SQL user and database and recreate them using the MySQL Database Wizard inside cPanel account (grant all privlidges to the user for the database).

  • Try to setup the app/setup cron again.

All should be fine!

I spoke with the server admins and it seems that shell access was required for the server but neither cron is producing an email.

This is what I have:

/opt/cpanel/ea-php81/root/usr/bin/php /home/alltbilling/public_html/artisan schedule:run

/usr/bin/ea-php81 -d register_argc_argv=On /home/alltbilling/public_html/artisan schedule:run

I currently have 2 tasks set:

/opt/cpanel/ea-php81/root/usr/bin/php /home/alltbilling/public_html/artisan schedule:run
/usr/bin/ea-php81 -d register_argc_argv=On /home/alltbilling/public_html/artisan schedule:run

And I noticed this morning I was receiving the following mails:

Cron alltbilling@server /usr/bin/ea-php81 -d register_argc_argv=On /home/alltbilling/public_html/artisan schedule:run

Status: 500 Internal Server Error
Content-type: text/html; charset=UTF-8