Menu

PHP Error when attempting to add Web Encyclopedia resource

Help
Nap
2020-07-26
2020-07-28
  • Nap

    Nap - 2020-07-26

    [WikiNDX 6.3.7]

    I'm not sure yet what's causing this PHP problem, but it does not occur under WikiNDX4.
    The attached image contains two separate error messages. The top part shows the initial error, and clicking "OK" makes it go away, whereupon the second error, lower part of image, comes up and requires 7 clicks to go away. After entering all the required data, the entry is saved correctly.

    However, it also appears to me that the displayed fields for a "Web Encyclopedia" resource are incorrect. There should be an accessed date?

    Is this problem related to missing plugins for resource types, or some other non-server reason? In my config.php, I have not excluded any resource types.

    FIXED
    I've fixed this ON MY SYSTEM in the config.php by setting WIKINDX_DB_PERSISTENT to FALSE. However, if you have extension=/your/path/zlib.so in your php.ini, you will get a new error stating zlib is already loaded. My php.ini has zlib commented out and I only use two non-standard MacOS extensions:

    extension=/usr/local/php/gettext.so
    extension=/usr/local/php/zip.so
    #extension=/usr/local/php/zlib.so
    
     

    Last edit: Nap 2020-07-28
    • Stéphane Aulery

      Plugins are not required. You have errors want the app talk to MySQL. What is the version of PHP, MySQL/Mariadb?

       
      • Nap

        Nap - 2020-07-27

        Apache 2.4.43 (Homebrew),, mysql Ver 14.14 Distrib 5.7.20, for macos10.12 (x86_64) using EditLine wrapper,PHP Version 7.3.11.

        Because it was very late in the evening, I haven't tried debugging this yet, and have not even checked the error logs.

         
  • Mark Grimshaw

    Mark Grimshaw - 2020-07-27

    Hi Nap,

    Access date is found under Miscellaneous Details.

    Regards,

    Mark

     

    Last edit: Mark Grimshaw 2020-07-27
  • Nap

    Nap - 2020-07-27

    The problem is directly related to selecting a resource type.
    Everything is fine when I use Resources -> New, which defaults to 'Book'. I can enter all the relevant data, select categories etc., and save.

    However, if I click on any other Resource Type, the error occurs. Because of the error, the page does not refresh with the resource options pertinent to the selected resource type. This explains the reason for my asking about the Access date.

    In my PHP error log I get the following entries, which align with the clicks I mentioned earlier above.

        2020-07-28T01:50:43.418699+10:00 2282 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)
        2020-07-28T01:50:43.424782+10:00 2281 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)
        2020-07-28T01:50:43.430733+10:00 2280 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)
        2020-07-28T01:50:43.435808+10:00 2283 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)
        2020-07-28T01:50:43.441347+10:00 2284 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)
        2020-07-28T01:50:43.446720+10:00 2285 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)
        2020-07-28T01:50:43.452601+10:00 2286 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)
    

    I have all the resource types Active in the Admin -> Configure -> Resources combo box (none deactivated).

     
    • Stéphane Aulery

      The MySQL config is unique and the auth performed once by script in Wikindx. Failing here, is failing everywhere. Check your config.

      And did you have defined read only access in MyQL for this bibmaster user, off chance?

       

      Last edit: Stéphane Aulery 2020-07-27
      • Nap

        Nap - 2020-07-28

        The MySQL config is unique and the auth performed once by script in Wikindx. Failing here, is failing everywhere. Check your config.

        Everything else is working, and I've rechecked my 'config.php', see attached file. I have also tried setting WIKINDX_PATH_AUTO_DETECTION from TRUE to FALSE (and manually setting the URL and PATH). I even modified SQL.php (123 & 2731) to set my password before the call to mysqli_connect.

        And did you have defined read only access in MyQL for this bibmaster user, off chance?

        The WikiNDX user has all privileges on the WikiNDX database except "Grant".

        I've discovered that this problem was introduced when I migrated from 5.1 to 6.08. So resource type selection works with 4.2.2 and 5.1, but doesn't work in 6.0.8, 6.3.4 and 6.3.7.

        I checked this in our fresh (6.3.4) install in our lab, which I showed to Mark, and the problem exists there as well.

         

        Last edit: Nap 2020-07-28
        • Nap

          Nap - 2020-07-28

          I've discovered the culprit in SQL.php. Lines 122 and 2730 cause the error when $dbpers is TRUE (i.e. a persistent connection is to be established). "localhost" is prepended with "p:" becoming "p:localhost".

          This causes the error on both my systems; the one I run at home using the mysql indicated above, and the latest MariaDB in our lab. Removing the "p:" makes the error go away and the page works fine.

          I've fixed it in the config.php by setting WIKINDX_DB_PERSISTENT to FALSE. However, if you have extension=/your/path/zlib.so in your php.ini, you will get a new error stating zlib is already loaded. My php.ini has zlib commented out and I only use two non-standard MacOS extensions:

          extension=/usr/local/php/gettext.so
          extension=/usr/local/php/zip.so
          #extension=/usr/local/php/zlib.so
          
           

          Last edit: Nap 2020-07-28
          • Stéphane Aulery

            PHP applications are not responsible of extension loading. The PHP installation is.

             
          • Stéphane Aulery

            We provide the persistent option but this option should be used in rare case by for very specific configuration of MySQL. Never use it.

             
        • Stéphane Aulery

          If you have intermediary backup you can restart the migration from 5.1 and be sure that all is fine.

           
  • Mark Grimshaw

    Mark Grimshaw - 2020-07-28

    Hi Nap,

    I'll leave Stéphane to answer the question about zlib. I have WIKINDX_DB_PERSISTENT = TRUE on both my localhost development wikindx and two online servers including https://testdrive.wikindx.com/index.php

    Everything works fine changing resource types as you've been trying. Perhaps your issue is somewhere else – security and firewalls or perhaps both your DB servers simply don't like/allow persistent connections?

    Regards,

    Mark

     
    • Stéphane Aulery

      Persistent connection is arcane stuff and should not be used without being experienced. Naf's error is clear. bibmaster user is misconfigured or misused.

      2020-07-28T01:50:43.418699+10:00 2282 [Note] Access denied for user 'bibmaster'@'localhost' (using password: NO)

       
  • Nap

    Nap - 2020-07-28

    If you don't mind, I'm going to park the issue here for now as its working fine in 6.3.7 on both machines.
    Thanks for your help, as usual!! :)

     
    • Stéphane Aulery

      If it works, it's already good.

       

Log in to post a comment.