Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Michael Grote Posted July 27, 2022 Posted July 27, 2022 Hi, in preparation of the upgrade to 4.7 I asked my hosting provider to switch to PHP 7.4.3+ The company installed PHP 4.7.26 on Debian 4.19, MariaDB and nginx Using a test setup to check the compatibility I run in trouble. phpinfo() reports a memory limit of 512MB while the compatibilty checker ips4.php reports "our PHP memory limit is too low. It needs to be set to 128M or more. You should contact your hosting provider or system administrator to ask for this to be changed." (see screenshots) Both the hosting provider and I are searching for the reason for this discrepancy - but with no success. Do you have any ideas? Regards Michael
Mark H Posted July 27, 2022 Posted July 27, 2022 I do see that happening, yes, and if you click the small "phpinfo" link in the upper right of the second screenshot, it reports the same thing. Is the ips4.php file on the second screenshot, a file that you just downloaded from the Marketplace and uploaded to your server?
Michael Grote Posted July 27, 2022 Author Posted July 27, 2022 3 hours ago, Mark H said: Is the ips4.php file on the second screenshot, a file that you just downloaded from the Marketplace and uploaded to your server? Yes, it's a brand new copy from the invision server
Jim M Posted July 27, 2022 Posted July 27, 2022 Unfortunately, the URLs listed there in your screenshot are not a licensed URL on any of your licenses. For support, please ensure you are using a license URL. Additionally, while we can review this, it often comes down to that there is a configuration misconception on the server, being one directory is running a different PHP configuration then another or there is caching in place.
Michael Grote Posted July 28, 2022 Author Posted July 28, 2022 Hi Jim, Correct, the listed URL is not a licensed one. As we tried the same on the licensed ones the forum software stopped working. In order to have running forums we choose to switch to this test setup (on the same server). So I ask again: do you have any idea whats going wrong?
Marc Posted July 28, 2022 Posted July 28, 2022 In the location you have your ips4.php file, it is running with too low a memory_limit. So if its showing that in PHPInfo, you will need to check where this is being overrode The location you have an installation is not one of your test installations, nor a live installation. If you are using it as test you must use your test installation key as per your license agreement
Michael Grote Posted July 28, 2022 Author Posted July 28, 2022 12 hours ago, Marc Stridgen said: The location you have an installation is not one of your test installations, nor a live installation. If you are using it as test you must use your test installation key as per your license agreement I asked your colleagues to change one of my test installations to point to the above URL. Now it's an official test installation.
Jim M Posted July 28, 2022 Posted July 28, 2022 26 minutes ago, Michael Grote said: I asked your colleagues to change one of my test installations to point to the above URL. Now it's an official test installation. I tried to take a courtesy look at your server directory to see if there is anything that sticks out there, but the FTP access details are incorrect. If in your Invision Community installation directory there is a .htaccess or php.ini, please ensure that these are set correctly and not overriding anything set at the server level.
Michael Grote Posted July 29, 2022 Author Posted July 29, 2022 I‘ll talk to the hosting provider to open FTP access for you
Michael Grote Posted August 8, 2022 Author Posted August 8, 2022 Hi, as I'm waiting for an unrestricted FTP access I tried to drill down the error message. For this I added an extra line of code in the ips4.php script as follows: Quote <?php $_memoryLimit = @ini_get('memory_limit'); $memoryLimit = $_memoryLimit; preg_match( "#^(\d+)(\w+)$#", strtolower($memoryLimit), $match ); if( $match[2] == 'g' ) { $memoryLimit = intval( $memoryLimit ) * 1024 * 1024 * 1024; } else if ( $match[2] == 'm' ) { $memoryLimit = intval( $memoryLimit ) * 1024 * 1024; } else if ( $match[2] == 'k' ) { $memoryLimit = intval( $memoryLimit ) * 1024; } else { $memoryLimit = intval( $memoryLimit ); } ?> <li class="success"><?php echo $_memoryLimit; ?> memory limit.</li> <?php if ( $memoryLimit >= 128 * 1024 * 1024 😞 ?> <li class="success"><?php echo $_memoryLimit; ?> memory limit.</li> <?php else: $success = FALSE; ?> <li class="fail">Your PHP memory limit is too low. It needs to be set to 128M or more. You should contact your hosting provider or system administrator to ask for this to be changed.</li> <?php endif; ?> The result looks like this: Quote PHP Requirements PHP version 7.4.26. cURL extension loaded DOM extension loaded. GD extension loaded. Multibyte String extension loaded. MySQLi extension loaded. OpenSSL extension loaded. Session extension loaded. SimpleXML extension loaded. XML Parser extension loaded. XMLReader extension loaded. XMLWriter extension loaded. Zip extension loaded. Exif extension loaded. GMP extension loaded. 512M memory limit. Your PHP memory limit is too low. It needs to be set to 128M or more. You should contact your hosting provider or system administrator to ask for this to be changed. No Suhosin restrictions. From my point of view the PHP system reports 512M memory too, but your script does a the wrong evaluation. Or am I completely wrong?
Marc Posted August 8, 2022 Posted August 8, 2022 You havent explained what you have changed there. I would however say that the file you are changing has been used for many years, and is used in every upgrade and install. Its very very unlikely that calculation is incorrect
Michael Grote Posted August 8, 2022 Author Posted August 8, 2022 Meanwhile I added two lines of code to print out the calculation values of the memory check. The additional lines are printed in bold: Quote 243 <?php 244 $_memoryLimit = @ini_get('memory_limit'); 245 $memoryLimit = $_memoryLimit; 246 247 preg_match( "#^(\d+)(\w+)$#", strtolower($memoryLimit), $match ); 248 if( $match[2] == 'g' ) 249 { 250 $memoryLimit = intval( $memoryLimit ) * 1024 * 1024 * 1024; 251 } 252 else if ( $match[2] == 'm' ) 253 { 254 $memoryLimit = intval( $memoryLimit ) * 1024 * 1024; 255 } 256 else if ( $match[2] == 'k' ) 257 { 258 $memoryLimit = intval( $memoryLimit ) * 1024; 259 } 260 else 261 { 262 $memoryLimit = intval( $memoryLimit ); 263 } 264 ?> 265 266 <li class="success"><?php echo $_memoryLimit; ?> $_memory limit.</li> 267 <li class="success"><?php echo $memoryLimit; ?> $memory limit.</li> 268 269 <?php if ( $memoryLimit >= 128 * 1024 * 1024 😞 ?> 270 <li class="success"><?php echo $_memoryLimit; ?> memory limit.</li> 271 <?php else: $success = FALSE; ?> 272 <li class="fail">Your PHP memory limit is too low. It needs to be set to 128M or more. You should contact your hosti ng provider or system administrator to ask for this to be changed.</li> 273 <?php endif; ?> The result is as follows: Quote PHP Requirements PHP version 7.4.26. cURL extension loaded DOM extension loaded. GD extension loaded. Multibyte String extension loaded. MySQLi extension loaded. OpenSSL extension loaded. Session extension loaded. SimpleXML extension loaded. XML Parser extension loaded. XMLReader extension loaded. XMLWriter extension loaded. Zip extension loaded. Exif extension loaded. GMP extension loaded. 512M $_memory limit. 512 $memory limit. Your PHP memory limit is too low. It needs to be set to 128M or more. You should contact your hosting provider or system administrator to ask for this to be changed. No Suhosin restrictions. Again the additional result lines are in bold The string 512M $_memory limit shows the result of the system call $_memoryLimit = @ini_get('memory_limit'); while the string 512 $memory limit is the result of your script calculation. This is compared to $memoryLimit >= 128 * 1024 * 1024 and fails The above code can be found in line 244 to 268 Doing the same with PHP 7.3 enabled shows the correct result. Quote PHP Requirements You are not running a compatible version of PHP. You need PHP 7.4.0 or above (8.0.0 or above recommended). You should contact your hosting provider or system administrator to ask for an upgrade. cURL extension loaded DOM extension loaded. GD extension loaded. Multibyte String extension loaded. MySQLi extension loaded. OpenSSL extension loaded. Session extension loaded. SimpleXML extension loaded. XML Parser extension loaded. XMLReader extension loaded. XMLWriter extension loaded. Zip extension loaded. Exif extension loaded. GMP extension loaded. 512M $_memory limit. 536870912 $memory limit. 512M memory limit. No Suhosin restrictions.
Marc Posted August 8, 2022 Posted August 8, 2022 I have added a flag for developers to take a look at this and advise
Michael Grote Posted August 8, 2022 Author Posted August 8, 2022 3 minutes ago, Marc Stridgen said: I have added a flag for developers to take a look at this and advise Thanks Marc My improved script can be found here
Marc Posted August 24, 2022 Posted August 24, 2022 There isnt at present. A developer will take a look as soon as possible
Andy Millne Posted September 6, 2022 Posted September 6, 2022 Your server (via ini_get('memory_limit')) is reporting the memory limit as "512" rather than "512M". This is something your host would need to investigate. Marc 1
Recommended Posts