Menu

Configuration of PHPwiki?

smeely
2011-11-16
2024-06-21
  • smeely

    smeely - 2011-11-16

    i have gone through the configuration script and copied what it spits out to
    the file specified, but it won't work.
    I get this message.
    Fatal Error:

    configurator.php:133 Error: Configuration problem:

    ADMIN_USER not defined in "C:\wamp\www\wiki\config\config.ini".
    Cannot continue: You have to fix that manually.

    Notice: "missing config setting for ADMIN_USER" (...repeated 4 times)

    Warning: "substr() expects parameter 3 to be long, string given"

    Notice: "Constant SERVER_URL already defined"

    Notice: "Constant PATH_INFO_PREFIX already defined"

    Notice: "Constant PHPWIKI_BASE_URL already defined"

    configurator.php:133 Error: Configuration problem:

    ADMIN_USER not defined in "C:\wamp\www\wiki\config\config.ini".
    Cannot continue: You have to fix that manually.

    What am i doing wrong?

     
  • FixItDik

    FixItDik - 2024-06-21

    This issue persists today, for people who are used to the "WordPress" type install/config this whole auto-config is really unintuitive but here's a solution to the particular problem that at least gets the Wiki up and running with the minimum effort:

    • Download version 1.6.4 (the latest, or it was in June 2024)
    • Unzip and copy in to target directory on web server
    • add the following two lines at line 2 of configurator.php
     if (!defined('ADMIN_USER')) define('ADMIN_USER', '');
     if (!defined('ADMIN_PASSWD')) define('ADMIN_PASSWD', '');
    
    • At line 604 in configurator.php insert a semicolon before the "A" of "Actions listed in this array" (for some reason when this line is written to the config file it is missing the semicolon and causes the ini file to be invalid)
    • At line 1519 insert a semicolon before the "L" in "List of directories" for the same reason
    • Near line 2531 in configurator.php change: is_writable($fs_config_file) to is_writable('config') (because the code needs to know if the directory is writable, not the file as the file may not yet exist)

    • Add the following line after line 153 of lib/IniConfig.php (so after the call to @parse_ini_file):

        if ($rs===false)
            trigger_error("Config file '$file' has invalid content and cannot be read - check for lines that should be comments but missing a semicolon, remove them and try again.", E_USER_ERROR);
    
    • (optional) Add the following two lines at line 2 of index.php and to configurator.php (will help you debug other issues):
    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    

    That's all the minor bug fixing done (I will try to get these requested to be fixed in the next version but not sure if anyone is supporting this any more).

    Now try to load it :)

    • Load the site in a browser, you should see the config page
    • Fill in the Wiki Name if you like (not important to it functioning)
    • Fill in the "Admin username" and "Admin Password" fields with what you intend to use to log in as administrator
    • In "Part Two" click "Show options" and change the "Database Type" to "flatfile" (you can play with this later but this should get you up and running without any database installation or config required)
    • Scroll to bottom of the page and click the "Save config/config.ini" button
    • You should be shown the configurator success page which is missing a link to actually now open the Wiki so remove the words "configurator.php" from the address in your browser and hit return - you now have a wiki!
     

    Last edit: FixItDik 2024-06-21

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.