I am trying to start cron job because I get an error when trying to install the extension.

according to this guide: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

  1. I opened Putty and connected to the server
  2. Run commend 'crontab -e'
  3. I put this line at the bottom

    * * * * * /usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log

and and I chose CTRL + O

now the program asks me how to save it, here is a screenshot, What should I do next? enter image description here

I save cron path Ctr+X and confirm Y(yes)

Next step When I try run Cron Job via command line: 'cd /bin' and next line

./magento cron:run

I get error "Premission denied".

Below screenshot.enter image description here


There are 2 errors I can see from your screenshot.

  1. Your crontab permission is broken, your changes aren't applied in crontab yet.
  2. You don't have execute permission on bin/magento


Reinstall crontab to fix read-only file system issue. Execute the following command as root user

dpkg-query -S /var/spool/cron/crontabs
apt-get install --reinstall cron

Add execute permission for bin/magento by use the following command

chmod u+x bin/magento

However, are you sure that the line you've added to crontab -e use the correct webroot directory and PHP path?

* * * * * /usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log

because as the above image your magento root dir located here


Please use below cron command in command console to fix the check cron script Readiness check issue

/usr/local/bin/php -c /usr/local/lib/php.ini /<Magento installation path>bin/magento cron:run

/usr/local/bin/php -c /usr/local/lib/php.ini /<Magento installation path>

/usr/local/bin/php -c /usr/local/lib/php.ini /<Magento installation path>bin/magento setup:cron:run

May that help. Please make sure you have sufficient permissions of var folder.

  • unfortunately I do not have these files in these folders. When I run this command I get error "No such file or directory". – Sylvester Dec 31 '17 at 8:38
  • Please check your php path by using which php command and check your php.ini path using phpinfo() fn on Magento root directory – Purushotam Sharma Dec 31 '17 at 8:44

I used these commands but still something blocks me. enter image description here

here you have translated errors:

1448/5000 brandswearxv @ brandswearxv: ~ $ dpkg-query -S / var / spool / cron / crontabs dpkg-query: error: can not open to read the file "/var / lib / dpkg / status" containing information about the package: Permission denied brandswearxv @ brandswearxv: ~ $ apt-get install --reinstall cron In: Can not read /etc/apt/apt.conf.d/ - DirectoryExists (13: Permission denie d) In: Can not read /etc/apt/sources.list.d/ - DirectoryExists (13: Permission denied) In: Can not read /etc/apt/sources.list - RealFileExists (13: Permission denie d) E: Failed to open the lock file / var / lib / dpkg / lock - open (13: Permissio n denied) E: Failed to block the administrative directory (/ var / lib / dpkg /), do you use administrator privileges? brandswearxv @ brandswearxv: ~ $ chmod u + x bin / magento brandswearxv brandswearxv @: ~ $


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.