Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The HTTP server is serving source code because of the braindead system of HTTP routing that PHP encouraged (because it's "easy") whereby scripts are stored in the root path amongst resources, and the file system is used for routing. In other languages the HTTP server doesn't even know where the source code is.


First, thank you for hating PHP, i'd hate to see it ending up like javascript, especially when ppl misunderstand basic things like this. This 'braindead' system is how the web has been designed from the start. And that issue can easily be mitigated by having using an index.php that simply does require('../app/app.php'). Serving files as text really has nothing to do with PHP since PHP interpreter isnt even invoked at all.


> scripts are stored in the root path amongst resources

that has been a known and documented bad practice for _at least_ 10 years.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: