PHPStorm and CodeIgniter routing problem

I started learning CodeIgniter Web Framework and I am trying to work with PHPStorm 8.0.3 on Kubuntu 14.04. When I unzip CodeIgniter, I download the archive to my Apache root folder / var / www / html and go to

localhost/index.php 

      

then it works fine and I see "Welcome to CodeIgniter!". p. How can I use

localhost/index.php/welcome/index 

      

and look at the same page as her.

When I created a new PHP project in PHPStorm and tried

localhost:63342/codeignitor/index.php/ 

      

then i see the welcome page, but if i use

localhost:63342/codeignitor/index.php/welcome/index

      

then i get 404 pages. Also, all my own controllers are not available and the reason is 404.

I can only call my own controller if I make it the default

$route['default_controller'] = 'mycontroller';

      

I think this problem occurs because the url contains my project name / codeignitor /, but I'm not sure about this. So I need your advice on how to properly set up the CodeIgniter environment in PHPStorm to solve this problem. Thank!

+3


source to share


1 answer


Codeigniter uses the URL to determine the routing, so /codeigniter/index.php/welcome/index

and /index.php/welcome/index

are not equal ways. I would recommend using one or the other, and setting up your /index.php and / config / routes.php to place at your desired path.

Literature:



Codeigniter subdirectory

https://ellislab.com/codeigniter/user-guide/general/urls.html https://ellislab.com/codeigniter/user-guide/general/routing.html https://ellislab.com/codeigniter/user- guide / general / environments.html

+1


source







All Articles