Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Cannot build Codelgniter4 with Vagrant #2453

Closed
charlesng opened this issue Dec 15, 2019 · 18 comments
Closed

docs: Cannot build Codelgniter4 with Vagrant #2453

charlesng opened this issue Dec 15, 2019 · 18 comments
Assignees
Labels
documentation Pull requests for documentation only

Comments

@charlesng
Copy link

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
@charlesng charlesng added the bug Verified issues on the current code behavior or pull requests that will fix them label Dec 15, 2019
@rrcfesc
Copy link

rrcfesc commented Dec 23, 2019

hi @charlesng could i take this bug?

@charlesng
Copy link
Author

I spent few days but I still not able to setup it with vagrant yet. Thank you for picking up

@lonnieezell
Copy link
Member

@rrcfesc Hopefully you can get this one working. I'd love to see this work smoothly. If you had time to add some docs for it, also, that would be great.

@rrcfesc
Copy link

rrcfesc commented Dec 29, 2019

i can reproduce the issue over linux, so im working in the fix

@rrcfesc
Copy link

rrcfesc commented Dec 30, 2019

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

@charlesng
Copy link
Author

@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?

@rrcfesc
Copy link

rrcfesc commented Dec 30, 2019

@charlesng i dont think so about that is related with the issue, the vagrantfile only open the ports 8080, 8081, 8082, could you share the VagrantFile please.

Screenshot from 2019-12-30 14-53-59

@rrcfesc
Copy link

rrcfesc commented Dec 30, 2019

@lonnieezell almost done the fix, do you have in mind a place for the docs? or must be in the PR?

@rrcfesc
Copy link

rrcfesc commented Dec 30, 2019

@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

@charlesng
Copy link
Author

charlesng commented Dec 31, 2019

@rrcfesc Okay, I have found something might be helpful. On the file .env, I found that the password might be need to change to "password" and add the database first to make it successful.

Screenshot 2019-12-31 at 3 33 32 PM

Also , currently when I changed the environment setting then I need to run the cmd vagrant reload and then vagrant provision. After that I also need to run cmd sudo systemctl start apache2 you provided inside ssh. Then I can get the environment change or other app files change.

@MGatner
Copy link
Member

MGatner commented Feb 18, 2020

@rrcfesc Thank you for your work on this! Were you able to solve it? If the updated docs differ from what is current (https://codeigniter4.github.io/CodeIgniter4/installation/running.html#hosting-with-vagrant) then a PR to update the User Guide would be great. The file in question is <user_guide_src/source/installation/running.rst>.

I would be glad to help with this, please just let me know where it is at.

@lonnieezell
Copy link
Member

@rrcfesc Were you going to be able to take a crack at docs for this as @MGatner suggested?

@MGatner MGatner added the documentation Pull requests for documentation only label Aug 25, 2020
@MGatner
Copy link
Member

MGatner commented May 8, 2021

Container versions of the app need to be moved out of the framework and into separate projects. If anyone has work on Vagrant and wants to take charge of codeigniter4projects/vagrant I can get that set up. For now Vagrant support in this repo will be deprecated.

@kenjis kenjis removed the bug Verified issues on the current code behavior or pull requests that will fix them label Dec 20, 2021
@kenjis kenjis changed the title Cannot build Codelgniter4 with Vagrant docs: Cannot build Codelgniter4 with Vagrant Apr 21, 2022
@kenjis
Copy link
Member

kenjis commented Jul 29, 2022

Does anyone use Vagrant?
If not, I would like to close this, and remove Vagrantfile.dist and explanation in the User Guide.

@kenjis kenjis added the waiting for info Issues or pull requests that need further clarification from the author label Jul 29, 2022
@lonnieezell
Copy link
Member

I'm sure someone does, but no one has been concerned enough in the last year+ to respond. Maybe we copy it over to another repo or something? Doesn't seem to really be needed in core.

@MGatner
Copy link
Member

MGatner commented Jul 29, 2022

We've been adding container templates to DevKit - I think that would be a fine place to out this.

@kenjis
Copy link
Member

kenjis commented Jul 29, 2022

The DevKit already has Vagrantfile.dist.
I sent PRs to remove it #6314 and update it codeigniter4/devkit#38.

@kenjis kenjis removed the waiting for info Issues or pull requests that need further clarification from the author label Jul 29, 2022
@kenjis
Copy link
Member

kenjis commented Jul 30, 2022

The Vagrantfile.dist was moved to the devkit.
https://github.com/codeigniter4/devkit/blob/develop/README.md#hosting-with-vagrant

@kenjis kenjis closed this as completed Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests for documentation only
Projects
None yet
Development

No branches or pull requests

5 participants