0

When using the built-in PHP server I can't fall back on PHP when calling a non-existent static (css) file. What I want is that, if I request a css file, and it isn't there, that it is generated on the fly.

But the built-in PHP server simply returns a 404. Other webservers do fall back to PHP so there the css file is generated as expected.

How can I set up my script works as I want in the built-in PHP server as well?

wout
  • 2,477
  • 2
  • 21
  • 32
  • If I am guessing correctly what you want you would need to handle this yourself in the php script your executing with the webserver. But really: just install a proper webserver – PeeHaa Dec 02 '15 at 19:56
  • Or this dupe http://stackoverflow.com/a/27384348/508666 – PeeHaa Dec 02 '15 at 19:59
  • Ok, it's not my intention to use the built-in server in a production environment. On the contrary, it's intended to be in a development environment and I am looking for consistent behaviour between development (built-in PHP server) and production (Apache/Nginx/...). I am aware of the Apache solutions but I have to use the built-in PHP server, no choice. Neither of the links you proposed provide me a solution. I just want the built-in PHP server to first listen to me before deciding a file does not exist. – wout Dec 02 '15 at 20:23
  • The webserver is *not* a fully featured server so it *will* lack functionality. – PeeHaa Dec 02 '15 at 20:29
  • Agreed, so there is _no_ way around? – wout Dec 02 '15 at 20:33
  • The way around is either following the dupe and checking whether the file exists yourself or install a proper webserver – PeeHaa Dec 02 '15 at 20:34

0 Answers0