• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Routing error in CI 4.0.0-rc.1

#1
Hello everybody,
first, don't be affraid of my English  Big Grin
I've read lot of topics for my problem but i've found no solution  Sad

I've install CI 4.0.0-rc.1 on my server, configure for development environment and try to acces to my project : no problem i have the CI welcome page ... good !!!

After that, i've create my first "very simple" controller in app/Controller named Admin here's the simply code !!!

<code>
<?php namespace App\Controllers;

    use CodeIgniter\Controller;

    class Admin extends Controller
    {
        public function index()
        {
             echo 'Admin area';
        }
    }

</code>

I put this line in app/Config/Routes.php :

$routes->add('admin', 'Admin::index');

and when i go to myproject/admin i've got this message on a white page (not the pretty CI 404 page) : "File not found" (you can see this at https://dev.cdsi-formation.fr)

I've testing $routes->add('admin', 'admin::index'); (all in lowercase) but it doesn't work to ...

I don't understand why that doesn't work ... please hellllllp  Angel

Thanks a lot for your future help  Wink

[edit]
i've test that in local and ... it works fine !
In local i've run PHP 7.2.21 and 7.2.22 on the sever
Is there a special server configuration for CI4 working ???
Reply

#2
What PHP version is your server running on? Have you checked error logs on the server?
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply

#3
(09-23-2019, 07:00 AM)kilishan Wrote: What PHP version is your server running on? Have you checked error logs on the server?
for the PHP version :
7.2.22-1+0~20190902.26+debian9~1.gbpd64eb7

 i've put the phpinfo in attachment and the only error i'va got is :
[proxy_fcgi:error] [pid 19818] [client 78.212.13.127:62520] AH01071: Got error 'Primary script unknown\n'


Attached Files
.pdf   phpinfo().pdf (Size: 1.32 MB / Downloads: 1)
Reply

#4
I've found the solution !!!!
the error was in .htaccess file
i've just change the line : RewriteRule ^(.*)$ index.php/$1 [L]
by this one : RewriteRule ^(.*)$ index.php?/$1 [L]
just adding ? before the /$1
Reply

#5
Awesome! Glad you found it. Good to have that reference here on the forum, also.
Support Development  • Practical CodeIgniter 3  •
Myth:AuthVulcan - CLI Tools for CI4
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.