Welcome Guest, Not a member yet? Register   Sign In
Following Static pages tutorial - No input file specified.error
#1

(This post was last modified: 08-22-2020, 02:48 AM by jreklund.)

Hi everyone

I'm new to codeigniter and I'm trying to install directly onto a live domain on a shared hosting server. 
 
Installed using composer. following the guide here: https://codeigniter4.github.io/userguide...poser.html
public files are in the public_html directory. Everything else is one level up. 

The welcome page loads correctly here: https://codemechanic.co.uk/

I'm now following the guide here: 
https://codeigniter4.github.io/userguide...pages.html

I've followed all steps correctly up to "Running the app" 

When I go to any of the addresses specified I receive the error "No input file specified." eg here: https://codemechanic.co.uk/pages

I don't understand why this is. I've done some googling but can't find a solution.
Things i've tried.

changing the .htaccess file in public_html:

Code:
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]
changed to:
RewriteRule ^([\s\S]*)$ index.php?/$1 [L,NC,QSA]

this changed the error to a 404 when visiting https://codemechanic.co.uk/pages

I
've also changed the baseURL to https://codemechanic.co.uk/ to in app/Config/App.php - no changes there. 

Does anyone have any suggestions?
Reply
#2

You should enable development mode:
https://codeigniter4.github.io/userguide...nd-running

Most likely you pages controller are named pages.php and not Pages.php. Due to the fact it's not a rewrite problem, as index.php url aren't working.
https://codemechanic.co.uk/index.php/pages
Reply
#3

(This post was last modified: 08-22-2020, 03:03 AM by jreklund.)

Thank you for the quick reply. Controllers page is named Pages.php, and env file is set to development. So no problems there. Controller set up like so:

[Image: ci4.png]
Reply
#4

Hi, you need to have a "." in front of your "env" for it to be able to work.

Now:
env

Should be:
.env

Pages look OK thought.
Reply
#5

(This post was last modified: 08-22-2020, 03:08 AM by jreklund.)

(08-22-2020, 03:05 AM)jreklund Wrote: Hi, you need to have a "." in front of your "env" for it to be able to work.

Now:
env

Should be:
.env

Pages look OK thought.

OK thanks. Corrected that, named .env 

https://codemechanic.co.uk/pages returning a 404 when htaccess is set to :
RewriteRule ^([\s\S]*)$ index.php?/$1 [L,NC,QSA]

or "No input file specified." when set to:
RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]
Reply
#6

Keep a ? in there, that are server specifics. Open up your writable/logs and see what errors you have.
Have you disabled the auto route in /app/Config/Routes.php?

Should be:
PHP Code:
$routes->setAutoRoute(true); 
Reply
#7

OK, will keep the ? in there. 

no change to auto route. Only change to this file was adding the (:any) route:

[Image: routes.png]
Reply
#8

Can you try and reverse those $routes->get() and put / one after (:any)?
Reply
#9

[Image: routes.png]

Like this? still returning 404.
Reply
#10

(This post was last modified: 08-22-2020, 03:24 AM by jreklund.)

Yep, but apparently that made things worse. So go back again. Check your writables/logs folder for tips.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB