Closed PwrSrg closed 3 years ago
What version of PHP are you running? Is it at least 7.2?
Ah - found the missing steps.
env
to .env
CI_ENVIRONMENT = development
MOCK_MYBB = true
The environment line will show errors, etc. The MOCK_MYBB will not try to connect to an existing MyBB installation, which is probably what you need for local development.
This all works for me on PHP 7.2.
I had tried that too, but I basically get the same error, just without the "Whoops!".
CodeIgniter\HTTP\Exceptions\HTTPException
Request URI segment is our of range: 1
PHP 7.3.11
Strange. When I ran it I was using the built in php spark serve
. Are you using it under Apache or something else? If so, you might try using the built-in server.
Yes, as originally stated, I am using php spark serve
.
Here is a video of the entire process from start to finish:
Sorry forgot that. Unfortunately I don't have an answer. And I don't have a Windows dev box up and running currently so I cannot recreate it. Any help you could give by debugging it would be helpful, though.
I would guess a first step might be to try using different values for $uriProtocol
to see if that changes anything. Changing it to PATH_INFO might help? Taking a stab in the dark here. Sorry.
Controllers\BaseController::render()
- adding $this->request->uri->setSilent()
in the first line should fix it.
Either there is something messed up with this repo, or I am doing something completely wrong.
I have been trying to get this running on my local machine for a few days now, and all I can ever get is a "Whoops!" error message. I have tried many different methods on two different machines.
Here is how to reproduce the issue:
Here is what shows up in the Log File: CRITICAL - 2020-07-07 22:57:03 --> Request URI segment is our of range: 1
0 C:\Users\SergiHome\www\website2\vendor\codeigniter4\framework\system\HTTP\URI.php(485): CodeIgniter\HTTP\Exceptions\HTTPException::forURISegmentOutOfRange(1)
1 C:\Users\SergiHome\www\website2\app\Controllers\BaseController.php(67): CodeIgniter\HTTP\URI->getSegment(1)
2 C:\Users\SergiHome\www\website2\app\Controllers\Home.php(99): App\Controllers\BaseController->render('welcome')
3 C:\Users\SergiHome\www\website2\vendor\codeigniter4\framework\system\CodeIgniter.php(914): App\Controllers\Home->index()
4 C:\Users\SergiHome\www\website2\vendor\codeigniter4\framework\system\CodeIgniter.php(400): CodeIgniter\CodeIgniter->runController(Object(App\Controllers\Home))
5 C:\Users\SergiHome\www\website2\vendor\codeigniter4\framework\system\CodeIgniter.php(308): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
6 C:\Users\SergiHome\www\website2\public\index.php(45): CodeIgniter\CodeIgniter->run()
7 C:\Users\SergiHome\www\website2\vendor\codeigniter4\framework\system\Commands\Server\rewrite.php(34): require_once('C:\Users\SergiH...')
8 {main}
What am I missing???