Jump to content

Memory Errors When Changing from PHP 7.0 to PHP 7.1


sadams101

Recommended Posts

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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...