CI4 in localhost |
hi , sorry for english im new in ci4 , in ci3 when i unzip the project in my localhost i can access by the browser visit the url http://localhost/myproject , now in ci4 i must add at the url the public http://localhost/myproject/public but i have the error
Code: [color=#333333][size=small][font=Tahoma, Verdana, Arial, sans-serif][color=#222222][size=xx-large]Whoops![/size][/color] my .env is in development mode . If i run the command php spark serve it work fine , Why ?
Hi,
It's because in App\Config\App.php your baseURL setting is $baseURL = 'http://localhost:8080/'; Edit your .env file and set baseURL to $baseURL = 'http://localhost/yourproject/public/'; Hope this help!!
(06-01-2020, 06:50 AM)FlavioSuar Wrote: Hi, sorry instead of : app.baseURL = 'http://localhost/codeigniter_4/public' app.$baseURL = 'http://localhost/codeigniter_4/public' or $baseURL = 'http://localhost/codeigniter_4/public' (my www is localhost)
I set $baseURL = 'http://localhost/ci4/public/'
but in browser if i run http://localhost/ci4/public/ i have this error : Fatal error: Uncaught Error: Call to undefined function CodeIgniter\locale_set_default() in /home/stefano/localhost/ci4/system/CodeIgniter.php:184 Stack trace: #0 /home/stefano/localhost/ci4/system/bootstrap.php(181): CodeIgniter\CodeIgniter->initialize() #1 /home/stefano/localhost/ci4/public/index.php(36): require('/home/stefano/l...') #2 {main} thrown in /home/stefano/localhost/ci4/system/CodeIgniter.php on line 184
PHP version 7.2 or newer is required, with the intl extension and mbstring extension installed.
https://codeigniter.com/user_guide/intro...ments.html You need to enable intl.
(08-18-2020, 09:10 AM)jreklund Wrote: PHP version 7.2 or newer is required, with the intl extension and mbstring extension installed. I use 7.4 init and mbstring enabled same problem (it work by php spark serve ) but is possible to start simply visit de page as ci3?
I'm afraid you are not. Check with phpinfo(), it's not enabled. Or you wouldn't get that error message.
No, you need a real virtual host to set it up.
(08-18-2020, 11:02 PM)jreklund Wrote: I'm afraid you are not. Check with phpinfo(), it's not enabled. Or you wouldn't get that error message. Its' true , in my notebook there are several php , in use on localhost is the 7.2 , now work fine , thanks. Now where is the correct url ? the ci message are at http://localhost/ci4/public/ f.e. if i want run user/login i try http://localhost/ci4/public/user/login but i have this error Not Found The requested URL was not found on this server. *edit find must insert index.php as http://localhost/ci4/public/index.php/user/login
in .app/Config/App.php
change: PHP Code: public $indexPage = 'index.php'; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |