| Author |
Message |
whitevamp
MD user level 1


Joined: Nov 21, 2004
Posts: 11
Member
|
 Posted:
Dec 29, 2004 - 01:46 PM |
|
| Post subject: Call to undefined function: preg_match_all() |
i had an older ver of php install so I upgraded to PHP Version 4.3.10
and now when i try to got to my site i get a blank page ,so I looked in the logs to see what was there and this is what i found
[Tue Dec 28 17:15:18 2004] [error] PHP Fatal error: Call to undefined function: preg_match_all() in /usr/local/www/data/includes/classes/phpSniff.core.php on line 366
and heres the entire section of 366
--> indicates line 366
function _get_browser_info ()^M
{ $this->_build_regex();^M
--->if(preg_match_all($this->_browser_regex,$this->_browser_info['ua'] ,$results))^M
{ // get the position of the last browser found^M
$count = count($results[0])-1;^M
// if we're allowing masquerading, revert to the next to last browser found^M
// if possible, otherwise stay put^M
if($this->_allow_masquerading && $count > 0) $count--;^M
// insert findings into the container^M
$this->_set_browser('browser',$this->_get_short_name($results[1][$coun t]));^M
$this->_set_browser('long_name',$results[1][$count]);^M
$this->_set_browser('maj_ver',$results[2][$count]);^M
// parse the minor version string and look for alpha chars^M
preg_match('/([.\0-9]+)?([\.a-z0-9]+)?/i',$results[3][$count],$match); ^M
if(isset($match[1])) {^M
$this->_set_browser('min_ver',$match[1]);^M
} else {^M
$this->_set_browser('min_ver','.0');^M
}^M
if(isset($match[2])) $this->_set_browser('letter_ver',$match[2]);^M
// insert findings into container^M
$this->_set_browser('version',$this->_browser_info['maj_ver'].$this->p roperty('min_ver'));^M
}^M
}^M
^M
im useing MD-Pro 1.0.71 final release
and thanks inadvance for any help on this issue |
|
|
|
 |
PeteBest
MD user level 5


Joined: Oct 06, 2003
Posts: 4845
bannato
|
 Posted:
Dec 29, 2004 - 10:47 PM |
|
|
Have you upgraded to the latest version of Zend Optimizer, as is stated on the php Download page |
_________________ Retired from official MAXdev duties |
|
|
 |
whitevamp
MD user level 1


Joined: Nov 21, 2004
Posts: 11
bannato
|
 Posted:
Dec 30, 2004 - 07:03 AM |
|
|
umm this is on a freebsd box and i used the ports system to upgrade php, so no i didnt , i didnt even know about abut a incompatabilty .. and i didnt have zend installed before..
but ill get it and install it ... |
|
|
|
 |
whitevamp
MD user level 1


Joined: Nov 21, 2004
Posts: 11
bannato
|
 Posted:
Dec 30, 2004 - 07:12 AM |
|
|
i just installed zend-optimizer and still same error in the log files. |
|
|
|
 |
PeteBest
MD user level 5


Joined: Oct 06, 2003
Posts: 4845
bannato
|
 Posted:
Dec 30, 2004 - 07:22 AM |
|
|
Odd, as far as I'm aware there haven't been any changes made to php in 4.3.10 that have made preg_match_all redundant. I'd re-check your php upgrade, as there are already lots of users with MD-Pro on 4.3.10 without any problems
If you get really desperate you could hack out that function, it's only there for language detection. Even if this does resolve your problem, think it'd only be masking the real issue though |
_________________ Retired from official MAXdev duties |
|
|
 |
AbraCadaver
MD Staff


Joined: Aug 04, 2003
Posts: 137
Location: Katy, Texas USA
bannato
|
 Posted:
Dec 30, 2004 - 04:11 PM |
|
|
PHP has to be compiled with the PCRE library. It would be strange if it wasn't but you never know. Look at the phpinfo() output and see if it has --without-pcre-regex as a flag in the Configure Command section.
-Shawn |
|
|
|
 |
whitevamp
MD user level 1


Joined: Nov 21, 2004
Posts: 11
bannato
|
 Posted:
