sadams101 Posted August 19, 2018 Posted August 19, 2018 I am trying to upgrade PHP, I've correctly provisioned all modules (I believe) in my WHM cPanel, and I've closely compared the php.ini files in both versions so that their settings are the same, but when I switch the site with my large forum to PHP 7.1 I get memory errors: [18-Aug-2018 23:15:41 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1867776 bytes) in /home/mysite/public_html/init.php(460) : eval()'d code on line 129 I copied over the same setting I had in 7.0 for: memory_limit = 1000M Any ideas?
Rhett Posted August 19, 2018 Posted August 19, 2018 3 minutes ago, sadams101 said: I am trying to upgrade PHP, I've correctly provisioned all modules (I believe) in my WHM cPanel, and I've closely compared the php.ini files in both versions so that their settings are the same, but when I switch the site with my large forum to PHP 7.1 I get memory errors: [18-Aug-2018 23:15:41 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1867776 bytes) in /home/mysite/public_html/init.php(460) : eval()'d code on line 129 I copied over the same setting I had in 7.0 for: memory_limit = 1000M Any ideas? Did you restart php after adjusting this? as it stands it's trying to allocate 33MB and is running out, double check you have at least 128MB php memory.
sadams101 Posted August 19, 2018 Author Posted August 19, 2018 I did try restarting PHP...where do you mean to check for 128M php memory...is this a php.ini setting, or somewhere else. I also noticed this error: Call to undefined method stdClass::language()
Rhett Posted August 19, 2018 Posted August 19, 2018 Yes its a setting in php.ini download the server check script in the marketplace (get ready for ips4) and browse to that, sounds like php isn’t configured properly in this case. (With proper modules)
sadams101 Posted August 19, 2018 Author Posted August 19, 2018 PS - I am no longer seeing this error: Call to undefined method stdClass::language() But I still have the memory errors and can't switch to PHP 7.1
Rhett Posted August 19, 2018 Posted August 19, 2018 Disable all third party plugins in the aco and try the front end again
sadams101 Posted August 19, 2018 Author Posted August 19, 2018 Here is what I've tried so far, which did not work: 1) Disabled all 3rd Party apps, plugins, advertisements, etc. 2) Disabled using memcache and loaded the new constants.php file; I have other apps on this server that I've switched over to PHP 7.1 without any issues, for example my Revive Adserver app.
bfarber Posted August 20, 2018 Posted August 20, 2018 Check .htaccess files, conf_global.php for an ini_set() call, constants.php, etc. The error is showing a 32MB memory limit, so your php.ini 1000M limit is not being used for some reason. I assume it's being overridden somewhere along the chain.
sadams101 Posted August 20, 2018 Author Posted August 20, 2018 I looked in each of those files, and used a grep search in root for: grep -R 'ini_set' * but found nothing. Please let me know if you can think of anything else that could cause this.
Rhett Posted August 21, 2018 Posted August 21, 2018 Please submit a support ticket and we can take a look for you.
Xenboy Posted August 22, 2018 Posted August 22, 2018 You mentioned cPanel and since you're using PHP 7+, this means your server is using the newer EasyApache 4. It doesn't matter what settings you had for PHP 7.0 because when you switch to 7.1 you're using an entirely different bunch of settings. You'll need to modify your settings under PHP 7.1. If your web host has PHP 7.1 enabled globally with only 32 MB of memory (which is odd since 128 MB is the default these days), you should be able to go into your cPanel account and unless your web host has disabled it, and click on the MultiPHP Editor. Select the domain or subdomain your copy of IPS is running under and that will bring up a list of PHP settings. Change "memory_limit" to a larger number and apply changes. Note: Depending on your server's settings, these changes may not apply instantly, but may take a few minutes to take effect.
sadams101 Posted August 22, 2018 Author Posted August 22, 2018 Hello @Xenboy, thank you for the info. I am the server's admin, and I haven't enabled PHP 7.1 globally (PHP 5.6 is the global for the server), but have enabled PHP 7.0 on my IPB site without issues...the php.ini settings are the same, and all versions of PHP on the server are set to 1000M for memory_limit, so I can't understand where the 32M error is coming from. It is very strange.
steve00 Posted August 22, 2018 Posted August 22, 2018 1 hour ago, sadams101 said: Hello @Xenboy, thank you for the info. I am the server's admin, and I haven't enabled PHP 7.1 globally (PHP 5.6 is the global for the server), but have enabled PHP 7.0 on my IPB site without issues...the php.ini settings are the same, and all versions of PHP on the server are set to 1000M for memory_limit, so I can't understand where the 32M error is coming from. It is very strange. Not sure if it helps Quote On systems that run EasyApache 4, multiple php.ini and local.ini files manage your system's PHP. Each version of PHP on your systems uses its own php.ini and local.ini file. You must make changes to each file separately. seems there is also a local.ini file as well ? Also: Quote On systems that run EasyApache 4, we strongly recommend that you only edit these files with WHM's MultiPHP INI Editor interface (WHM >> Home >> Software >> MultiPHP INI Editor). This ensures that an operable version of PHP exists on the system
sadams101 Posted August 22, 2018 Author Posted August 22, 2018 Sorry, yes, I've been using the Multiple PHP.INI Editor in WHM cPanel logged in as root, and I am using EasyApache 4. So I believe that I've edited all relevant files.
Xenboy Posted August 23, 2018 Posted August 23, 2018 @sadams101 - When I say global, I mean the "default" settings for that specific version of PHP if you don't manually change things, I was not referring to the default version of PHP that users on your server will have (5.6) unless they change the version of PHP they want to use. When you switch your PHP version, the settings you had in the previous version of PHP will no longer apply and you'll get the default settings that PHP 7.x has on your server. The settings you will want to change aren't in WHM (unless you want to apply those settings to all accounts that use that version of PHP and who also have not made any changes to the PHP settings in their cPanel account. You should log in to cPanel as the cPanel user for the account that owns the domain you want to make the change for. If that is what you are doing, the domain may also have one or more files or settings that are forcing an override to the settings you are changing in cPanel. For example, if you had custom settings for PHP under the older Easy Apache 3 system. I'd discuss the matter with whoever provides you your server as there are a number of files and locations to look at when resolving this problem and it's not the kind of thing that is easy to explain in a forum like this.
sadams101 Posted August 25, 2018 Author Posted August 25, 2018 There must have been an issue with my php 7.1 installation. To resolve this I used EasyApache 4 to fully uninstall PHP 7.1 and all modules, then reintalled them. After doing that I got things working.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.