Menu

php 5.1.2 compatibility with hash in phpWiki

Help
2006-01-27
2012-10-11
  • tedwilliams

    tedwilliams - 2006-01-27

    I am running phpWiki 1.3.11p1 via my university account. Everything has been working fine on php 4.x for several months. The school is upgrading to php 5.1.2 next weekend. My installation is failing on their test system and generating the following error.

    Fatal error: Cannot redeclare hash()in /nfs/chernobyl/u1/w/williate/public_html/p1wiki/lib/stdlib.php* on line 1612

    I was informed that version 5.1.2 introduced the Hash extension, which is causing the incompatibility. Has anyone else encountered this problem? Are there any quick work arounds until fix is released?

    I am fairly windows savy and have some professional programming experience, but I don't know much about Apache/UNIX/PHP. I can probably manage to gather any requested information.

     
    • Walter Rafelsberger

      I had the same issue.

      Deleting the hash-function in /lib/stdlib.php brought my wiki back up. I did no further testing yet, so far reading the wiki seams to work at least.

       
    • qwerty2

      qwerty2 - 2006-02-19

      Deleting hash function from /lib/stdlib.php produces warnings:

      lib/main.php:1213: Warning: hash() expects at least 2 parameters, 1 given

      lib/main.php:1214: Warning: hash() expects at least 2 parameters, 1 given

      I tried to add "md5" into hash function, but new warnings appear:

      lib/main.php:1213: Warning: hash() expects parameter 2 to be string, array given

      lib/main.php:1214: Warning: hash() expects parameter 2 to be string, array given

      1) Any idea how to fix the warning?
      2) Is it possible to disable warnings? (How?)

       
      • Reini Urban

        Reini Urban - 2006-02-19

        Please rename all function calls to hash()
        and the hash definition itself from hash to wikihash.

        lib/stdlib.php:1591 (just the definition)
        lib/main.php:1229 + 1230
        lib/plugin/RateIt.php:217 + 234
        lib/Request.php:1159

        I'll prepare a patch and new 1.3.11p2 package today, because 1.3.12 will need more time to fix all link issues, which came up with introducing semantic relations.

         
    • qwerty2

      qwerty2 - 2006-02-21

      In lib/WikiUserNew.php there is another declaration of hash():

      function hash () {
      return hash($this->_prefs);
      }

      Please, include fix for this file as well

       
      • Reini Urban

        Reini Urban - 2006-02-21

        yes, already done.
        Please see phpwiki-1.3.12_rc1.tar.bz2 in the download area.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.