Php error: check_virtualhost($check_files_only = *uninitialized*)
Posted by: Dragos (---.workpage.ro)
Date: September 20, 2023 08:05AM

Hello...in the list of php errors I repeatedly record the following 2 errors:

Stack trace:
[20-Sep-2023 08:39:45 Europe/Bucharest] PHP 1. {main}() D:\wamp64\scripts\refresh.php:0
[20-Sep-2023 08:39:45 Europe/Bucharest] PHP 2. check_virtualhost($check_files_only = *uninitialized*) D:\wamp64\scripts\refresh.php:250
[20-Sep-2023 08:39:46 Europe/Bucharest] PHP Notice: Undefined index: ServerName in D:\wamp64\scripts\wampserver.lib.php on line 801

[20-Sep-2023 08:39:46 Europe/Bucharest] PHP Stack trace:
[20-Sep-2023 08:39:46 Europe/Bucharest] PHP 1. {main}() D:\wamp64\scripts\refresh.php:0
[20-Sep-2023 08:39:46 Europe/Bucharest] PHP 2. check_virtualhost($check_files_only = *uninitialized*) D:\wamp64\scripts\refresh.php:2288
[20-Sep-2023 08:39:46 Europe/Bucharest] PHP Notice: Undefined index: DocumentRoot in D:\wamp64\scripts\wampserver.lib.php on line 802.

These 2 errors do not visibly affect my server, but they exist and I would like to know if they can be solved somehow.
I mention that the only problem I have with the server is that after a few days the server icon (green) becomes inactive and in order to access the server I have to stop the Aestran service from the task manager and restart the server. Thank you.
PS: I checked the existence of all the vc++ packages and nothing is missing and the configuration is the one in the signature.

===========================
thank you,
Dragos
===========================
I use:
windows 11 x64 bit
wampserver 3.3.1 (64bit)
php 8.2.2
mysql 8.1.0
phpmyadmin 5.2.1
apache 2.4.58
MariaDB 11.1.2

Options: ReplyQuote
Re: Php error: check_virtualhost($check_files_only = *uninitialized*)
Posted by: Otomatic (Moderator)
Date: September 20, 2023 09:11AM

Hi,

These are just warnings that are of no consequence.

Could you please post the contents of your httpd-vhosts.conf file here?

Thank you.

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

Options: ReplyQuote
Re: Php error: check_virtualhost($check_files_only = *uninitialized*)
Posted by: Dragos (---.workpage.ro)
Date: September 21, 2023 07:21AM

# 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 workpage.ro
ServerAlias www.workpage.ro
Redirect / [workpage.ro]
DocumentRoot "d:/wamp64/www/workpage"
<Directory "d:/wamp64/www/workpage/">
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:/Filme"
<Directory "D:/Filme/">
Require all granted
</Directory>

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


#
<VirtualHost *:80>
ServerName alex.workpage.ro
DocumentRoot "d:/wamp64/www/alex"
<Directory "d:/wamp64/www/alex/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


#
<VirtualHost *:80>
ServerName clanulsfinx.workpage.ro
DocumentRoot "d:/wamp64/www/clanulsfinx"
<Directory "d:/wamp64/www/clanulsfinx/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName apicultoriincepatori.workpage.ro
DocumentRoot "d:/wamp64/www/forum/phpBB3"
<Directory "d:/wamp64/www/forum/phpBB3/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName test.workpage.ro
DocumentRoot "d:/wamp64/www/test"
<Directory "d:/wamp64/www/test/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
Alias "/Filme" "D:/Filme"
<Directory "D:/Filme/">
Require all granted
</Directory>

Alias "/Video" "E:/Video"
<Directory "E:/Video/">
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName surpriza.workpage.ro
DocumentRoot "d:/wamp64/www/surpriza"
<Directory "d:/wamp64/www/surpriza/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#

===========================
thank you,
Dragos
===========================
I use:
windows 11 x64 bit
wampserver 3.3.1 (64bit)
php 8.2.2
mysql 8.1.0
phpmyadmin 5.2.1
apache 2.4.58
MariaDB 11.1.2

Options: ReplyQuote
Re: Php error: check_virtualhost($check_files_only = *uninitialized*)
Posted by: Otomatic (Moderator)
Date: September 21, 2023 08:55AM

Hi,

I think the problem lies in the fact that there is more than one <Directory>...</Directory> structure in a <VirtualHost...>...</VirtualHost> structure.
Of course, this is perfectly allowed by Apache, but it's impossible to check all the possibilities in the httpd-vhosts.conf file and Wampserver sticks to a basic check.

To avoid these warnings, I can only advise you to use include's for non-standard Wampserver parts.

For example, put :
Alias "/Film" "D:/Film"
<Directory "D:/Filme/">
Require all granted
</Directory>
in a file in the same folder as httpd-vhosts.conf, for example alias_filme.conf then, instead put a line
include alias_filme.conf

Do the same for the /Video alias and any others.

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

Options: ReplyQuote
Re: Php error: check_virtualhost($check_files_only = *uninitialized*)
Posted by: Dragos (---.workpage.ro)
Date: September 22, 2023 05:01PM

Initially it didn't work but I saw that it couldn't find the 2 files in the apache directory and then I moved them from the one where httpd-vhost.conf was to the apache base one and it worked perfectly. I did the same in the httpd-ssl.conf file. Thank you very much !!! Have an excellent weekend!!!!

===========================
thank you,
Dragos
===========================
I use:
windows 11 x64 bit
wampserver 3.3.1 (64bit)
php 8.2.2
mysql 8.1.0
phpmyadmin 5.2.1
apache 2.4.58
MariaDB 11.1.2

Options: ReplyQuote


Sorry, only registered users may post in this forum.