404 - File Not Found Codeigniter 4 |
Hello there, I'm Crevitz. I'm quite new when it comes to codeigniter 4 and installed it using composer. When I run the spark and access via localhost:8080/myproject, this "404 File Not Found. Sorry! Cannot seem to find the page you were looking for" page.
I thought I did a mistake while installing codeigniter so I redo the installation also I recheck my php version which turns out to be 7.2.10 I also create htaccess in my project folder but it makes no difference. I'm in lost, would somebody kindly help me? PS: Is it gonna be different if you use --no-dev or just plain appstarter myproject?
this is one painless way to get started, which maybe needs tweaking for Windows (im on linux)
open a terminal conform where we are : Code: bash-5.0$ pwd move context of terminal to Desktop: Code: cd Desktop install an appstarter directory on Desktop , with no extra (unit test etc) Code: bash-5.0$ composer create-project codeigniter4/appstarter --no-dev (i can just use "composer" because i set up so that composer evokes composer.phar you can do that and make it global using terminal : say composer.phar is on your Desktop use as root command below or add "sudo" Code: mv composer.phar /usr/local/bin/composer refer to : https://getcomposer.org/ basically it will be something like : Code: php composer.phar <command> when composer has successfully downloaded; you will have following directory structure: Code: appstarter lets fire it up confirm where terminal is: Code: bash-5.0$ pwd Couple of things @Crevitz if you follow above using spark server, you will find Welocome to Codeigniter page at : http://localhost:8080 if you have codeigniter in Apache xampp you need to point "listening" so that it uses public folder. Codeigniter already has a .htaccess in public . The only time i needed to touch it was when going from http to https on live server. The difference between using --no-dev is that if you don't use it you get a load of extra stuff. if you do not use it and find actually you don't need it you can always get rid of it using : Code: composer update --no-dev the url to see the home page is just : http://localhost:8080 no need for http://localhost:8080/project check directory structure The other thing i was going to mention is this: You might say fine , having that on my Desktop but i can not really do any development can i, since i will be using a database. So i will have to move it to Apache or Xampp. Not quite true . MySql Maria etc need a database daemon/server what ever you want to call it , but sqlite3 does not. sqlite3 is serverless and is just a file. I put mine in the writable directory. If you get sqlitebrowser you can view fields data in a basic gui and even create a databse, table. sqlite3 has a capacity of 281 terabytes so it should be more than enough . But MySQl is secure and sqlite3 doesn't use passwords ! well take it from me Wordpress uses MySQL and stores admin user name and passwords in a table called users. A lot of Wordpress sites are vulnerable nether-the-less. |
Welcome Guest, Not a member yet? Register Sign In |