We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13712
    • 15 Posts
    Hi

    I have a test Modx site on my Windows XP SP3 box and I decided to copy it over to my Linux  (Slackware 12.2) set up to test the scenario where a local site will be moved to a remote Linux Server. The database was exported from Windows and imported into Linux using phpMyAdmin and the entire modx installation was zipped up and unpacked in the Linux htdocs directory.

    However browsing to the site ((http://localhost/modx/) produced the following errors:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	include(/var/www/htdocs/modx/assets/snippets/ajaxSearch/includes/snippet.ajaxSearch.inc.php) [function.include]: failed to open stream: No such file or directory	 
      Error type/ Nr.: 	Warning - 2	 
      File: /var/www/htdocs/modx/manager/includes/document.parser.class.inc.php(769) : eval()'d code	 
      Line: 70	 
     
    Parser timing
      MySQL: 0.0007 s	(0 Requests)
      PHP: 	 0.0462 s	 
      Total: 0.0469 s	 
    
    


    On the other hand the manager section (http://localhost/modx/manager) works fine.

    I have checked my URL and paths in Tools > Configuration:
    "Interface & Features" and "File Manager", and I only had to update the "File Manager Path".
    All other values were correct.

    I searched through the forums for solutions and suggestions and tried a few.  This included

    1. hardcoding the the following values in the confing.inc.php file

    $base_url=’http://localhost/modx/’; (also tried "/" and "/modx")
    $base_path=’/var/www/htdocs/’;
    $site_url=’http://localhost/modx/’;

    2. Clearing browser cache and cookies

    However this only resuled in a blank home page and the manager page only displayed "Could not load DBAPI class."

    Can anyone point out what the problem is and provide possible solutions?  Re-installation using the "upgrade" option may solve the problem but I would like to avoid this if possible.

    Regards
      • 22303 MODX Staff
      • 10,725 Posts
      As the error indicates, it looks like the AjaxSearch snippet cannot find the include it requires at /var/www/htdocs/modx/assets/snippets/ajaxSearch/includes/snippet.ajaxSearch.inc.php. Check to make sure that file exists and that the case of the directory/file names are correct (remember Windows boxes are not case sensitive, so these includes will work on Windows if the case is incorrect, but not on Linux).
        • 13712
        • 15 Posts
        Quote from: OpenGeek at Dec 22, 2008, 04:36 PM

        As the error indicates, it looks like the AjaxSearch snippet cannot find the include it requires at /var/www/htdocs/modx/assets/snippets/ajaxSearch/includes/snippet.ajaxSearch.inc.php.  Check to make sure that file exists and that the case of the directory/file names are correct (remember Windows boxes are not case sensitive, so these includes will work on Windows if the case is incorrect, but not on Linux).

        No wonder you are the Geek  grin!!! Oddly enough, one of the first things I did upon viewing the error message was to check whether the "snippet.ajaxSearch.inc.php" file was present in location indicated.  It  was indeed present but the location was not quite what it should be.  Maybe it was symptomatic of glazed eyes syndrome from spending too long compiling packages, configuring things, etc on my new Slack 12.2 setup and learning Modx, that I missed the fact that the the leading "a" in "ajax" in both the path and file names, where transferred from Windows in uppercase.

        Thus editing /var/www/htdocs/modx/assets/snippets/AjaxSearch/includes/snippet.AjaxSearch.inc.php
        to
        /var/www/htdocs/modx/assets/snippets/ajaxSearch/includes/snippet.ajaxSearch.inc.php

        solved the problem and now the site loads as expected.  Now no self respecting geek (glazed eyes or not) would have missed the case mismatches and of course OpenGeek was onto it like a flash  laugh.

        Top stuff M8  grin.

        Cheers

        Edit: On another note, after testing the site out for a while, I discovered that the "Search" feature does not work.  Hovering over the search button changes the cursor but clicking on it produces no effect.  Any ideas?
          • 13712
          • 15 Posts
          Ok seemed to have solved the Search problem smiley. Once again, the leading "A" in ajaxSearch.js and ajaxSearch.php in the /var/www/htdocs/modx/assets/snippets/ajaxSearch directory were changed from uppercase to lowercase.

          I will continue to test things and hopefully no further issues will crop up smiley
            • 3749
            • 24,544 Posts
            My rule for stuff that will exist on both Windows and Linux boxes is: all filenames, all lowercase, always. smiley
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: BobRay at Dec 22, 2008, 11:59 PM

              My rule for stuff that will exist on both Windows and Linux boxes is: all filenames, all lowercase, always. smiley
              Amen BobRay! And this will be a project coding standard established for reference components as we release Evolution and Revolution (1.0 and 2.0 respectively).
                • 13712
                • 15 Posts
                Yes indeed BobRay, this is what I practice, only lowercases for file and directory names. For composite names, I use the underscore "_" the separate individual words.