Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 24, 2020 04:40PM

Hello,

On my localhost site I get the following error message: 'Sorry, you are not allowed to access this page.'

In my php error log I have the following:
PHP Notice: Undefined index: ServerName in C:\wamp64\scripts\wampserver.lib.php on line 558.The same message for line 559.

558: $SerName = $virtualHost['Server'][$key]['ServerName'];
559: $DocRoot = $virtualHost['Server'][$key]['DocumentRoot'];


Any idea what's going on here and how to fix this would definitely be appreciated. Thanks.

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 24, 2020 05:04PM

Hi,

- Verify that all VC ++ packages are installed and with the latest versions.
To do this, use the tool:
Checks VC++ packages installed
Do not use a previously loaded tool. Make a new download to make sure you are using the correct version.
To download missing packages, do not rely on Microsoft links, they are not reliable, download packages on http://wampserver.aviatechno.net in section Visual C++ Redistribuable Packages
Do not forget that if you have a 64 bit Windows, you must install both 32 and 64 bit versions of each package.
You must install each package "as an administrator", so right-click the exe file and then run as Administrator.

- Apply Update 3.2.2 to your version of Wampserver
Wampserver update 3.2.2

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 24, 2020 06:24PM

Damn. Did all as suggested and STILL have the same problem. What next?

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 24, 2020 07:32PM

Hi,

What is the content of the httpd-vhosts.conf file?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 24, 2020 08:40PM

# Virtual Hosts
# wamp
<VirtualHost *:80>
  ServerAdmin johnprince@shaw.ca 	
  ServerName localhost
  ServerAlias localhost.com www.localhost.com
  ErrorLog "logs/localhost-error.log"
  CustomLog "logs/localhost-access.log" common
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>


# mr-sport
<VirtualHost *:80>
	ServerAdmin contact@mr-sport.ca 
	ServerName mr-sport
	ServerAlias www.mr-sport
	DocumentRoot "F:/Sites/mr-sport"
	ErrorLog "logs/mr-sport-error.log"
	CustomLog "logs/mr-sport-access.log" common
	<Directory  "F:/Sites/mr-sport/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# johnprince
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName johnprince
	ServerAlias www.johnprince
	DocumentRoot "F:/Sites/johnprince"
	ErrorLog "logs/johnprince-error.log"
	CustomLog "logs/johnprince-access.log" common
	<Directory  "F:/Sites/johnprince/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# myworld
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName myworld
	ServerAlias www.myworld
	DocumentRoot "F:/Sites/myworld"
	ErrorLog "logs/myworld-error.log"
	CustomLog "logs/myworld-access.log" common
	<Directory  "F:/Sites/myworld/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# mylibrary
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName mylibrary
	ServerAlias www.mylibrary
	DocumentRoot "F:/Sites/mylibrary"
	ErrorLog "logs/mylibrary-error.log"
	CustomLog "logs/mylibrary-access.log" common
	<Directory  "F:/Sites/mylibrary/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# attentat
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName attentat
	ServerAlias www.attentat
	DocumentRoot "F:/Sites/attentat"
	ErrorLog "logs/attentat-error.log"
	CustomLog "logs/attentat-access.log" common
	<Directory  "F:/Sites/attentat/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# mycdnprince
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName mycdnprince
	ServerAlias www.mycdnprince
	DocumentRoot "F:/Sites/mycdnprince"
	ErrorLog "logs/mycdnprince-error.log"
	CustomLog "logs/mycdnprince-access.log" common
	<Directory  "F:/Sites/mycdnprince/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# wpblog
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName wpblog
	ServerAlias www.wpblog
	DocumentRoot "F:/Sites/wpblog"
	ErrorLog "logs/wpblog-error.log"
	CustomLog "logs/wpblog-access.log" common
	<Directory  "F:/Sites/wpblog/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# wpclass
