When I try to ad a virtual host in wamp I get several PHP errors and wonder what I can do to correct this. I'm running Windows 11. Here's the Error Messages.
( ! ) Warning: fopen(C:/WINDOWS/system32/drivers/etc/hosts): failed to open stream: Resource temporarily unavailable in C:\wamp64\www\add_vhost.php on line 429
Call Stack
# Time Memory Function Location
1 0.0001 373424 {main}( ) ...\add_vhost.php:0
2 0.0610 457176 fopen( $filename = 'C:/WINDOWS/system32/drivers/etc/hosts', $mode = 'a+b' ) ...\add_vhost.php:429
( ! ) Warning: fwrite() expects parameter 1 to be resource, bool given in C:\wamp64\www\add_vhost.php on line 432
Call Stack
# Time Memory Function Location
1 0.0001 373424 {main}( ) ...\add_vhost.php:0
2 0.1008 457792 fwrite( $fp = FALSE, $str = '\r\n127.0.0.1\tsitetest\r\n::1\tsitetest\r\n' ) ...\add_vhost.php:432
( ! ) Warning: fclose() expects parameter 1 to be resource, bool given in C:\wamp64\www\add_vhost.php on line 434
Call Stack
# Time Memory Function Location
1 0.0001 373424 {main}( ) ...\add_vhost.php:0
2 0.1015 457376 fclose( $fp = FALSE )
...\add_vhost.php:434
( ! ) Notice: Undefined variable: fp2w in C:\wamp64\www\add_vhost.php on line 435
Call Stack
# Time Memory Function Location
1 0.0001 373424 {main}( ) ...\add_vhost.php:0