bug with domain name creation
Posted by: trevorwood (---.8-2.cable.virginm.net)
Date: September 05, 2017 12:55PM

Hi
I'm new to WAMP so this may be a known issue
I'm trying to add a virtual host on my test server called z-to-a and I'm told it is invalid - The ServerName z-to-a is invalid.

So I created ztoa and then edited the hosts and vhosts file and changed it all to z-to-a

restarted DNS

WAMP shows a red stop sign next to z-to-a in the "Your Virtual hosts" list

When I click on z-to-a a command window opens up saying
The ServerName 'z-to-a' has a syntax error
characters accepted [a-zA-Z0-9.-]
Only letter or number at the beginning and the end
. or - character neither at the beginning nor the at the end
. or - characters are not followed by . or -

z-to-a fulfils all this

when I open my web browser and enter z-to-a the site shows perfectly

Is this a bug in php5.6.25? If so how can I update PHP in WAMP?

Options: ReplyQuote
Re: bug with domain name creation
Posted by: Otomatic (Moderator)
Date: September 05, 2017 02:41PM

Hi,

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

> Is this a bug in php5.6.25?
No, in Wampserver scripts.

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

Options: ReplyQuote
Re: bug with domain name creation
Posted by: Otomatic (Moderator)
Date: September 05, 2017 03:09PM

Hi,

In wamp/scripts/wampserver.lib.php you may replace :
    //Validity of ServerName (Like domain name)
    //   /^[A-Za-z]+([A-Za-z0-9][-.](?![-.])|[A-Za-z0-9]){1,60}[A-Za-z0-9]$/
    if(preg_match('/^
      [A-Za-z]+       # letter in first place
      ([A-Za-z0-9]    # letter or number
      [-.](?![-.])    #  a . or - not followed by . or -
            |         #   or
      [A-Za-z0-9]     #  a letter or a number
      ){1,60}         # this, repeated from 1 to 60 times
      [A-Za-z0-9]     # letter or number at the end
      $/x',$value) == 0 && $wampConf['NotCheckVirtualHost'] == 'off') {
      $virtualHost['ServerNameValid'][$value] = false;
    }
by
    //Validity of ServerName (Like domain name)
    //   /^[A-Za-z]+([-.](?![-.])|[A-Za-z0-9]){1,60}[A-Za-z0-9]$/
    if(preg_match('/^
      [A-Za-z]+       # letter in first place
      ([-.](?![-.])   #  a . or - not followed by . or -
            |         #   or
      [A-Za-z0-9]     #  a letter or a number
      ){1,60}         # this, repeated from 1 to 60 times
      [A-Za-z0-9]     # letter or number at the end
      $/x',$value) == 0 && $wampConf['NotCheckVirtualHost'] == 'off') {
      $virtualHost['ServerNameValid'][$value] = false;
    }
Will be in wampserver 3.1.1 update

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.