Menu

Tips for running on Wampserver

Help
2011-06-12
2015-12-31
  • Clive S Woodhouse

    Took me a while to figure out how to get this working on WAMP without throwing errors all the time so I thought I should pass this on.

    First get a good text editor that will do multiple file search and replace all "<? " with "<?php " (paying attention to include the space after each) and "<?\r" with "<?php\r" (where \r is a return).

    Also remove all empty lines on files ending with "?>".  Several files seem to have extraneous but unnecessary returns.

    In the root and admin config.php files make sure to use the correct windows path conventions with \ escaped by a \.  ie use \\ in the paths.  Here is an example for a typical WAMP setup with the program files in "coursems" directory:

    //CourseMS Paths

    define('HTTP_SERVER', 'http://localhost/coursems/');
    define('HTTP_PATH', 'C:\\wamp\\www\\coursems\\');
    define('EXPORT_PATH', 'C:\\wamp/www\\coursems\\exports\\');
    define('REL_EXPORT_PATH', 'exports\\');

    Also make similar changes to site_config.php:

    <?php
    /**
    * @author Andrew Boulanger
    * @copyright 2009
    */
    //folder configurations

    define('CLASSES' , HTTP_PATH . 'classes\\');
    define('INCLUDES' , HTTP_PATH . 'includes\\');
    define('FUNCTIONS' , HTTP_PATH . 'functions\\');
    define('ADMIN' , HTTP_SERVER . 'admin/');

    // upload functionality is currently disabled
    // once enabled this will allow administrators to make course download material avaialable to learners
    //uploads directory needs to have 777 permissions
    // UPLOAD_DIR and RELATIVE_UPLOAD_DIR is where photos of instructors will be uploaded to.
    define('UPLOAD_DIR' , HTTP_PATH. 'admin\\images\\uploads'); //should be put outside htdocs directory
    define('RELATIVE_UPLOAD_DIR' , 'admin\\images\\uploads\\');

    // FILE_DIR and RELATIVE_FILE_DIR is where files and other information related to courses will be uploaded to.
    define('FILE_DIR' , HTTP_PATH .'admin\\uploads'); //should be put outside htdocs directory
    define('RELATIVE_FILE_DIR', 'admin\\uploads');

    // EXPORT_PATH and REL_EXPORT_PATH is where exports will be saved on the server.

    ?>

    And finally, the magic ingredient to make the admin logon page work.

    On or around line 48 of login.php find:
    If ($_GET=='true') Echo "?access=true";

    change it to:
    if(isset($_GET) && $_POST == 'true') Echo "?access=true";

    This should at least get you started, but you are likely to throw more errors.  However, I hope these pointers will provide the gist for ways to solve them.

     
  • Maha992

    Maha992 - 2015-12-31

    Hi, can you help am having this problem .

    Notice: Use of undefined constant center - assumed 'center' in C:\xampp\htdocs\coursems\view_schedule.php on line 322

    Notice: Use of undefined constant type - assumed 'type' in C:\xampp\htdocs\coursems\view_schedule.php on line 323

    Category:
    Notice: Use of undefined constant category - assumed 'category' in C:\xampp\htdocs\coursems\view_schedule.php on line 324

    Course:
    Notice: Use of undefined constant course_id - assumed 'course_id' in C:\xampp\htdocs\coursems\view_schedule.php on line 325

     

Log in to post a comment.