Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Installation frustration on Windows (again!)

edited March 2013 in Install Help

I have been trying to install elefantcms for a couple of days now but no success! I use WAMP on Win XP and after reading all topics about SUBFOLDER installation, still nothing happens.

Importing or pasting and executing the script install_mysql.sql, produces the error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(72) not null primary key,

title char(72) not null,
menu_title char(72) not ' at line 2 

(that strange not ' , appears OK in the script!)

I am starting now with a virtual host, but there must be an easier path as I had no troubles with any other installation till now (I know , it's the Windows dummy...)

Thanks

Petros

Comments

  • What are you using to import the database schema? And what version of MySQL are you on? If you can, use the web installer, which will import the schema correctly for you.

    Importing it directly into MySQL actually doesn't quite work now, since the schema files have placeholders for the database table name prefixes. It looks like the install instructions need to be updated to mention that now.

    To import them using phpMyAdmin, you'll need to first do a search and replace for #prefix# with the value of the prefix setting in conf/config.php. It should work after that.

    Let me know if that helps.

  • I've updated the install docs to mention this now too. Thanks for catching that, and sorry about the trouble!

  • After repairing the prefix, the tables were created OK. Now, the problem is with the routing. with URL localhost/elefantcms (my subfolder) , it returns a Page not Found and as I can see it thinks my home is localhost/index. Apache is OK, I replaced .htaccess, but I think there is a problem "between" subfolder.php and index.php.

    Thanks for caring

    Petros

  • Glad the first part's fixed. Can you try adding a couple lines to the subfolder.php file just after line 78 and let me know what it outputs? Here are the extra lines:

    echo 'dir: ' . getcwd () . '<br />';
    echo 'root: ' . $_SERVER['DOCUMENT_ROOT'] . '<br />';
    echo 'sub: ' . SUB_FOLDER . '<br />';
    echo 'uri: ' . $_SERVER['REQUEST_URI'];
    exit;
    

    That should help figure out where it's going wrong :)

  • After adding the specified lines...

    writing : localhost/elefantcms -> outputs Page Not Found

    writing : localhost/elefantcms/index -> outputs dir: E:\wamp\www\elefantcms root: E:/wamp/www/ sub: E:\wamp\www\elefantcms uri: /elefantcms/index

    writing : localhost/elefantcms/subfolder -> outputs dir: E:\wamp\www\elefantcms root: E:/wamp/www/ sub: E:\wamp\www\elefantcms uri: /elefantcms/subfolder

  • Ah I think I see what's going on. getcwd() returns the directory with Windows-style slashes, but $_SERVER['DOCUMENT_ROOT'] returns it with Unix-style slashes.

    Can you try replacing line 77 of subfolder.php with these two lines:

    $cwd = str_replace ('\\', '/', getcwd ());
    define ('SUB_FOLDER', str_replace ($_SERVER['DOCUMENT_ROOT'], '', $cwd));
    

    Take out the other extra lines too and let me know if that gets it working.

  • Not yet there ...

    localhost/elefantcms/index returns dir: E:\wamp\www\elefantcms root: E:/wamp/www/ sub: elefantcms uri: //index

  • Looks like your document root has a trailing slash in some cases. Let's try replacing line 77 with these and see if it works this time:

    $cwd = str_replace ('\\', '/', getcwd ());
    $root = rtrim ($_SERVER['DOCUMENT_ROOT'], '/');
    define ('SUB_FOLDER', str_replace ($root, '', $cwd));
    

    Let me know how it goes.

  • Now localhost/elefantcms/index returns

    dir: E:\wamp\www\elefantcms root: E:/wamp/www/ sub: /elefantcms uri: /index

  • That looks about right. If you take out the echoes now and let it run, how's it working?

  • Writing : localhost/elefantcms -> outputs Page Not Found UNFORMATTED.

    Writing : localhost/elefantcms/index -> outputs a FORMATTED Page Not Found (with background, colors etc.).

  • If you visit http://localhost/elefantcms/ versus http://localhost/elefantcms is there any difference?

    It looks like the second Page Not Found message may be a different issue, since it seems to be correctly rewriting the URL now, but isn't finding the index page. I would double-check the database connection settings in conf/config.php.

  • The two URLs yoy wrote above are identical.

    In config.php there is no reference to MySQL settings (just sqlite and MongoDB).

  • If you've imported the database into MySQL, then you'll need to change the database section of conf/config.php to your MySQL connection settings:

    [Database]
    
    ; Database settings go here. Driver must be a valid PDO driver.
    
    master[driver] = mysql
    master[host] = "localhost:3306"
    master[name] = "DBNAME"
    master[user] = "USERNAME"
    master[pass] = "PASSWORD"
    
    ; The database table name prefix.
    
    prefix = "elefant_"
    

    Let me know if that fixes the Page Not Found for the http://localhost/elefantcms/index case. Not sure why the other would come up with an Apache Page Not Found error though, since according to the .htaccess file a request to /elefantcms/ ought to resolve to the /elefantcms/subfolder.php, but maybe it's looking for it in the document root for some reason. Try changing that line in .htaccess to this:

    DirectoryIndex /elefantcms/subfolder.php
    

    Let me know how that goes, and thanks for being patient in debugging this.

  • I think the DB connection is OK.

    Also, the DirectoryIndex did (almost?) the trick. Except for a few Page not Found, I can access the admin area and also see "my" site.

    I must now "play" with elefant, though I have several questions , after skimming through the docs. So, from time to time I will bother you with - probably silly - questions.

    Thank you for your patience.

    Petros

  • No worries. Glad it's starting to work now :) If you keep running into Page Not Found errors, let me know and maybe we can find a pattern to them.

Sign In or Register to comment.