osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Lies in education [was Re: The "loop and a half"]


On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans <tjol at tjol.eu> wrote:
> On 2017-10-12 07:31, Chris Angelico wrote:
>> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse <ben.usenet at bsb.me.uk> wrote:
>>> Provided some early part of the URL is handled by PHP, the rest of the
>>> URL path is provided to PHP in $_SERVER["PATH_INFO"].
>>
>> Is it possible to do that without having ".php" visible in the path?
>
> Just like with Python-based frameworks, this requires a few lines of web
> server configuration.
>
> On Apache, you might use mod_wsgi to tell the server how to run the code
> in one case, and a combination of mod_php and mod_rewrite in the other.
> If you're using FastCGI with nginx or lighttpd, I believe the
> configuration would look pretty similar in both cases.
>
> Then again, I don't do much web programming any more and generally stay
> away from PHP, so I may be misremembering.

Normally, with a Python-based framework, you don't need _any_ web
server configuration. You simply define your URL routing within the
Python code. The only thing the web server needs to know is where to
find the web app, and that's sufficiently standard that it can be done
off-the-shelf; for instance, you push your code to Heroku, and they
set everything up to pass requests to your app. Not possible with PHP,
since you need *custom* web server config to manage your rewrite
rules.

ChrisA