[Fixed] Error 500 on main admin page

Daegaladh

Member
Today I'm getting error 500 on the main admin page of my visiolist (the rest of the admin panel and the list itself works fine, it's just the main page of the admin panel)
I changed nothing, so I don't know where this error comes from :/

Apache log says: [25/Dec/2015:21:14:39 +0100] "GET /index.php?a=admin HTTP/1.1" 500 26 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"

But I get nothing on the apache error log, which is weird (I forced other errors and they show up in the log, but not this)

It's a shared hosting, unknown apache ver, php ver 5.6

Any ideas about what could be causing this error? Thanks!
 
Last edited:

Daegaladh

Member
I found what was causing the error:
PHP:
$latest_version = file_get_contents('http://visiolist.com/version.txt');
I don't know why, since I can access the url. Probably my hosting gets timeout, or cannot resolve the domain for any reason :/
 

Daegaladh

Member
This is what I did to fix it:

PHP:
if (ini_get('allow_url_fopen') === false || !$latest_version = @file_get_contents('http://visiolist.com/version.txt',false,stream_context_create(array('http'=>array('timeout'=>10))))) {
      $latest_version = '?';
    }
 
Last edited:

Mark

Administrator
Staff member
yup looks like your shared hosting has disabled allow_url_fopen(), good fix, we may roll that into the next release to save any others with restrictive hosting environments.
 

Daegaladh

Member
Nope, I tested it and works for other urls, just doesn't connect to visiolist.com for some reason. Probably is just a temporary problem, but now with my fix we have this cases covered ;)

Btw, it would be a good idea to add this timeout code to the Stopforumspam plugin too. Just in case.
 
Last edited:
Top