Dec 31, 2004 - 12:19 PM |
|
|
| AbraCadaver wrote: |
PHP has to be compiled with the PCRE library. It would be strange if it wasn't but you never know. Look at the phpinfo() output and see if it has --without-pcre-regex as a flag in the Configure Command section.
-Shawn |
i dont see any thing like that ..
heres what i do see ..
Configure Command './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--with-regex=php' '--with-apxs=/usr/local/sbin/apxs' '--disable-ipv6' '--prefix=/usr/local' 'i386-portbld-freebsd5.3'
and i have unistalled both apache and php and reinstalled them both and i still get that error in my log files..
and i have checked the php.ini to see if safe mode is off and it is .. |
|
|
|
 |
AbraCadaver
MD Staff


Joined: Aug 04, 2003
Posts: 137
Location: Katy, Texas USA
bannato
|
 Posted:
Dec 31, 2004 - 02:05 PM |
|
|
That's about all that it could be. Look in the phpinfo() page again and look for a section titled pcre that has a table that says something like this:
PCRE (Perl Compatible Regular Expressions) Support | enabled
PCRE Library Version | 4.5 01-December-2003
If not, then you need to re-compile PHP and check the docs to see how to make sure that PCRE gets compiled in. That's my only thought.
-Shawn |
|
|
|
 |
whitevamp
MD user level 1


Joined: Nov 21, 2004
Posts: 11
bannato
|
 Posted:
Dec 31, 2004 - 10:24 PM |
|
|
welp by looking through the ports dir i never had pcre installed befor . the update to apache and php i just installed it and still samething .. |
|
|
|
 |
whitevamp
MD user level 1


Joined: Nov 21, 2004
Posts: 11
bannato
|
 Posted:
Jan 09, 2005 - 05:53 PM |
|
|
just whanted to post back and let every one know that i have solved this issue..
but to me its kinda weard that i had this all working fine till i upgraded php and apache then it stoped working and i had to install all these extra modules that i didnt have installed before.. any ways im venting..
thx for all the help on this issue |
|
|
|
 |
AbraCadaver
MD Staff


Joined: Aug 04, 2003
Posts: 137
Location: Katy, Texas USA
bannato
|
 Posted:
Jan 12, 2005 - 04:13 AM |
|
|
| whitevamp wrote: |
just whanted to post back and let every one know that i have solved this issue..
but to me its kinda weard that i had this all working fine till i upgraded php and apache then it stoped working and i had to install all these extra modules that i didnt have installed before.. any ways im venting..
thx for all the help on this issue |
The problem is the way that PHP was compiled. When you get it from a package manager/ports collection you get what was compiled by someone else.
If they compile in all of the common modules then you are good. If not then you may have to load them.
-Shawn |
|
|
|
 |
techlwcs
MD NewNew


Joined: Jan 14, 2005
Posts: 1
bannato
|
 Posted:
Jan 14, 2005 - 09:41 AM |
|
|
So how did you end up fixing it. I think I may be having a similar problem... |
|
|
|
 |
nacredata
MD NewNew

Joined: Nov 17, 2007
Posts: 2
bannato
|
 Posted:
Nov 17, 2007 - 02:38 PM |
|
|
Sumary: Ran into this problem with php server 4.4.7 from FreeBSD 6.2 ports. Adding --with-pcre-regex=yes to the end of the configure script worked.
Actions taken:
download, extract php into new directory (/usr/local/src).
| Code:
|
./configure \
--enable-versioning \
--with-layout=GNU \
--with-config-file-scan-dir=/usr/local/etc/php \
--disable-all \
--program-prefix= \
--with-apxs=/usr/local/sbin/apxs \
--with-zlib=/usr \
--disable-ipv6 \
--prefix=/usr/local \
--mandir=/usr/local/man \
--infodir=/usr/local/info/ \
--with-pcre-regex=yes
make
make install
/usr/local/sbin/apachectl stop ; sleep 2 ; /usr/local/sbin/apachectl start ;
|
|
|
|
|
 |
nacredata
MD NewNew

Joined: Nov 17, 2007
Posts: 2
bannato
|
 Posted:
Nov 17, 2007 - 02:56 PM |
|
|
actually, ditch --disable-all \ |
|
|
|
 |
|
|