About the index.php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yogeshwari
Forum Newbie
Posts: 4
Joined: Sat Jan 23, 2016 8:39 am

About the index.php

Post by yogeshwari »

Friends,

Hi am doing one online shopping project in php. I cant able to run my project . If i run in url index.php is missing so i cant able to run the project(http://localhost:8080/mercigreen/home) . It showing the object not found error. I did my project in code-igniter.I also tried by putting index.php/home in header view page also like that means it is working but if i traverse to another page like about us etc then it showing 2 index.php (http://localhost:8080/mercigreen/index. ... .php/about) so that time it is showing 404 error. Please help me friends.

Thanks in advance.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: About the index.php

Post by Celauran »

yogeshwari wrote:It showing the object not found error.
You'll need to be a lot more specific than that. Which version of CI? What specific error messages are you encountering? What does your setup look like (directory structure, etc)?
yogeshwari
Forum Newbie
Posts: 4
Joined: Sat Jan 23, 2016 8:39 am

Re: About the index.php

Post by yogeshwari »

am using CodeIgniter_2.1.4.
Attachments
Untitled.png
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: About the index.php

Post by Celauran »

Why do you have /index.php/index.php ? Is this a legacy project you've inherited or are you starting fresh?
yogeshwari
Forum Newbie
Posts: 4
Joined: Sat Jan 23, 2016 8:39 am

Re: About the index.php

Post by yogeshwari »

In href i gave index.php/home . Am doing project by using free template . am doing for my college academic. so i used free template. if i remove that index.php then also it is not working . If i put that index.php then i can able to load a particular page .
Attachments
s.png
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: About the index.php

Post by Celauran »

Have you set up any routes? Is anything working? Can you get at least a basic Hello World to behave as expected?

Also, I feel like using something as outdated as CodeIgniter for a brand new project is probably not a great idea.
yogeshwari
Forum Newbie
Posts: 4
Joined: Sat Jan 23, 2016 8:39 am

Re: About the index.php

Post by yogeshwari »

ya i set routes
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: About the index.php

Post by Christopher »

It looks like the page may have <base> set in the header or CodeIgniter config, so it appending the relative URLS (e.g., "index.php/home") to the base URL. Since there is no Controller "index.php" with Action "home" is gives a error. Changing the URLs to "http://localhost:8080/mercigreen/index.php/home/" or even just "/mercigreen/index.php/home/" should work. You could also set a View variable so you could do: "<?php echo $BASE; ?>/index.php/home/" in your templates.
(#10850)
Post Reply