CodeIgniter4: docs: Cannot build Codelgniter4 with Vagrant

Direction Not possible to use vagrant up to start Codelgniter4

Describe the bug I tried to git glone this project and modified the ‘VagrantFile.dist’ to ‘VagrantFile’. And then run vagrant up. The following error is showed

Vagrant cannot forward the specified ports on this VM, since they would collide with some other application that is already listening on these ports. The forwarded port to 8080 is already in use on the host machine.

To fix this, modify your current project’s Vagrantfile to use another port. Example, where ‘1234’ would be replaced by a unique host port:

config.vm.network :forwarded_port, guest: 80, host: 1234

Then I tried to change the port from 8080 to 8085 and run again. Then the vagrant is built this time. And I tried to access ‘http://localhost:8085’ on browser but no response.

I have tried to uncomment the mysql setting on ‘VagrantFile’ and I can access it on my host machine after Vagrant build.

CodeIgniter 4 version master branch

Expected behavior, and steps to reproduce if appropriate Build Codelgniter4 and access it with http://localhost:8080 or http://localhost:8085

Context

  • OS: macOS Catalina 10.15.1
  • PHP version 7.4.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

The DevKit already has Vagrantfile.dist. I sent PRs to remove it https://github.com/codeigniter4/CodeIgniter4/pull/6314 and update it https://github.com/codeigniter4/devkit/pull/38.

@rrcfesc Thank you for working the issue. I run the cmd and now I can access the codelgniter 4 from my host machine. But now I got the sql connection issue on the application after I access lcoalhost:8085. Is it also related to this issue?

i think is related with the issue

Im still working in the issue, apparently the vagrantfile is correct, but for any reason when the image start, the service is off, @charlesng you can wait until my fix or could you run the following commands: $ vagrant ssh vagrant@ubuntu-bionic:~$ sudo systemctl start apache2

hi @charlesng could i take this bug?