On my production system i get an error in the symfony router:
Warning: preg_match() [function.preg-match]: Compilation
failed: unmatched parentheses at offset 60 in
/mypath/app/cache/prod/appprodUrlMatcher.php line 205
Whereas on the local machine and on another server it works fine.
I digged in the cache and the pattern for the route is different:
Working on my dev server:
#^/hotels/(?<groupId>[^/\\-]+)\\-(?<groupName>[^\\-]+)$#s
Not working on production:
#^/hotels(?:/(?<groupId>[^/\\-]+)(?:\\-(?<groupName>[^\\-]+))?)?)?$#s
the route is:
hotel:
pattern: /hotels/{groupId}-{groupName}
defaults: { _controller: "MyBundle:Hotel:hotel", requirements:{ groupName: "[a-zA-Z1-9\+\/]+" } }
I read some issues on github that similar errors are possible when using an old PCRE.
https://github.com/symfony/symfony/issues/4093
Mine seems new enough thou: PHP 5.3.6 with PCRE Version 8.11.
I am on Solaris.
The patterns are generated by symfony, right? So, why are the patterns different?
And after all why doesnt it work? Has somebody any clue?
This was not a symfony issue but rather a bug in the PHP 5.3.6 version on this Solaris machine.
The constant INF returned float(0) which blew up the routing.
See more here: php INF has value zero