MySQL/PHP issue.
-
In my other MySQL thread I mentioned the inheritance of a Moodle install. I am upgrading to the latest version of moodle and I saw that it recommends to change the file format from Antelope to Barracuda. When I run the script that is supposed to update the file format i get this error:
PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 49152 bytes) in /var/www/moodle/admin/cli/mysql_compressed_rows.php on line 152
I checked the memory_limit in php.ini:
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 2147483648Not sure what the issue is as the memory_limit is 2GB
-
I have to run the script from the /var/www/moodle/ directory.
Script is: php admin/cli/mysql_compressed_rows.php --list -
@WLS-ITGuy said in MySQL/PHP issue.:
Maximum amount of memory a script may consume (128MB)
The correct format would be 2048M
-
that seems like way too much memory, are you SURE you want to give Moodle that much? How much do they recommend? How much memory does your system have to give?
-
@WLS-ITGuy said in MySQL/PHP issue.:
memory_limit = 2147483648
Uh? We're running a fairly large instance of Moodle and limit it to ~400M.
-
You can increase it in the .htaccess file for quick testing (if your config supports it).
-
@coliver said in MySQL/PHP issue.:
@WLS-ITGuy said in MySQL/PHP issue.:
memory_limit = 2147483648
Uh? We're running a fairly large instance of Moodle and limit it to ~400M.
Have to be careful going too big or it limits the number of processes that can run and slows things way down.
-
@Tim_G said in MySQL/PHP issue.:
You can increase it in the .htaccess file for quick testing (if your config supports it).
I don't see an .htaccess file. Site is hosted at Linode
-
@coliver said in MySQL/PHP issue.:
@WLS-ITGuy said in MySQL/PHP issue.:
memory_limit = 2147483648
Uh? We're running a fairly large instance of Moodle and limit it to ~400M.
@scottalanmiller said in MySQL/PHP issue.:
@coliver said in MySQL/PHP issue.:
@WLS-ITGuy said in MySQL/PHP issue.:
memory_limit = 2147483648
Uh? We're running a fairly large instance of Moodle and limit it to ~400M.
Have to be careful going too big or it limits the number of processes that can run and slows things way down.
Changed to 400M and I still have the same issue.
-
@WLS-ITGuy said in MySQL/PHP issue.:
@Tim_G said in MySQL/PHP issue.:
You can increase it in the .htaccess file for quick testing (if your config supports it).
I don't see an .htaccess file. Site is hosted at Linode
It's a file you create
-
That part I know, what I meant was that there wasn't one created already if that's what Tim was asking/suggesting.
-
@WLS-ITGuy said in MySQL/PHP issue.:
That part I know, what I meant was that there wasn't one created already if that's what Tim was asking/suggesting.
I thought that he was suggesting that you could create one for fast memory size testing.
-
Increase it temporarily to 2048M, or higher, and drop down once the conversion is done. Restart apache/nginx/other web server, or restart php-fpm if it's used instead after each config change.
-
@marcinozga said in MySQL/PHP issue.:
Increase it temporarily to 2048M, or higher, and drop down once the conversion is done. Restart apache/nginx/other web server, or restart php-fpm if it's used instead after each config change.
Has been set at 2048M, restarted apache and rebooted server and still get the same error.
-
@WLS-ITGuy said in MySQL/PHP issue.:
@marcinozga said in MySQL/PHP issue.:
Increase it temporarily to 2048M, or higher, and drop down once the conversion is done. Restart apache/nginx/other web server, or restart php-fpm if it's used instead after each config change.
Has been set at 2048M, restarted apache and rebooted server and still get the same error.
Is this a script that you run from the command line? You may need to edit a different php.ini file (that used to be the case -- I haven't had to do it in a while) to adjust the memory settings for the php cli.
-
Actually, you might have more than one php.ini file. Create info.php file with this content:
<?php phpinfo(); ?>
and visit it in web browser. See what memory limits it shows and where could additional configs be located.
-
@marcinozga said in MySQL/PHP issue.:
Actually, you might have more than one php.ini file. Create info.php file with this content:
<?php phpinfo(); ?>
and visit it in web browser. See what memory limits it shows and where could additional configs be located.
-
So limit is set to 2G, is the conversion script still refusing to run?
-
Yes. If I CD to /var/www/moodle/ and run 'php admin/cli/mysql_compressed_rows.php --list' I get PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 49152 bytes) in var/www/moodle/admin/cli/mysql_compressed_rows.php on line 152
-
Just to be sure.... you aren't out of memory, right?