Impossible to add a virtual host on a Wampserver 3.2.0 – 64 bits
Posted by: pbopbopbo (---.rev.numericable.fr)
Date: April 21, 2020 10:18PM

Good evening

I'm running WAMP Server 3.2.0 (64bit) and I am experiencing errors when I try to add virtual hosts.

When I try to create a new virtual host I get the 3 errors which are indicated in point 10 further 10.

I have tried many things to solve that issue and tried to find solutions on the net, but I have not been able to solve my problem.
I have tried to reinstall again WAMP following all the instructions in your installation guidelines, but it did not change anything.

So I contact you to see if you could help me solve my problem.
Here are all the answers to your questions to help you find a possible solution.

1 - Windows version used (Specify version number AND whether 32 or 64 bit)

-> Windows NT 10.0 build 17763 (Windows 10) AMD64
-> Windows 10 Professional – version 1809
-> Build Date Nov 19 2019 13:50:18
-> Compiler MSVC15 (Visual C++ 2017)
->Architecture x64 bits

2 - Version WampServer (Specify version number AND whether 32 or 64 bit)

WAMP Server 3.2.0 (64bit)
installed from file wampserver3.2.0_x64.exe downloaded from [sourceforge.net]

3 - Apache Version

2.4.41, as delivered in the WAMP file I installed from

4 - PHP Version

7.3.12, as delivered in teh WAMP file I installed from

5 - MySQL Version

5.7.28, as delivered in WAMP file I installed from

5a - MariaDB version if applicable
10.4.10, as delivered in WAMP file I installed from

6 - What color is the WampServer icon (in the notification area of the taskbar)
GREEN
The 3 services are running

7 - In the file c:\Windows\System32\drivers\etc\hosts, what are the active lines?
* Active means no # at the beginning of the line.

There are no "active" lines, all are comments, i.e., all begin with #.

I have tried to modify this file but I cannot save it.
I have opened the Windows textEditor as an administrator and tried to modify from there but I cannot save it.
When I try to save it, I am told "The process cannot access the file because it is being used another process."
I have tried to copy the file into my destop and I have been able to modify it there.
But then it is impossible to copy it back into c:\Windows\System32\drivers\etc\

In the properties of the files it says that
- I am the administrator
- I have all the right to read, modify the file but in reality I cannot save it after I modify it.

In other words, I can open and edit the hosts file to insert the needed lines, but I cannot save the changes.
I'm using either Visual Studio Code or the simple Windows Text Editor to edit the hosts file. Even if I run it as the administrator, I cannot save the file.


8 - Do you have access to localhost (Homepage WampServer)?
YES
I am able to create files in the www.
And I can read the files I have created using Chrome Navigator through the Apache Server.

8a - If so, is there an error message at the bottom of the page?

No

9 - Do you have access to phpMyAdmin?

Yes - I am able to create databases and modify them.

10 - If you refer to an error message, please include the EXACT wording of the error in your post

It seems that everything is working OK except when I try to ad a new virtual host.

Here are the 3 error messages I have


! ) Warning: fopen(C:/WINDOWS/system32/drivers/etc/hosts): failed to open stream: Resource temporarily unavailable in C:\wamp64\www\add_vhost.php on line 472
Call Stack
# Time Memory Function Location
1 0.0009 417984 {main}( ) ...\add_vhost.php:0
2 0.0120 497424 fopen ( )
...\add_vhost.php:472


( ! ) Warning: fwrite() expects parameter 1 to be resource, bool given in C:\wamp64\www\add_vhost.php on line 473
Call Stack
# Time Memory Function Location
1 0.0009 417984 {main}( ) ...\add_vhost.php:0
2 0.0409 498040 fwrite ( )
...\add_vhost.php:473


( ! ) Warning: fclose() expects parameter 1 to be resource, bool given in C:\wamp64\www\add_vhost.php on line 510
Call Stack
# Time Memory Function Location
1 0.0009 417984 {main}( ) ...\add_vhost.php:0
2 0.0663 497800 fclose ( )
...\add_vhost.php:510



11 - If you use an Antivirus and / or Firewall, please include the names of these

I use Windows Defender as well as ZoneAlarm Antivirus from time to time.
During normal use of the PC, ZoneAlarm is used only for the firewall.

When I tried to add virtual hosts, I have desactivated all firewall systems and all antivirus systems and the 3 error messages are the same.
So I do not believe that my problem is due to the antivirus / firewalls.
Otherwise, desactivating them would solve my issue!

12 - What is the full path to the installation of WampServer (eg D:\wamp\)

c:/wamp64

13 - If you have one or more Virtual Hosts defined, please show their definition(s)

Here is the Content of httpd-vhosts.conf
Located here C:\wamp64\bin\apache\apache2.4.41\conf\extra\

# Virtual Hosts
#
<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 pbophpintro
DocumentRoot "c:/wamp64/www/coursphp/phpintro"
<Directory "c:/wamp64/www/coursphp/phpintro/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

Summary of my problem:

When I try to add a virtual host,
- I have the 3 error messages as indicated in point 10 above.
- but in the list Your virtual hosts , pbophpintro Virtual host appears.
But I cannot access to it.
- and when I look in the file hosts located here
C:/Windows/system32/drivers/etc/hosts
pbophpintro is not mentioned anywhere.


Many thanks in advance for all help you could provide me.

Philippe

Options: ReplyQuote
Re: Impossible to add a virtual host on a Wampserver 3.2.0 – 64 bits
Posted by: Otomatic (Moderator)
Date: April 22, 2020 09:14AM

Hi,

Your file C:\Windows\System32\drivers\etc\hosts is protected and/or locked and/or access denied and it is impossible to open it, let alone write to it, which prevents the creation of VirtualHosts.

