Notifications
Clear all

wpForo 1.x.x [Solved] Undefined index: SERVER_PORT functions.php in debug log

11 Posts
4 Users
0 Likes
6,229 Views
Posts: 11
Topic starter
(@jasonb)
Active Member
Joined: 6 years ago

I am getting a 502 bad gateway error when clicking on topics. This only happens when I am logged in as admin. The site works fine otherwise. I get this in debug log:

[14-Sep-2018 00:47:30 UTC] PHP Notice: Undefined index: SERVER_PORT in /home/content/a2pewpnaspod04_data01/88/41242588/html/wp-content/plugins/wpforo/wpf-includes/functions.php on line 257
[14-Sep-2018 00:47:30 UTC] PHP Notice: Undefined index: SERVER_PORT in /home/content/a2pewpnaspod04_data01/88/41242588/html/wp-content/plugins/wpforo/wpf-includes/functions.php on line 257
[14-Sep-2018 00:47:30 UTC] PHP Notice: Undefined index: HTTP_HOST in /home/content/a2pewpnaspod04_data01/88/41242588/html/wp-content/plugins/wpforo/wpf-includes/functions.php on line 258

The lines from functions.php:

257 $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
258 $url = $protocol . "://" . $_SERVER['HTTP_HOST'] . ($with_port ? $port : '') . $_SERVER['REQUEST_URI'];

 

I'm on godaddy managed WP hosting.

10 Replies
Robert
Posts: 10499
Admin
(@robert)
Support Team
Joined: 8 years ago

That's very strange that your server doesn't have $_SERVER["SERVER_PORT"] variable. This is a general variable for all servers. Please let me know what serer you use and what is your PHP version. Your server maybe a non-standard or the versions are very old. Here are wpForo server requirements:

https://wpforo.com/docs/root/wpforo-installation/server-requirements/

1 Reply
(@jasonb)
Joined: 6 years ago

Active Member
Posts: 11

Hi Robert,

I've checked the settings. I have:

PHP version 5.6.3

Apache

memory_limit = 512m, max_input vars = 1000, post_max_size =33m, upload_max_filesize = 33m

I can update to the recommended values later today. I'm not sure about the string functions, but I do have mod_rewrite in htcaccess.

I have permalinks set to "post name", but I notice some links are given and extra slash with " post#xxxx. But either links are affected.

 

 

Sofy
Posts: 4233
 Sofy
Admin
(@sofy)
Support Team
Joined: 6 years ago

Hi  jasonb,

We couldn't find such a warning on our test websites. Could you please send admin login details to support[at]gvectors.com email address to allow us to debug it?

1 Reply
(@jasonb)
Joined: 6 years ago

Active Member
Posts: 11

Yes, I'll send it.

Posts: 11
Topic starter
(@jasonb)
Active Member
Joined: 6 years ago

Hi,

I've done the following:

added recommended server settings:

memory_limit = 256M
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 180
max_input_vars = 10000

I had a wp technician working on it and he determined that is was a server issue, since he was not getting the error by staging. I moved from godaddy to siteground, though the issue still persists, though I was going make the move anyway.

Also recreated .htaccess, but that did not help.

I also had some residual user settings from bbpress that I had installed previously, and I followed their instructions for removing that, it removed the keymaster role from my username but did not resolve the error page issue.

Posts: 316
(@1sharonkat)
Reputable Member
Joined: 7 years ago

 502 bad gateway error when clicking on topics.

I had many of these during development and testing of few sites at the same time.

In my case it was a simple router problem since I was connected via NAT protocol.

A reboot of the modem/router and sometimes disconnect/connect the ADSL line solve the problem for few days until the next boot.

Clearing browser cache helps too.

First time when I called for support [bluehost] they found nothing wrong at their end  and they gave that modem/router solution.

 

Page 1 / 2