cancel
Showing results for 
Search instead for 
Did you mean: 

cron jobs and php memory limit, cpanel hosting

Highlighted

cron jobs and php memory limit, cpanel hosting

I'm running Magento 2.2.2 with cpanel

I am getting this error in update.log:

--

setup-cron.ERROR: Your current PHP memory limit is 128M. Magento 2 requires it to be set to 756M or more. As a user with root privileges, edit your php.ini file to increase memory_limit. (The command php --ini tells you where it is located.) After that, restart your web server and try again. 

--

I don't have the ability to edit the php.ini file specified in "php --ini", or restart the shared web server.

I have set memory_limit to 756M in my php.ini file, and I have specified the php.ini file location in my crontab AND I also specified the memory_limit to 756 in crontab. 

-- Output of "crontab -l"

10,29,35,59 * * * * /usr/local/bin/php -c /home/chargoggagoggman/public_html --d memory_limit=756M /home/chargoggagoggman/public_html/update/cron.php >> /home/chargoggagoggman/public_html/var/log/update.cron.log
7,29,30,58 * * * * /usr/local/bin/php -c /home/chargoggagoggman/public_html -d memory_limit=756M /home/chargoggagoggman/public_html/bin/magento setup:cron:run >> /home/chargoggagoggman/public_html/var/log/setup.cron.log
12,24,43,48 * * * * /usr/local/bin/php -c /home/chargoggagoggman/public_html -d memory_limit=756M /home/chargoggagoggman/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/chargoggagoggman/public_html/var/log/magento.cron.log

--

Each time I make a change, I run "php bin/magento cron:run" twice, per a suggestion I saw in this forum

I also tried "php bin/magento setup:cron:run"

adding a phpinfo query to the home page of my website showed nothing contradictory

Suggestions, please?

 

Tags (3)
3 REPLIES

Re: cron jobs and php memory limit, cpanel hosting

Hi @PanchoCole,

 

Can you run this on your server console?

 

php -i | grep limit

The output could be, for example:

 

memory_limit => -1 => -1
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
pcre.backtrack_limit => 1000000 => 1000000
pcre.recursion_limit => 100000 => 100000
session.cache_limiter => nocache => nocache
soap.wsdl_cache_limit => 5 => 5

Can you check which value you get on memory_limit ?

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: cron jobs and php memory limit, cpanel hosting

It's shared hosting.  You cant use console.

I got the same issue.

Re: cron jobs and php memory limit, cpanel hosting

Hi @Dmitriy_Komar,

 

Maybe is a good idea to explore another hosting options. Using Magento 2 without full access to the console it could be a bad a idea.

I can't imagine having a Magento 2 store with limitations when I need to use the console.

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"