Welcome Guest, Not a member yet? Register   Sign In
Help! Need wamp folder structure for multiple apps development
#1

[eluser]IgnitedOne[/eluser]
I am a CI noob with decent PHP know-how and I need to
develop multiple apps (from one CI install) with wamp.
Can someone help with the folder hierarchy...from c:\wamp
inwards...and example config for one of the apps?

Thanks,
IgnitedOne
#2

[eluser]ggoforth[/eluser]
I wrote a few blog posts about this topic. Maybe they will help you (although they don't specifically relate to WAMP, but the theory should be the same).

This one relates to installing code igniter in a way that allows you to run multiple sites on one CI code base.
http://www.greggoforth.net/article/8

This one is about the codeigniter directory structure.
http://www.greggoforth.net/article/5
#3

[eluser]IgnitedOne[/eluser]
Hey thanks so much.

Actually, I did figure it out and because
it's specifically for wamp, I will post
my "solution".

Thanks again, summer.
#4

[eluser]IgnitedOne[/eluser]
Hey Gregg:

Those were great links...I saved 'em both.

Thanks again,
Brad
#5

[eluser]IgnitedOne[/eluser]
DO NOT HEED THIS POST...IT'S NOT CORRECT. SORRY IF ANYONE TRIED IT.
_IGNITEDONE


Here's my "solution". Please critique.

1. Extract the CodeIgniter zip to c:\wamp.
2. Navigate with My Computer to C:\wamp\CodeIgniter_1.7.1\system\application.

Let's assume you initially want to develop 3 CI Web apps in folders named:

- app1
- app2
- app3

3. Make FOUR new subfolders as below:

- C:\wamp\CodeIgniter_1.7.1\system\application\app1
- C:\wamp\CodeIgniter_1.7.1\system\application\app2
- C:\wamp\CodeIgniter_1.7.1\system\application\app3
- C:\wamp\CodeIgniter_1.7.1\system\application\copyfornewapp

4. Copy EVERYTHING EXCEPT THE 4 NEW FOLDERS (copy 9 folders and index.html) from the C:\wamp\CodeIgniter_1.7.1\system\application folder into app1.

5. Repeat step 4 for the 3 other new folders.

At this point, the C:\wamp\CodeIgniter_1.7.1\system\application folder should have its 9 original folders (config,controllers,errors, etc),index.html, and our 4 new folders:

C:\wamp\CodeIgniter_1.7.1\system\application\app1\ holding 9 folders and index.html
C:\wamp\CodeIgniter_1.7.1\system\application\app2\ holding 9 folders and index.html
C:\wamp\CodeIgniter_1.7.1\system\application\app3\ holding 9 folders and index.html
C:\wamp\CodeIgniter_1.7.1\system\application\copyfornewapp\ holding 9 folders and index.html

6. You can now delete the 9 original folders and index.html from the C:\wamp\CodeIgniter_1.7.1\system\application folder, leaving only our 4 new folders:

C:\wamp\CodeIgniter_1.7.1\system\application\app1\ holding 9 folders and index.html
C:\wamp\CodeIgniter_1.7.1\system\application\app2\ holding 9 folders and index.html
C:\wamp\CodeIgniter_1.7.1\system\application\app3\ holding 9 folders and index.html
C:\wamp\CodeIgniter_1.7.1\system\application\copyfornewapp\ holding 9 folders and index.html

DO NOT ALTER THE copyfornewapp FOLDER. KEEP IT TO COPY FOR FUTURE CI Web apps.

7. Copy index.php and license.txt from the C:\wamp\CodeIgniter_1.7.1 folder to c:\wamp\www

8. Rename the index.php file in in c:\wamp\www to indexapp1.php.

9. Make copies of indexapp1.php named indexapp2.php and indexapp3.php in c:\wamp\www

At this point, c:\wamp\www holds these files:

c:\wamp\www\indexapp1.php
c:\wamp\www\indexapp2.php
c:\wamp\www\indexapp3.php
c:\wamp\www\license.txt

Next, we configure the app1 application. Use a similar approach for all other Web apps.

10. Open indexapp1.php and make these changes:

$system_folder = "../CodeIgniter_1.7.1/system";

$application_folder = "application/app1";

11. Save indexapp1.php

12. Open C:\wamp\CodeIgniter_1.7.1\system\application\app1\config\config.php and make this change...WITH TRAILING SLASH:

$config['base_url'] = "http://localhost/";

13. Save config.php


That's it. Fire up wampserver and load http://localhost and select indexapp1.php in your browser. You should see the CI welcome screen:

Welcome to CodeIgniter!

Configure your other Web apps in the same way, each with its own index????.php file.
Hope this helps some folks out...it works for me!
#6

[eluser]ggoforth[/eluser]
If it works for you, and you like it, and can grow with it in the future, then it's a good solution. On my web server I have the CI system folder (sans the application folder) installed in a directory above the web root. All I do then is copy the default application folder and index.php into any new projects (I even have a skeleton directory set up to copy these over when I create a new account, makes it REALLY handy.) That way, the index.php refernces the "above root" CI installation which is perfectly fine. If CI ever updates the platform I just copy the new system folder to the above root locations and change the index.php to reflect that. That way old versions can still reference their original code base and new projects can reference the most current one.

Greg
#7

[eluser]IgnitedOne[/eluser]
Thanks to you, I now see that my "solution" was flawed...many issues after first controller.
I am cooking now with the setup you recommeded. Thanks so much!
I will try to edit/delete my "solution" to save others from my mess.
#8

[eluser]ggoforth[/eluser]
I have certainly been in your shoes before. I've learned a lot form the experts here also. In the end, everyone will have their own "best practice" and I kind of feel like if it works for you, then it's the right solution.

Glad your moving ahead!

Greg




Theme © iAndrew 2016 - Forum software by © MyBB