Problems with CodeIgniter 4.0.4 |
Hi, I just download the CI4 and the only way a page loads is wen I use the URL
http://localhost/CI4/public I'm using WAMP, with PHP 7.2.14, and the mod_rewrite is ok. Also tried to change $indexPage = 'index.php'; to 'index.php?' But doesn't work. I actually following the tutorial, static pages. Nothing I've tried works. Help. Thanks in advance
in your command prompt, navigate into the root folder and enter the following command
php spark serve If you want to avoid the index.php, create a .htaccess file and put the following code there: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] Hope this helps
(09-02-2020, 05:33 PM)Omar Crespo Wrote: Thanks, but that's for use the native server of CI4. I want to use WAMP. The design of CI has changed. Nevertheless you can setup a virtual host on your machine, that will help you to access the site with an address like http://myproject.test. CI 4 is great, using it for my third project now. Thanks (09-02-2020, 02:47 PM)chenzen Wrote: in your command prompt, navigate into the root folder and enter the following command CodeIgniter 4 comes with an .htaccess file. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(09-03-2020, 12:51 AM)demyr Wrote:When I use my baseurl(09-02-2020, 12:57 PM)Omar Crespo Wrote: But doesn't work. http://localhost/CI4 all I get is the index of/ When I call any method like it used to be: http://localhost/CI4/index.php/home/index The error is: The requested url /CI4/index.php/home/index was not found on this server.
You may need to change the .htaccess file.
Code: # from this to the below And do not forget that the base url needs to end with a forward slash. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(09-06-2020, 06:19 AM)InsiteFX Wrote: You may need to change the .htaccess file.Thanks but that whasn't the problem. I kind of solve it by adding public folder to my base url. That should be included in the guide. Instead of $baseURL = http://localhost/CI4/ It works with: $baseURL = http://localhost/CI4/public/ Where can I download the .zip guide of CI4?? Here in my country (Cuba) we have veeery limited online access, so it would be great to read it offline. Thanks
You should set your virtualhost config (documentroot and directory directives) to point to the public folder then it will work and /public doesnt need to be added to the end of the URL. See my config below:
Code: <VirtualHost ng-cms.local:80> |
Welcome Guest, Not a member yet? Register Sign In |