<VirtualHost *:80>
    ServerAdmin johnprince@shaw.ca
	ServerName wpclass
	ServerAlias www.wpclass
	DocumentRoot "F:/Sites/wpclass"
	ErrorLog "logs/wpclass-error.log"
	CustomLog "logs/wpclass-access.log" common
	<Directory  "F:/Sites/wpclass/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# djssports
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName djssports
	ServerAlias www.djssports
	DocumentRoot "F:/Sites/djssports"
	ErrorLog "logs/djssports-error.log"
	CustomLog "logs/djssports-access.log" common
	<Directory  "F:/Sites/djssports/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# election2013
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName election2013
	ServerAlias www.election2013
	DocumentRoot "F:/Sites/election2013"
	ErrorLog "logs/election2013-error.log"
	CustomLog "logs/election2013-access.log" common
	<Directory  "F:/Sites/election2013/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>


# lwc
<VirtualHost *:80>
	ServerAdmin johnprince@shaw.ca
	ServerName lwc
	ServerAlias www.lwc
	DocumentRoot "F:/Sites/lwc"
	ErrorLog "logs/lwc-error.log"
	CustomLog "logs/lwc-access.log" common
	<Directory  "F:/Sites/lwc/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>



Edited 1 time(s). Last edit at 07/25/2020 03:15PM by RiggsFolly.

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 24, 2020 09:17PM

Hi,

Right-Click -> Wamp settings -> Don't check VirtualHost definitions

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 24, 2020 09:18PM

It was unchecked already.

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 24, 2020 09:44PM

Check it

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 24, 2020 09:50PM

Checked or unchecked I still get the same error message i.e. Sorry, you are not allowed to access this page.

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 25, 2020 11:08AM

Hi,

> Sorry, you are not allowed to access this page.
Even for the Wampserver homepage 'http://localhost/'?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 25, 2020 04:20PM

No, [localhost] is fine as are my other localhost sites on the httpd-vhosts.conf file I sent you. Its strictly my 'attentat' site. I can access the front end with no problem but not the backend. When I try the backend I get the 'Sorry, you are not allowed to access this page.' error message. At one point the message went away replaced by the 403 Forbidden message, but then returned again after rebooting the server. Seems I've tried everything with no luck. Very frustrating.

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 25, 2020 04:43PM

I just noticed on my sql.log I have the following:

2020-07-25T13:45:17.520268Z 12 [Warning] InnoDB: Cannot open table jprincedb/wpmrsport_yoast_primary_term from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to [dev.mysql.com] for how to resolve the issue.

This is in addition to the previous error message I already sent you before:

PHP Notice: Undefined index: ServerName in C:\wamp64\scripts\wampserver.lib.php on line 558.The same message for line 559.

558: $SerName = $virtualHost['Server'][$key]['ServerName'];
559: $DocRoot = $virtualHost['Server'][$key]['DocumentRoot'];

Hope these help.

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 25, 2020 04:56PM

Hi,

> PHP Notice: Undefined index: ServerName in C:\wamp64\scripts\wampserver.lib.php on line 558.
> The same message for line 559.
Who cares, these are just warnings that have nothing to do with "Sorry, you are not allowed to access this page" which is a post from WordPress.

These messages come from the fact that Wampserver can't analyze your VirtualHost because of all the additions you put in it. And that's why I told you to check the option not to check VirtualHost.

You need to repair the offending table by following the link in the MySQL error message or by trying the repair function in PhpMyAdmin.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 25, 2020 05:13PM

What 'additions' are you referring to? Too much content i.e. too many sites?

I'm a little confused. First of all, I've already did a repair to all tables in my 'attentat' site. Second, the table referred to in the mysql.log is for another site, not attentat but for wpmrsport which isn't even in my database as I dropped all sites and their tables but attentat. The only tables in my db are attentat tables. So why would I be getting an error message for a table that doesn't exist in my db?

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 25, 2020 08:07PM

Hi,

> So why would I be getting an error message for a table that doesn't exist in my db?
Because the local site needs this table, otherwise you wouldn't get an error message.
This is MySQL that generates this error.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 26, 2020 05:16PM

Have you given up? I'm new at this and stuck. Any help will be appreciated. Seems like I'm going around in circles and hoped someone with experience could help.

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: Otomatic (Moderator)
Date: July 26, 2020 05:47PM

Hi,

No, we're not going in circles!
Restoring the missing table from a backup is the only solution.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Undefined index: ServerName in C:\wamp64....
Posted by: mycdnprince (---.lb.shawcable.net)
Date: July 26, 2020 07:03PM

Ok. Thanks Otomatic. I appreciate your efforts here. Best!

Options: ReplyQuote


Sorry, only registered users may post in this forum.