See item 09 of TROUBLESHOOTING TIPS

> Otherwise, desactivating them would solve my issue!
Disabling anti-virus and anti-thing does not presage the unlocking of access to certain files or folders.

Comme vous avez comme "ip origine" 85-168-185-246.rev.numericable.fr, je pense que vous comprenez le français, auquel cas, il eut été préférable d'utiliser le forum francophone.
Pour obtenir les droits de modification et d'écriture sur le fichier hosts, voir l'item 09 et Note 2 (Qui n'existe pas dans le document en Anglais) de CONSEILS DE DÉPANNAGE

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



Edited 2 time(s). Last edit at 04/22/2020 10:17AM by Otomatic.

Options: ReplyQuote
Re: Impossible to add a virtual host on a Wampserver 3.2.0 – 64 bits
Posted by: pbopbopbo (---.rev.numericable.fr)
Date: April 27, 2020 08:36PM

Bonsoir

Je vous remercie beaucoup de votre réponse très rapide.

Effectivement, comme mon IP l'indique, je suis français et si j'ai utilisé le forum en anglais, c'est parce que plusieurs formateurs de la formation de concepteur développeur d'application que je suis en train de suivre nous ont indiqué qu'il était préférable de chercher d'abord sur les forums en anglais car il y avait souvent beaucoup plus de réponses que sur les forums en français...

Le forum français de WampServeur est donc une bonne preuve qu'il est aussi important pour nous francophones de consulter également les forums francophones autant que les forums en anglais, et cela même pour des logiciels qui ne sont pas francophones à l'origine ... Et c'est donc ce que je ferai à l'avenir !

J'ai donc lu avec attention tous vos conseils et dépannage en français et en particulier les notes concernant le fichier hosts. J'ai respecté à la lettre toutes vos instructions concernant la modification du fichier hosts et ses droits, et effectivement je n'étais pas le propriétaire du fichier.
J'ai tout essayé et même en étant propriétaire du fichier il m'est impossible de le modifier et j'ai toujours le même message d'erreur.
J'ai essayé toutes les possibilités de modification de contrôle et de droit et malheureusement sans succès.
Je suis également comme vous convaincu qu'il s'agit d'un problème de droits sur ce fichier hosts, mais je n'arrive pas à trouver de solution pour obtenir un contrôle total sur ce fichier même lorsque je suis propriétaire du fichier.

J'ai également essayé avec plusieurs éditeurs de texte, y compris Visual Studio Code, y compris NotePad++ que vous recommandez, et je les ai également utilisés en tant qu'administrateur, mais malheureusement cela n'a pas non plus solutionné mon problème.

Bref, je ne sais vraiment pas comment solutionner mon problème car je n'arrive absolument pas à modifier ce fichier host, malgré toutes mes tentatives différentes…

Auriez-vous une autre solution à me proposer et avez-vous déjà été confronté à ce même problème d’impossibilité de modifier le fichier host avec un autre utilisateur ?

Merci beaucoup d'avance de toute votre aide.

Bien cordialement

Options: ReplyQuote
Re: Impossible to add a virtual host on a Wampserver 3.2.0 – 64 bits
Posted by: Otomatic (Moderator)
Date: April 27, 2020 08:56PM

Bonjour,

Quote
pbopbopbo
Le forum français de WampServeur est donc une bonne preuve qu'il est aussi important pour nous francophones de consulter également les forums francophones autant que les forums en anglais, et cela même pour des logiciels qui ne sont pas francophones à l'origine ... Et c'est donc ce que je ferai à l'avenir !
Et pourtant, tout en haut du menu Wampmanager, il est noté : Made in France by Otomatic.

Pour le moment, je n'ai pas d'autre solutions que celles qui sont préconisées en Note 2 de Conseils de Dépannage.

Pourriez-vous ouvrir une nouvelle discussion sur le forum Francophone ?, je vais clore celle-ci.
Forum Francophone -> [forum.wampserver.com]

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

Options: ReplyQuote
Re: Impossible to add a virtual host on a Wampserver 3.2.0 – 64 bits
Posted by: pbopbopbo (---.rev.numericable.fr)
Date: April 28, 2020 10:20AM

Bonjour


je suis désolé mais sur mon WampManager , je n'avais pas vu dans le menu Made in France by Otomatic !

D'autre part, le site [www.wampserver.com] n'est pas accessible depuis plus d'une semaine...

J'ai découvert Wampserver dans le cadre d'une formation et nous n'avons pas eu beaucoup de détails...

Nous avons téléchargé le logiciel sur SourceForge sur une page en anglais... alors je pensais à tort que le logiciel était d'origine GB... Désolé de cette confusion... Je suis donc content de découvrir que c'est du made in France...

Est-il nécessaire d'ouvrir une discussion dans le forum francophone puisque malheureusement, il ne semble pas y avoir de solution .... ?

Options: ReplyQuote
Re: Impossible to add a virtual host on a Wampserver 3.2.0 – 64 bits
Posted by: Otomatic (Moderator)
Date: April 28, 2020 12:06PM

Bonjour,

> D'autre part, le site [www.wampserver.com] n'est pas accessible depuis plus d'une semaine...
On s'en fout un peu (En cours de transfert sur un autre serveur, ce n'est pas de mon ressort...)
Tout est là :
- Anglais : WAMPserver 3 - All you need to know
- Français : WAMPserver 3 - Tout ce que vous devez savoir

Et, tous les fichiers et addons sont là : http://wampserver.aviatechno.net bien mieux organisé que Sourceforge.

Malheureusement, je n'ai pas d'autre “trucs” que la Note 2 pour le fichier hosts.

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.