Welcome Guest, Not a member yet? Register   Sign In
URI and URL problem
#1

[eluser]Amier[/eluser]
Hallo,
Iam New, I have deploy CI and i have a problem with URI and URL.
Environtment :
Apache : Apache/2.2.4 (Win32)
PHP : 5.2.1
CI : 1.5.4

I can't load php class or function which i have define in controller, view, model folder.
when i point my browser to : http://localhost/index.php/test/
i get "The page cannot be found"

I have read the "User Guide" Fucking manual and i didn't find any clue to solve this problem.
did I miss something? are there any file configuration that i must to change?


regard, Amier
#2

[eluser]ELRafael[/eluser]
Welcome to CI Forum Amier.

Did you installed ci in the root folder of your webserver?

Second, did you configured the config.php file? See that file and change with your personal settings.

Do you have some .htaccess in the root folder?
#3

[eluser]Amier[/eluser]
yes, i have install ci on my root folder. i have seen welcome page too.

i have changed config.php on line :
-------------------------------------------------
$config['base_url'] = "http://localhost/";
-------------------------------------------------

my .htaccess contains
-------------------------------------------------
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
-------------------------------------------------

are there any configuration that i missed ?
#4

[eluser]gtech[/eluser]
What I would do is create a simple test.html file which has the words hello in it.

test.html
Code:
hello
then place this file where you think the root of the CI install is (should be the same place as the CI 'index.php')

Then goto the url http://localhost/test.html .. do you see the words Hello, if not your URL is incorrect. my set up has the CI installation in a folder above the web root so my URL is http://localhost/<ci root folder>/index.php/<controller>/<function>

OR

If you are browsing to http://localhost/index.php/<controller>/<function> then you do not need the .htaccess file.

The htaccess removes the need to have index.php in your URL (becuase the htaccess file informs the webserver to add in the index.php bit). I would take the htaccess file out as its another thing that can go wrong, put it in when you have everything working.

If you remove htaccess then ensure index_page in your config is set to 'index.php'. If you are using htaccess then the index_page should be set to '', also when using the htaccess file your URL should be http://localhost/<controller>/<function>.

p.s. I know these things are frustrating but there as no need to swear at the user guide, it will become your friend. Smile
#5

[eluser]Amier[/eluser]
iam very frustating to make "user guide" as my friend. i mean to.


i have removed .htaccess. i have ensured access the page http://localhost/test.html and i saw "Hello" as you suggested it.

this is the file locate at "<drive>:\Website\system\application\controllers\welcome.php"
==================================================
&lt;?php

class Welcome extends Controller {

function Welcome()
{
parent::Controller();
}

function index()
{
$this->load->view('welcome_message');
}
function Test()
{
echo "Helllooooooooooo";
}
}
?&gt;
===============================================

when i try to access 'http://localhost/index.php/welcome/test' and 'http://localhost/welcome/test',
it show us "The page cannot be found"

now iam very very frustating ....
please help..
#6

[eluser]tonanbarbarian[/eluser]
try changing your Test method to lowercase in the function declaration

also if you can go to http://localhost/index.php and see the default welcome page then i assume your PHP is configured to work with apache properly

if you are not using .htaccess then you should set
Code:
$config['index_page'] = 'index.php';
and use the http://localhost/index.php/welcome/test url

try the other all of the options for
Code:
$config['uri_protocol']    = "AUTO";
and see if one of those works for you.

make sure
Code:
$config['url_suffix'] = "";
so that it is not expecting .html or similar on the end of the urls

might also be good to make sure
Code:
$config['compress_output'] = FALSE;
#7

[eluser]Amier[/eluser]
dear tonanbarbarian,


I have done what u suggest and the problem is not solved.
#8

[eluser]Colin Williams[/eluser]
Sometimes it's best to start over from the beginning. Install the latest CI. Add the test() method to the welcome controller. No htaccess, just straight forward.
#9

[eluser]Amier[/eluser]
dear all,

i have faced this problem on my bundle MS4W (map server for windows) 2.2.3.
all of your suggestion are not work.

but when i install individual pacckage of apache 2.2.4 and php 5.2.1 on another machine,
all of your suggestion are work.
thanx u for all. i close this discussion and i will start new thread on how CI will operate on my MS4W.


I need CI to work with MS4W bundle 2.2.3 because it is our development production.




Theme © iAndrew 2016 - Forum software by © MyBB