Welcome Guest, Not a member yet? Register   Sign In
CI4 in localhost
#1

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]

[color=#777777][size=large]We seem to have hit a snag. Please try again later...[/size][/color][/font][/size][/color]

my .env is in development mode .

If i run the command php spark serve it work fine , Why ?
Reply
#2

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!!
Reply
#3

(06-01-2020, 06:50 AM)FlavioSuar Wrote: 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!!


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)
Reply
#4

I set $baseURL = 'http://localhost/ci4/public/'

but in browser if i run http://localhost/ci4/public/

i have this error :

[font=Times New Roman]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[/font]
Reply
#5

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.
Reply
#6

(This post was last modified: 08-18-2020, 01:32 PM by pippuccio76.)

(08-18-2020, 09:10 AM)jreklund Wrote: 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.

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?
Reply
#7

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.
Reply
#8

(This post was last modified: 08-19-2020, 02:52 AM by pippuccio76.)

(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.

No, you need a real virtual host to set it up.

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
Reply
#9

in .app/Config/App.php

change:

PHP Code:
public $indexPage 'index.php';

// to this:

public $indexPage ''
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#10

(08-19-2020, 04:04 AM)InsiteFX Wrote: in .app/Config/App.php

change:

PHP Code:
public $indexPage 'index.php';

// to this:

public $indexPage ''

Dont work need always index.php before controller/method
Reply




Theme © iAndrew 2016 - Forum software by © MyBB