(11-07-2016, 03:53 AM)utodev Wrote: Hi all,
I've been using CI 2.0 for a long time, but now that I have a new project I'd like to move to CI 3.0. I've downloaded and installed CI 3.1.2 and the welcome controller loads properly if I write:
http://example.com
Sadly, if I try to load it this way it fails:
http://example.com/index.php/welcome
So does all controllers I've tried to create. For instance I've created the following controller in the application/controllers/Test.php file:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Test extends CI_Controller
{
public function index()
{
echo "OK";
}
}
It doesn't load using:
http://example.com/index.php/test
But if I change default controller from "welcome" to "test" then it returns OK properly if I browse to:
http://example.com/
Also, if I run it from the CLI it works properly and again returns OK, no matter if is set as default of not:
I have tried to change $config['uri_protocol'] to QUERY_STRING and PATH_INFO without succes, I've tried to change base_url so its value is 'http://example.com/' instead of empty.
Server is a Raspberry Pi 2 using raspbian:
Code:
Linux raspberrypi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux
This is php version:
Code:
PHP 5.4.45-0+deb7u5 (cli) (built: Sep 18 2016 17:23:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
I hope someone can help :-)
What do you use as webserver and how is it connected to php?
eg. apache and php-fpm
make a script eg. test.php
Code:
<?php
var_dump( $_SERVER['REQUEST_URI']);
var_dump( $_SERVER['QUERY_STRING']);
var_dump( $_SERVER['PATH_INFO']);
call it like "test.php/welcome" and post the result