Re: 5.2.9 changes - phpwiki

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Charles Sprickman wrote:
On Mon, 30 Mar 2009, Michael A. Peters wrote:

Charles Sprickman wrote:
Hello all,

Recently I upgraded a box running phpwiki from php 5.2.8 to 5.2.9. After the upgrade, phpwiki (1.3.14) started spitting out the following two errors, both of which are basically leaving the wiki dead in the water:

[30-Mar-2009 22:01:23] PHP Parse error: syntax error, unexpected T_CLONE, expecting T_STRING in /usr/local/www/data/wikisvn/lib/config.php(500) : eval()'d code on line 2 [30-Mar-2009 22:01:23] PHP Fatal error: Class 'WikiDB_backend_PearDB_PearDB' not found in /usr/local/www/data/wikisvn/lib/WikiDB/SQL.php on line 25



first error is in this block:

/**
 * safe php4 definition for clone.
 * php5 copies objects by reference, but we need to clone "deep copy" in
   some places.
 * (BlockParser)
 * We need to eval it as workaround for the php5 parser.
 * See http://www.acko.net/node/54
 */
if (!check_php_version(5)) {
    eval('
    function clone($object) {
      return $object;
    }
    ');
}

I know nothing about phpwiki - but it looks like check_php_version() is a function they have defined?

Because reading the code, if check_php_version(5) is support to return true for php 5 then the eval should only be triggered if the version of php is not 5 - in which case, where phpwiki is broken is in the check_php_version() function.

What happens when you run

<?php
if (check_php_version(5)) {
  echo "php 5";
  } else {
  echo "not php 5";
  }
?>

of course you'll need to copy their check_php version() function into your page.

Well, I fixed it...  Two things:

-Since I'm running php5 and I know it, I removed the version check above. That got me past one error. -Next I started getting bizarre errors everywher preg_match() was called. That stumped me for a bit then I found that between 5.2.8 and 5.2.9 my saved compile options changed and I had NOT used the built-in PCRE library. Switching to the built-in one fixed the preg_match() errors, which in turn let config.php build the right path to the PEAR includes...

Thanks!

I have to wonder if the preg_match issue is what broke their check_php_version() function causing it to return false when it should have returned true.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux