schilly Posted August 26, 2008 Share Posted August 26, 2008 I'm running into this error on a friend's server: "PHP Fatal error: Call to undefined function preg_match()" I assume preg_match was installed by default. Is there an easy way to check this and/or fix this? PHP v5.2.6 thx. Quote Link to comment Share on other sites More sharing options...
schilly Posted August 26, 2008 Author Share Posted August 26, 2008 Ok ran this: <?php if (function_exists('preg_match')) { echo "preg_match available.<br />\n"; } else { echo "preg_match not available.<br />\n"; } ?> And it said it wasn't available. How do I enable it? Do I have to recompile PHP or is it an ini setting? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 I think the PCRE module is installed by default, so every server should really have it. Is it his personal server or a hosted server? EDIT: I meant "IS installed by default". Wasn't paying attention. Quote Link to comment Share on other sites More sharing options...
schilly Posted August 26, 2008 Author Share Posted August 26, 2008 I believe it's a full control hosted server. Can you tell by the phpinfo() print out? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 I believe it's a full control hosted server. Can you tell by the phpinfo() print out? Yes, please send the full HTML source of the phpinfo() page. Or just show me the output of `php -m`. Quote Link to comment Share on other sites More sharing options...
schilly Posted August 26, 2008 Author Share Posted August 26, 2008 Here is the configuration: './configure' '--prefix=/usr/local/php5' '--with-config-file-scan-dir=/usr/local/php5/etc' '--with-apxs2=/usr/local/apache2/bin/apxs' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection' '--disable-cli' '--disable-cgi' '--enable-zend-multibyte' '--with-regex=system' > php -m date libxml Reflection standard [Zend Modules] > Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 Wow, they actually turned off PCRE? That's SO odd. E-mail them and ask them to add --with-pcre-regex. Quote Link to comment Share on other sites More sharing options...
schilly Posted August 26, 2008 Author Share Posted August 26, 2008 I have full access and probably more knowledge than my friend. Is this an easy fix? I've never done a manual compile of php. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 PHP is pretty easy to install, but it can take a while if it's your first compilation of that version. cd ~/place_where_you_untared_php ./configure --with-pcre-regex #and other stuff! make sudo make install Quote Link to comment Share on other sites More sharing options...
aschk Posted August 26, 2008 Share Posted August 26, 2008 Wow, i loved seeing the '--disable-all' part of that php build string! There's security and then there's paranoia Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 26, 2008 Share Posted August 26, 2008 Wow, i loved seeing the '--disable-all' part of that php build string! There's security and then there's paranoia I know, I loved that part too! I've never seen that option used at all, ever. O_O Good thing you can't disable PCRE in PHP 5.3>. Quote Link to comment Share on other sites More sharing options...
schilly Posted August 26, 2008 Author Share Posted August 26, 2008 Thanks for you help guys. I think I should be good now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.