wampserver.lib.php error
Posted by: Dragos (---.workpage.ro)
Date: November 17, 2022 10:07AM

Hello
Can someone help me? In the php errors page, two errors have been appearing for a very long time that I have ignored until now.
The errors are:
[17-Nov-2022 08:52:05 UTC] PHP Notice: Undefined index: ServerName in D:\wamp64\scripts\wampserver.lib.php on line 822
[17-Nov-2022 08:52:05 UTC] PHP Notice: Undefined index: DocumentRoot in D:\wamp64\scripts\wampserver.lib.php on line 823
From line 829 to line 837 I have the following in the wampserver.lib.php file:


//Check if VirtualHost use Apache fcgid_module & PHP version used.
$myVhostsContents = file_get_contents($c_apacheVhostConfFile);
$phpVersionList = listDir($c_phpVersionDir,'checkPhpConf','php',true);
- if(!isset($phpFcgiVersionList)) GetAliasVersions();
- foreach($virtualHost['ServerName'] as $value) {
$virtualHost['ServerNameFcgid'][$value] = false;
$virtualHost['ServerNameFcgidPHP'][$value] = '0.0.0';
$virtualHost['ServerNameFcgidPHPOK'][$value] = false;
$p_value = preg_quote($value);
822 and 823 are with line.
Can it be fixed?

===========================
thank you,
Dragos
===========================
I use:
windows 10 x64 bit
wampserver 3.3.6 (64bit)
php 8.3.9
mysql 9.0.1
phpmyadmin 5.2.1
apache 2.4.62
MariaDB 11.4.2

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: RiggsFolly (Moderator)
Date: November 17, 2022 10:15AM

Hi,

I am a little confused! If the errors appear on lines 822 and 823, why are you showing us line 829 to line 837, where the error is not ?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 11/17/2022 10:18AM by RiggsFolly.

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Otomatic (Moderator)
Date: November 17, 2022 10:30AM

Hi,

These are just "notice" that are of no consequence.
Since I'm in the final curve for Wampserver 3.3.0 and PHP 8.2.0 it's something I can't check and maybe it's already fixed.

We'll see if it persists with 3.3.0 !

Nevertheless, what is the content of your httpd-vhosts.conf file?

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

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Dragos (---.workpage.ro)
Date: November 17, 2022 12:23PM

RiggsFolly Wrote:
-------------------------------------------------------
> Hi,
>
> I am a little confused! If the errors appear on
> lines 822 and 823, why are you showing us line 829
> to line 837, where the error is not ?


To understand the context of the entire script without having to reopen the mentioned page. It can be seen from your totally useless post that you are a little confused....maybe you need a coffee??? smiling smiley

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Dragos (---.workpage.ro)
Date: November 17, 2022 12:32PM

Otomatic Wrote:
-------------------------------------------------------

> Nevertheless, what is the content of your
> httpd-vhosts.conf file?


Hi and thank you....



this is my file content:
# Virtual Hosts   ${INSTALL_DIR}
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "${INSTALL_DIR}/www"
  <Directory "${INSTALL_DIR}/www/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>


#
<VirtualHost *:80>
	ServerName example.com
	ServerAlias www.example.com	
	Redirect / [example.com]	
	DocumentRoot "d:/wamp64/www/example"
	<Directory  "d:/wamp64/www/example/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
	</Directory>
<IfModule fcgid_module>
    Define FCGIPHPVERSION "8.0.13"
    FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
    <Files ~ "\.php$">
      Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
      AddHandler fcgid-script .php
      FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
    </Files>
  </IfModule>  
	Alias /Filme "D:/Movie"
	<Directory  "D:/wamp64/www/example/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
	</Directory>
	Alias /Filme "D:/Movie"
	<Directory "D:/Movie">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
    </Directory>
	Alias /Video "E:/Video"
	<Directory  "D:/wamp64/www/example/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
	</Directory>
	Alias /Video "E:/Video"
	<Directory "E:/Video">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
    </Directory>
</VirtualHost>



Edited 1 time(s). Last edit at 11/17/2022 12:54PM by RiggsFolly.

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: RiggsFolly (Moderator)
Date: November 17, 2022 01:31PM

Dragos Wrote:
-------------------------------------------------------
> RiggsFolly Wrote:
> --------------------------------------------------
> -----
> > Hi,
> >
> > I am a little confused! If the errors appear on
> > lines 822 and 823, why are you showing us line
> 829
> > to line 837, where the error is not ?
>
>
> To understand the context of the entire script
> without having to reopen the mentioned page. It
> can be seen from your totally useless post that
> you are a little confused....maybe you need a
> coffee??? smiling smiley

I was going to let that slip by, but sorry I cannot after the sarky comment.

Lines numbers clearly mentioned in the error message
PHP Notice: Undefined index: ServerName in D:\wamp64\scripts\wampserver.lib.php on line 822
PHP Notice: Undefined index: DocumentRoot in D:\wamp64\scripts\wampserver.lib.php on line 823

And now those lines
822 	$SerName = $virtualHost['Server'][$key]['ServerName'];
823	$DocRoot = $virtualHost['Server'][$key]['DocumentRoot'];


And now the lines you picked to highlight, different line numbers, with more by luck than judgement one line that actually contains one of the variables!

832  if(!isset($phpFcgiVersionList)) GetAliasVersions();
833  foreach($virtualHost['ServerName'] as $value) {


I was rather wondering WHY you would pick some random lines of code with absolutely nothing to do with the line number in the Notice's you are asking about?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Dragos (---.workpage.ro)
Date: November 17, 2022 01:49PM

RiggsFolly Wrote:
-------------------------------------------------------
> Dragos Wrote:
> --------------------------------------------------
> -----
> > RiggsFolly Wrote:
> >
> --------------------------------------------------
>
>
> I was rather wondering WHY you would pick some
> random lines of code with absolutely nothing to do
> with the line number in the Notice's you are
> asking about?

Yes sorry...my fault...I chose the next paragraph wrongly...most be 820 to 828:
//Check if some VirtualHost use $wwwDir DocumentRoot reserved for localhost
foreach($virtualHost['Server'] as $key => $value) {
$SerName = $virtualHost['Server'][$key]['ServerName'];
$DocRoot = $virtualHost['Server'][$key]['DocumentRoot'];
$virtualHost['DocRootNotwww'][$SerName] = true;
if(strtolower($DocRoot) == strtolower($wwwDir) && stripos($SerName,'localhost') === false) {
$virtualHost['DocRootNotwww'][$SerName] = false;
}
}
Again sorry..
Thnk you...my mistake..

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Otomatic (Moderator)
Date: November 17, 2022 02:18PM

Hi,

Alias are not good !

See Apache directive Alias

Directives
  Alias /Filme "D:/Movie"
  <Directory  "D:/wamp64/www/example/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  </Directory>

  Alias /Filme "D:/Movie"
  <Directory  "D:/wamp64/www/example/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  </Directory>
are useless and should be deleted

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

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Dragos (---.workpage.ro)
Date: November 17, 2022 02:37PM

Otomatic Wrote:
-------------------------------------------------------

>
> Directives
>
>   Alias /Filme "D:/Movie"
>   <Directory  "D:/wamp64/www/example/">
>     Options +Indexes +Includes +FollowSymLinks
> +MultiViews
>     AllowOverride All
>     Require all granted
>   </Directory>
> 
>   Alias /Filme "D:/Movie"
>   <Directory  "D:/wamp64/www/example/">
>     Options +Indexes +Includes +FollowSymLinks
> +MultiViews
>     AllowOverride All
>     Require all granted
>   </Directory>
>
> are useless and should be deleted

If i delete that D:/Movie is outside the host and link [example.com] can't see him .

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: RiggsFolly (Moderator)
Date: November 17, 2022 03:03PM

I think Oto means that the unnecessary multiple repartitions of

<Directory  "D:/wamp64/www/example/">
	Options +Indexes +Includes +FollowSymLinks +MultiViews
	AllowOverride All
	Require all granted
</Directory>

under each Alias are useless and should be deleted

So replace
	Alias /Filme "D:/Movie"
	<Directory  "D:/wamp64/www/example/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
	</Directory>
	Alias /Filme "D:/Movie"
	<Directory "D:/Movie">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
    </Directory>
	Alias /Video "E:/Video"
	<Directory  "D:/wamp64/www/example/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
	</Directory>
	Alias /Video "E:/Video"
	<Directory "E:/Video">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require all granted
    </Directory>

With this

	Alias "/Filme" "D:/Movie"
	<Directory "D:/Movie">
        	Require all granted
       </Directory>

	Alias "/Video" "E:/Video"
	<Directory "E:/Video">
        	Require all granted
    </Directory>

Now you are just making the movie and video folders availabel to Apache and removing the Noise

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 4 time(s). Last edit at 11/17/2022 03:11PM by RiggsFolly.

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Otomatic (Moderator)
Date: November 17, 2022 03:06PM

Excuse me, the second Alias to remove is the first Alias /Video "E:/Video"

 <Directory  "D:/wamp64/www/example/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require all granted
  </Directory>

is already defined at the beginning of the VirtualHost; it should not be repeated multiple times.

A <Directory .....>....</Directory> structure applies to the entire Virtualhost and has no specific relationship to the Alias that precedes it.

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

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Dragos (---.workpage.ro)
Date: November 17, 2022 04:12PM

The 2 notifications remained after the changes made in both vhost and ssl....they are present in the php error log..I will wait for version 3.3.0...When do you expect it to be published?
Thank you very much.

===========================
thank you,
Dragos
===========================
I use:
windows 10 x64 bit
wampserver 3.3.6 (64bit)
php 8.3.9
mysql 9.0.1
phpmyadmin 5.2.1
apache 2.4.62
MariaDB 11.4.2

Options: ReplyQuote
Re: wampserver.lib.php error
Posted by: Otomatic (Moderator)
Date: November 17, 2022 04:24PM

> I will wait for version 3.3.0...When do you expect it to be published?

A little after the official release of PHP 8.2.0

It's nothing, it's just that it clutters php_error.log and it's a file I want to see always empty, except when I'm tweaking!

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.