PDA

View Full Version : memory_limit (1G) exceeded in installation of plugin


eJunkie
02-24-2018, 01:10 PM
Dear Community,

in an upgrade process of my addon I would like to change a bitfield of the table "user" with the datamanager.

$sql = $db->query_read("SELECT userid FROM ".TABLE_PREFIX."user");
while($user = $db->fetch_array($sql)) {
$userdm =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
$userdm->adminoverride = true;
$userinfo = fetch_userinfo($user['userid']);
$userdm->set_existing($userinfo);
$userdm->set_bitfield('onesignal', 'pushModeration', 1);
$userdm->save();
unset($userdm,$userinfo);
}

I set the memory_limit to 1G but the php process ends with error of memory limit.

How do you solve thoose problems?

Dave
02-24-2018, 01:12 PM
Are you executing the script from a webbrowser?
Try to execute it through the command line instead. E.g. php scriptname.php

eJunkie
02-24-2018, 01:16 PM
I think in the command line it will works but I would like to use the installation process of vbulletin (plugin.php?do=productimport) for easy handle. If its possible. I will use this addon in a lot of forum installations.