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

Subfolder installation support

edited January 2012 in Install Help

I've written a proxy script that augments the main front controller and allows Elefant to work in subfolder installations. The code is very short (currently only 48 lines of actual code) and is available here:

Note: If you run into trouble or bugs, please post them below or in the comments at the above link.

The installation steps are as follows:

1. Unpack the Elefant CMS into your desired subfolder.

2. Replace the .htaccess file with the one included at the link above.

3. Drop the subfolder.php file into your subfolder beside your index.php file.

4. Instead of using the web installer, you will need to use the command line install steps found at the bottom of the install page.

You should now be able to run Elefant inside of any subfolder of your choice.


  • edited January 2012

    Bug: Needs to consider URLs that already include the subfolder name before rewriting.

    Edit: Fixed.

  • I can't visit the link. Bad luck.

  • I'm trying to install Elefant to a subfolder on my localhost, using XAMPP on Windows XP. I followed the instructions in the first post in this thread (above), as well as the ones here. I have several other CMSs running on localhost just fine.

    When it comes to doing what it says here,

    " 4. Edit conf/config.php and add your database connection info and default site info."

    I did that fine, but for:

    " 5. Run the command ./conf/elefant install to create the default database tables for the built-in apps. This will generate a username and password for you to log into the admin area."

    ...I'm not sure how to do this in Windows. I tried using Command Prompt and Run from the start menu but I'm not getting the desired effect. I can change directories to that area but nothing happens. I remember being able to do things like this in Linux quite easily.

    Sorry for the noob question! To be honest I know very little about the Windows command line. Elefant's minimal, elegant nature appeals to me, it looks like a very promising CMS/framework.

    Thank you!

  • Just going through setting things up on a new Windows VM to test this. Haven't gotten it running yet myself, but here are the steps it should take from where you got:

    1. Open phpMyAdmin and paste the conf/install_mysql.sql file into its SQL input.

    2. Still in phpMyAdmin, create a new user record with the following info:

    id           1
    password     $2a$07$5WRplmOAgOuMozKzeTDOMeL2uWlI2.oYkwMYWQmfRpezHmmWCaWyS
    session_id   null
    expires      NOW
    name         Joe Admin
    type         admin
    signed_up    NOW
    updated      NOW
    userdata     []

    3. Create a blank text file named conf/installed or delete the install folder.

    4. Edit Apache's httpd.conf and enable mod_rewrite, then restart Apache.

    It looks like while this works for Elefant in a site root, the subfolder proxy makes some assumptions about Unix file paths. This likely means I'll have to modify the subfolder script to add Windows support. I definitely need to make running Elefant on Windows easier too.

    In the meantime, you can set up a VirtualHost in Apache and point a fake domain to it (I use names like www.elefant-testing.lo with the .lo signifying local domains :). Here's some info on doing that:

    On Windows, my hosts file is in C:\WINDOWS\system32\drivers\etc\hosts.

    Let me know if that gets it working for you. I'll take a look at the subfolder proxy and see if I can fix that for Windows soon too.

  • Meant to add that the encrypted password about is "default" :)

Sign In or Register to comment.