4

I'm trying to run a cron in my OVH but it is not accepting the command :

php artisan schedule:run 1>> /dev/null 2>&1

Error occured :

enter image description here

it say :

The characters for the records are letters , numbers, and characters -_./ Moreover , it is forbidden to access parent folders
BenMorel
  • 34,448
  • 50
  • 182
  • 322
Pranab
  • 157
  • 11

2 Answers2

0

Use the example on the Laravel docs with the full path to your working directory:

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

https://laravel.com/docs/master/scheduling

markdwhite
  • 2,360
  • 19
  • 24
  • it is still now working. it is not allowing to add space in the field. As soon as I put a space it throws error. It is working in my server but in OVH its bad. – Pranab Mar 01 '16 at 06:48
  • 1
    @Pranab - seems like a problem with OVH's Control Panel then. You could try putting quotes round the command, but otherwise it could be an OVH support issue. – markdwhite Mar 01 '16 at 06:51
  • it is still the same. Putting quotes around the command is also not working. – Pranab Mar 01 '16 at 06:54
  • @Pranab - seems like a hosting issue so maybe this will help http://help.ovh.co.uk/HostingCron but I'm out. – markdwhite Mar 01 '16 at 06:59
  • its not working the hosting provider told me to use cron.php or something similar. How can I use a .php for cron in Laravel. – Pranab Mar 01 '16 at 11:08
  • @Pranab - that would be a different question, which you should raise with the SO community – markdwhite Mar 01 '16 at 13:45
0

Create a file cron.php with these contents

#!/usr/bin/env php
<?php
exec('php /path/to/artisan schedule:run', $output);
print_r($output);

Make sure to edit the /path/to part. Then enter cron.php in "command to be executed" field in "Add a scheduling" window.
ovh control panel add cron job


If you run into error, try checking permissions for cron.php and artisan. Permission can be fixed using these commands.

$ chmod 777 cron.php
$ chmod 777 /path/to/artisan

Just follow this answer

Salal Aslam
  • 1,367
  • 4
  • 16
  • 32