CI-Craftsman / CLI

Craftsman provides a number of helpful commands for your use while developing your Codeigniter application.
Creative Commons Attribution Share Alike 4.0 International
16 stars 7 forks source link

Serve command runs twice? #8

Open indrakaw opened 6 years ago

indrakaw commented 6 years ago

For unknown reasons, serve command runs twice.

➜  ci-boilerplate git:(01-stupid-webcomic-app/master) ✗ vendor/bin/craftsman serve --docroot=./
Codeigniter development server started at Tue, 16 Oct 2018 16:35:45 +0700
Listening on http://localhost:8000
Document root is /home/noitu/projects/ci-boilerplate
Press Ctrl-C to quit.
PHP 7.2.10-0ubuntu0.18.04.1 Development Server started at Tue Oct 16 16:35:45 2018
Listening on http://localhost:8000
Document root is /home/noitu/projects/ci-boilerplate
Press Ctrl-C to quit.
[Tue Oct 16 16:35:59 2018] ::1:33622 [200]: /
[Tue Oct 16 16:36:00 2018] ::1:33624 [200]: /favicon.ico
^C

Then, I tried to rerun the command again. An error occurs.

➜  ci-boilerplate git:(01-stupid-webcomic-app/master) ✗ vendor/bin/craftsman serve --docroot=./
Codeigniter development server started at Tue, 16 Oct 2018 16:36:18 +0700
Listening on http://localhost:8000
Document root is /home/noitu/projects/ci-boilerplate
Press Ctrl-C to quit.
[Tue Oct 16 16:36:18 2018] Failed to listen on localhost:8000 (reason: Address already in use)
➜  ci-boilerplate git:(01-stupid-webcomic-app/master) ✗ 

I had to kill php process via htop.

This is my .craftsman file:

BASEPATH="./vendor/codeigniter/framework/system/"
APPPATH="./application/"
CI_FCPATH="./"

Yes, index.php is on project root. And it serves without problems.

indrakaw commented 6 years ago

Additional info: vendor/bin/craftsman serve without docroot argv doesn't work.

➜  ci-boilerplate git:(01-stupid-webcomic-app/master) ✗ application/vendor/bin/craftsman serve             
Codeigniter development server started at Tue, 16 Oct 2018 16:45:22 +0700
Listening on http://localhost:8000
Document root is /home/noitu/projects/ci-boilerplate
Press Ctrl-C to quit.
Directory  does not exist.
➜  ci-boilerplate git:(01-stupid-webcomic-app/master) ✗