Welcome, Guest
Username: Password: Remember me

TOPIC: Call to undefined function showadminmenu() in [...]admin.php on line 674

Call to undefined function showadminmenu() in [...]admin.php on line 674 2 years 5 months ago #81915

  • ggrippi
  • ggrippi's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Hello all,

I have been facing a strange issue while installing LimeSurvey on my DEV server.
It was a bit weird as I made a Proof Of Concept on my personnal laptop and did not encounter any issue during that phase...

Problem :
  • Once the PoC was agreed, it was decided to setup a real DEV/TEST environment in order to match validate all our requirements
  • The DEV server is hosted on a linux box and is running with gForge/FusionForge
  • The MySQL Server is on the same box
  • I copied the last LimeSurvey stable package in a dedicated directory on the DEV server
  • I updated the config.php file to match my DEV environment (MySQL user,pwd and DB name)
  • Ready to install ===>>> success ! :laugh:
  • I am prompted to remove the admin/install directory : done
  • Now I am requested to enter the admin user/pwd ===>>> I got a blank page ! :huh:
  • I decided to activate the debug mode in config.php and got now the following error message Fatal error: Call to undefined function showadminmenu() in /var/lib/gforge/chroot/home/groups/limesurvey3033/htdocs/limesurvey/admin/admin.php on line 674

After some investigations, I discovered that the showadminmenu() function called on line 674 of admin.php is defined in html.php located in the same (admin) directory.
The html.php file in loaded in certain contitions (lines 473 and 478) in admin.php.

My first idea is "add a include('html.php'); just before the call to showadminmenu() on line 674 (which becomes now 675 ;) )".
New error message : Fatal error: Cannot redeclare html_feedback_top() (previously declared in /usr/share/gforge/www/include/html.php:30) in /usr/share/gforge/www/include/html.php on line 33

Explanation
So then I understand this :
  1. The html.php file is loaded before the call to showadminmenu()
  2. The html.php file loaded is not the one located in the admin directory but in a default include directory (I assume from FusionForge, Joomla or any other already install tool

SOLUTION
I updated admin.php like follow :
  • Line 472 (not sure it is required but just in case these is an already dined file with the same name)
  • From : include('html_functions.php');
  • To : include(dirname(__FILE__).'/html_functions.php');
  • Line 473
    • From : include('html.php');
    • To : include(dirname(__FILE__).'/html.php');
  • Line 477 (not sure it is required but just in case these is an already dined file with the same name)
    • From : include('html_functions.php');
    • To : include(dirname(__FILE__).'/html_functions.php');
  • Line 478
    • From : include('html.php');
    • To : include(dirname(__FILE__).'/html.php');



    Not sure this needs to be patched to the main code, I let the core team decide.
    I only hope this will help others

    Cheers

    GG.
    The administrator has disabled public write access.

    Re: Call to undefined function showadminmenu() in [...]admin.php on line 674 2 years 5 months ago #81991

    • Mazi
    • Mazi's Avatar
    • OFFLINE
    • LimeSurvey Team
    • Posts: 5423
    • Thank you received: 307
    • Karma: 252
    So this problem only shows up on one of two systems and the proposed solution solves the problem while not causing trouble for the second installation?

    Generally, this is a quite weird behavior. How do the folder names of both systems differ and what path settings did you use at the config.php files?

    Best regards/Beste Grüße,
    Dr. Marcel Minke
    (Limesurvey Head of Support)
    Need Help? We offer professional Limesurvey support
    Contact: marcel.minke(at)limesurvey.org'"
    The administrator has disabled public write access.

    Re: Call to undefined function showadminmenu() in [...]admin.php on line 674 2 years 5 months ago #82027

    • ggrippi
    • ggrippi's Avatar
    • OFFLINE
    • Fresh Lemon
    • Posts: 5
    • Karma: 0
    In fact, my first install was on my personal laptop on a fresh new XAMPP install to check that LimeSurvey matches our needs.
    Once this first test was made and agreed, we decided to move to our DEV/TEST server in order to go further in our testings.
    This DEV server in already used for other projects. It seems that there is an existing "html.php" file from another project located in a default path.
    This file was then open in place of the one located in the "admin" directory.

    I spent several hours (yes, I know... hours... well, I am not a developer... I am a project manager... sorry) trying to find out the PHP file containing the showdminmenu function, why it was not open by admin.php (first thought), trying to force loading it, getting another error message...
    In fact I have lost a lot of time before noticing the path of the html.php file reported when I forced loading it. It indicated the solution !

    By the way, I did not change neither the $rooturl nor $rootdir in the config.php file.

    Do you think I have to update these variables ?
    Last Edit: 2 years 5 months ago by ggrippi. Reason: "plurals"
    The administrator has disabled public write access.

    Re: Call to undefined function showadminmenu() in [...]admin.php on line 674 2 years 5 months ago #82076

    • Mazi
    • Mazi's Avatar
    • OFFLINE
    • LimeSurvey Team
    • Posts: 5423
    • Thank you received: 307
    • Karma: 252
    I sounds like you copied Limesurvey into a (the root) folder where another application is located already.
    I recommend to put all the Limesurvey files into a single folder called "limesurvey", "survey" or the like and then adjust the $rooturl setting at config.php accordingly to avoid such conflicts.

    Best regards/Beste Grüße,
    Dr. Marcel Minke
    (Limesurvey Head of Support)
    Need Help? We offer professional Limesurvey support
    Contact: marcel.minke(at)limesurvey.org'"
    The administrator has disabled public write access.

    Re: Call to undefined function showadminmenu() in [...]admin.php on line 674 2 years 5 months ago #82084

    • ggrippi
    • ggrippi's Avatar
    • OFFLINE
    • Fresh Lemon
    • Posts: 5
    • Karma: 0
    Listen, this is a shared DEV server managed with gForge (FusionForge)
    For my project, I have a dedicated HTDOCS directory where I created a "limeservey" directory and placed in it all limesurvey structure.
    /var/lib/gforge/chroot/home/groups/limesurvey3033/htdocs/limesurvey

    It appears that gForge maintains a default "include" directory, in which exist another HTML.PHP from another project...
    /usr/share/gforge/www/include/

    this one was loaded instead of the one in the admin directory.

    Thanks anyway for you help
    The administrator has disabled public write access.

    Re: Call to undefined function showadminmenu() in [...]admin.php on line 674 2 years 5 months ago #82146

    • Mazi
    • Mazi's Avatar
    • OFFLINE
    • LimeSurvey Team
    • Posts: 5423
    • Thank you received: 307
    • Karma: 252
    Thanks for your feedback.

    ...not a Limesurvey problem.

    Best regards/Beste Grüße,
    Dr. Marcel Minke
    (Limesurvey Head of Support)
    Need Help? We offer professional Limesurvey support
    Contact: marcel.minke(at)limesurvey.org'"
    The administrator has disabled public write access.
    Moderators: ITEd
    Time to create page: 0.131 seconds
    Donation Image