Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Error 500 after update, can't complete update (catch 22, multisite + solution)
Avatar
Jeferson
Member
sp_UserOfflineSmall Offline
May 10, 2016 - 4:22 am

 Hello,

 

After updating simple:press our wordpress multisite gave an error 500 and could only be viewed by disabling the simple:press plugin. 

Also the simple:press plugin still needed to be upgraded (to be completed) so it was a bit of a catch 22 issue. Update caused error 500, can't update further cause of error 500 -> disable plugin = no 500 but can't update and can't use it then) 

So after using the debug console a bit I found out that there was only 1 page causing a 500 error for the installation. When looking into the HTTP error logs I found: 

[Tue May 10 09:50:29 2016] [error] [client MyClient] PHP Fatal error:  Can't use function return value in write context in /var/www/html/BLABLA/wp-content/sp-resources/forum-plugins/mycred/sp-mycred-plugin.php on line 83, referer: http://BLABLA.com/BLABLA/wp-admin/admin.php?page=simple-press%2Fsp-startup%2Fsp-load-install.php

To avoid this error + the catch 22 I commented out the if around line 83 in sp-mycred-plugin.php. 
After that I could run the update, and bring everything back to normal. 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2016 - 5:46 am

My apologies for you getting the error... but I am somewhat puzzled as I don't quite see what is likely to be wrong there!

Line 83 itself - 

if (defined('myCRED_VERSION') && !empty(get_option('mycred_setup_completed'))) {

has not changed. So if it causes an error condition it should always have done so. Line 84 changed to include the call to the WP function admin_url() but that should be fine as, if the function determines the site is an MS install it copes with this.

I will do some digging...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2016 - 5:47 am

Hang on a minute...

Can you tell me what your PHP version is please?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Jeferson
Member
sp_UserOfflineSmall Offline
May 10, 2016 - 7:20 am

PHP version: 

PHP 5.3.3 (cli) (built: Jan 5 2016 08:55:01)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2016 - 7:30 am

Thanks. That explains it - although doesn't explain why you have not had the error before as that code has been in place a long time.

It is the use of the 'empty' function. Prior to PHP 5.5 you had to pass an actual variable into the empty function. Post 5.5 it can take a function or expression that evaluates to a value.

I have also misinterpreted the WordPress minimum requirements for PHP. I see that it recommends 5.6 as a minimum version - not actually requires it. For the record the site states:

Note: If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP 5.2.4+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities

So something, perhaps, for you to consider. But meanwhile I will correct the error and again - apologies for it happening. I would love to know why this has not reared it's head for you before but I guess that will remain a mystery!

andy-signature.png
YELLOW
SWORDFISH
Avatar
Jeferson
Member
sp_UserOfflineSmall Offline
May 10, 2016 - 7:46 am

Well it is the first time we update simple:press and it only occurs when updating. 
Also using a newer version of PHP is a bit tricky since s390x is always a bit behind unless we compile it ourselves. 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 10, 2016 - 9:51 am

I certainly understand...

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625