3

Trying to run phalcon 2.0.7 app using built-in http server in php 5.6 and included .htrouter to make URI rewrite working. Everything seems find until I use die() in controller. For the first time it works as expected but when refreshed it throws PHP fatal error:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required '.htrouter.php' (include_path='.:') in Unknown on line 0

Is there a way to fix that or should I start configuring other http server?

aambrozkiewicz
  • 542
  • 3
  • 14
  • I tested with this [Main Doc](https://docs.phalconphp.com/en/latest/reference/built-in.html) & it's works perfectly. does your `.htrouter.php` have correct code? – M2sh Sep 14 '15 at 09:09
  • Didn't change anything, project created by phalcon dev-tools – aambrozkiewicz Sep 14 '15 at 11:46
  • which type of proeject did you create & use? (micro,simple,multi) – M2sh Sep 14 '15 at 11:55
  • Whatever the default is, I guess it's simple – aambrozkiewicz Sep 14 '15 at 11:58
  • Ok, does your `.htrouter.php` has `.php` extension ? & the content of it is the same as the Main doc? – M2sh Sep 14 '15 at 12:06
  • yes and yes. you see, everything is fine until I use die() somewhere in controller, then this occurs. Did you try that? – aambrozkiewicz Sep 14 '15 at 14:20
  • yes, i test it & no problem with `die()` function. where you locate `.htrouter.php` ? did you launch your webserver exactly like : `php -S localhost:8000 -t public .htrouter.php` ? – M2sh Sep 14 '15 at 16:28
  • Sorry, late answer but yes, everything as you said. first request prints die message and then for the next requests it fails with fatal errors – aambrozkiewicz Sep 19 '15 at 09:51
  • hmm, i don't know other solution. try ask in phalconphp forum, may be you can find your solution. – M2sh Sep 19 '15 at 09:53

1 Answers1

1

I had the .htrouter in my public dir so this helped a lot:

php -S localhost:8000 -t public public/.htrouter.php :)
Nissa
  • 4,636
  • 8
  • 29
  • 37
Julius Koronci
  • 408
  • 4
  • 10