Welcome Guest, Not a member yet? Register   Sign In
Using CodeIgniter with WAMP
#1

[eluser]musonic[/eluser]
I've been developing a project based on CodeIgniter on my MacBook Pro. For reasons I don't need to go into I've now had to move my work onto a PC running Windows XP. I've installed WAMP and brought my existing project into the www folder. Unfortunately, when I try and access the project via localhost it throws up include errors. It seems that for some reason the constants APPPATH and BASEPATH seem to be incorrect. I've checked the index.php file and it all seems ok. I've also downloaded a fresh version of CodeIgniter and placed that in my www folder. I can access the welcome message without any problems. Any ideas?

The first error message that comes up is:

Warning: include(application/errors/error_php.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\mySite\system\libraries\Exceptions.php on line 163
#2

[eluser]carvingCode[/eluser]
I'm using Wampserver on two different Windows PCs. I think this is the error I got when I first set things up. If you have a .htaccess file, that won't work within Windows. I simply renamed mine on the local and it solved the problem.

Also, a tip (if using .htaccess on remote): Add 'index.php' to the end of your 'base_url' item in config. Leave the 'index_page' item empty. That way, you don't need to make any changes to any of your URL structure. Your local setup should match the remote. You will need to add 'index.php' to your local URLs when accessing the site in the local browser, i.e.: 'http://localhost/folder/index.php/controller/function'

Hope this helps.
#3

[eluser]musonic[/eluser]
Thanks carvingCode, but I'm not sure that will help. I'm not using an .htaccess file (yet!). Also, I'm not sure what you mean by remote and local. I'm still developing the site so it only exists on my machine, localhost. I'll still try your tip about adding the index.php to the base_url item, but could you clarify what you mean?
#4

[eluser]musonic[/eluser]
Just tried adding "index.php" to the base_url item but no joy!
#5

[eluser]carvingCode[/eluser]
Sorry. Hopefully someone else will have a solution for you.
#6

[eluser]danmontgomery[/eluser]
What is the value of APPPATH?
#7

[eluser]musonic[/eluser]
Um... not sure. How can I find out?
#8

[eluser]danmontgomery[/eluser]
Code:
echo APPPATH;
#9

[eluser]musonic[/eluser]
Yes, but does it matter which file and where in the file I put it?
#10

[eluser]musonic[/eluser]
Ok, sorry for being dumb - I blame tiredness!
Here are the values for APPPATH and BASEPATH immediately after they have been defined in the main index.php file.

APPPATH = application/
BASEPATH = C:\wamp\www\mySite/system/

So there's the problem. I thought APPPATH should be the full path to the application folder, and surely the forward slashes in BASEPATH should be back slashes?




Theme © iAndrew 2016 - Forum software by © MyBB