Tam PATH_INFO'yu PHP nedir?

1 Cevap php

all external URLs look like 'module/action?key1=param1'. No customization possible--but it's fast. The difference is that the first uses PHP's GET, and the second uses PATH_INFO.

I PATH_INFO birkaç kez gördüm, ama hala tam olarak ne olduğunu bilmiyorum?

1 Cevap

Aslında, PATH_INFO Apache Web Sunucusu başı demek PHP PHP sayfaları hizmet ve ilişkili olup.

PATH_INFO AcceptPathInfo direktifi açık olduğunda Apache tarafından belirlenen bir ortam değişkendir. Bu gerçek bir dosya adı (veya varolan bir dizinde olmayan dosya) kabul veya red edilecektir şu yol_adı bilgi sondaki içerecektir. Çevre değişkenleri sonra sayfayı render sorumlu Apache / CGI modülü aktarılmaktadır.

Değişken $_SERVER['PATH_INFO'] PHP kullanarak erişilebilir.

Örneğin, konumu sadece tek bir dosya here.html içeren bir dizine /test/ puan varsayalım. Daha sonra /test/here.html/more ve /test/nothere.html/more hem /more PATH_INFO olarak toplamak için talep eder.

Apache Core Documentation: AcceptPathInfo Yönergesi