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.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.1.11/7.0.25/5.6.32 - MySQL 5.7.20 - MariaDB 10.2.9
PhPMyAdmin 4.7.5 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.