CodeIgniter Forums
CI4 on localhost using XAMPP on windows - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: CI4 on localhost using XAMPP on windows (/showthread.php?tid=78256)



CI4 on localhost using XAMPP on windows - CInoob - 12-23-2020

Hi everyone,

I'm sorry but I can't manage to get CI4 working on windows using XAMPP.

What I had done:

- Update php.ini to activate required extensions;
- Manually download CI4 files and put inside htdocs/ci4/ folder;
- Edited file Config/App.php with main root: http://localhost/ci4/ (tried also with public/ suffix);

Result is 404 - not found.

I edited windows system32 vhosts file accordingly to the forum suggestions, nothing;
I also added paths on windows and check all other windows options as suggested in the forum, butt nothing;
Tried also using vhosts/editing apache files trying to load the local website as "mywebsite.test or mywebsite.local" accordingly to online/forum suggestions, but same results (sometimes also worst, CI dont load at all for config errors).


I remember when I tried this previously that I received some suggestions about edit inside the public/index.php because windows manage paths in a bad way that return this error. But I can't found that solution anymore/anywhere...

So I'm completely stuck on cI4 setup (strange becasue it was always one of strenghtness of the framework) and can't work on the real code for my app.

I hope you can help me so I can put some efforts on this project next days.


Thank you!


RE: CI4 on localhost using XAMPP on windows - wdeda - 12-23-2020

In Apache in conf/extra the file httpd-vhosts.conf should have the configuration as below:

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/ci4/public"
    ServerName localhost
    ErrorLog "logs/ci4-error.log"   
</VirtualHost>


App/config:
public $baseURL = 'http://localhost';

public $indexPage = '';

These minimal changes should ensure the framework works.

By the way you can also edit the env file, in the path - root tree - Codeigniter and change, normally on line 17:
CI_ENVIRONMENT = production
to...
CI_ENVIRONMENT = development.

After saving the file, a period must be added before the name, e.g., from env to .env.

This change will allow a clearer view of the problem that is preventing the framework from running.


RE: CI4 on localhost using XAMPP on windows - InsiteFX - 12-23-2020

Edit C:\Windows\System32\drivers\etc\hosts

You can use notepad but must be logged in as Administrator.
 
Make sure these are not remarked out with a # sign in front of them.


Code:
127.0.0.1    localhost
::1        localhost

Control Panel\Programs\Programs and Features

Under Internet Information Services make sure World Wide Web Service is not checked.


RE: CI4 on localhost using XAMPP on windows - CInoob - 12-24-2020

Tried all this before. But I found the solution. Sorry I didn't said you I get last XAMPP version with PHP8, find out today that CI 4.0.X don't support it. All problems solved after XAMPP downgrade to 7.4.

Thank you anyway!