preg_match warning in config?

70 views
Skip to first unread message

Peter

unread,
Jan 7, 2012, 2:53:39 PM1/7/12
to Simple PHP Framework
I have the following setting:

private $localServers = array('localhost');

And get the warning below on a default setup:

Warning: preg_match() [function.preg-match]: Delimiter must not be
alphanumeric or backslash in C:\xampp\htdocs\booking\includes
\class.config.php on line 174
Where am I?

You need to setup your server names in class.config.php

$_SERVER['HTTP_HOST'] reported localhost

Kiran Aghor

unread,
Jan 8, 2012, 2:25:11 AM1/8/12
to simple-php...@googlegroups.com
did u try using - array('/localhost/');

 


--
You received this message because you are subscribed to the Google Groups "Simple PHP Framework" group.
To post to this group, send email to simple-php...@googlegroups.com.
To unsubscribe from this group, send email to simple-php-frame...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-php-framework?hl=en.




--
--Kiran

Tyler Hall

unread,
Jan 8, 2012, 9:38:08 PM1/8/12
to simple-php...@googlegroups.com
I believe this was already answered, but to reiterate, the server name arrays take regular expressions - not plain strings. So you'll need to format them as such. For example:

private $localServers = array('/localhost/');

Tyler

Kristian Tørning

unread,
Jan 9, 2012, 3:18:14 AM1/9/12
to simple-php...@googlegroups.com

Kind regards

Kristian
--
Kristian Stoffregen Tørning | Always:(+45) 20 15 36 47 | toer...@gmail.com

Reply all
Reply to author
Forward
0 new messages