# PHP path\_info problem

**URL:** <https://www.ruby-forum.com/t/php-path-info-problem/243917>\
**Category:** NGINX\
**Created:** [January 25, 2016, 6:32pm UTC](https://www.ruby-forum.com/t/php-path-info-problem/243917 "2016-01-25T18:32:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [January 25, 2016, 6:32pm UTC](https://www.ruby-forum.com/t/php-path-info-problem/243917/1 "2016-01-25T18:32:48Z")

</div>

I have a web app in php that relays on path\_info to processs a request  
but  
i always get a 404 when do  
[http://localhost/folder/app/app.php/controller/method](http://localhost/folder/app/app.php/controller/method)  
nginx always respond 404 any ideas how to solve this and gain access to  
the  
request  
i can acces to  
[http://localhost/folder/app/app.php](http://localhost/folder/app/app.php) but after last p in php extension  
anything else show up 404

---

<div class="post-metadata">

**Author:** ![Yoel\_JimSSnez\_Del\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@Yoel\_JimSSnez\_Del\_V](https://www.ruby-forum.com/u/Yoel_JimSSnez_Del_V)\
**Post date:** [January 26, 2016, 11:31pm UTC](https://www.ruby-forum.com/t/php-path-info-problem/243917/2 "2016-01-26T23:31:58Z")

</div>

On Mon, Jan 25, 2016 at 12:32:30PM -0500, Yoel Jimnez Del Valle wrote:

Hi there,

> I have a web app in php that relays on path\_info to processs a request but  
> i always get a 404 when do  
> [http://localhost/folder/app/app.php/controller/method](http://localhost/folder/app/app.php/controller/method)  
> nginx always respond 404 any ideas how to solve this and gain access to the  
> request

Which of your location{} blocks did you tell nginx to use to process  
the request for /folder/app/app.php/controller/method ?

Which of your location{} blocks do you want nginx to use to process  
that request?

> **[Module ngx\_http\_core\_module](http://nginx.org/en/docs/http/ngx_http_core_module.html#location)**
>
> This directive appeared in version 1.11.8.

> i can acces to  
> [http://localhost/folder/app/app.php](http://localhost/folder/app/app.php) but after last p in php extension  
> anything else show up 404

If you have “location ~ php$”, that would match the second request  
there,  
but not the first.

Perhaps you want “location ~ php” or “location /folder/app/app.php”  
or something else instead?

Good luck with it,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Yoel\_JimSSnez\_Del\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@Yoel\_JimSSnez\_Del\_V](https://www.ruby-forum.com/u/Yoel_JimSSnez_Del_V)\
**Post date:** [January 28, 2016, 9:43pm UTC](https://www.ruby-forum.com/t/php-path-info-problem/243917/3 "2016-01-28T21:43:57Z")

</div>

Enviado desde Outlook Mobile

De: Francis D.

Enviado: martes, 26 de enero 5:31 PM

Asunto: Re: PHP path\_info problem

Para: removed\_email\_address@domain.invalid

On Mon, Jan 25, 2016 at 12:32:30PM -0500, Yoel Jiménez Del Valle wrote:  
Hi there, \> I have a web app in php that relays on path\_info to processs  
a request but \> i always get a 404 when do \>  
[http://localhost/folder/app/app.php/controller/method](http://localhost/folder/app/app.php/controller/method) \> nginx always  
respond 404 any ideas how to solve this and gain access to the \> request  
Which of your location{} blocks did you tell nginx to use to process the  
request for /folder/app/app.php/controller/method ?

For instance i want yo access to /final/app/app.PHP/controller/action/  
i hace this location un nginx.conf

Location /final/app{

try\_files $uri /app.php$is\_args$args;

} but still same 404 im using wt-nmp tryin to move from apache

Which of your location{} blocks do you want nginx to use to process  
that request? [Module ngx\_http\_core\_module](http://nginx.org/r/location) \> i can acces to \>  
[http://localhost/folder/app/app.php](http://localhost/folder/app/app.php) but after last p in php extension \>  
anything else show up 404 If you have “location ~ php$”, that would  
match the second request there, but not the first. Perhaps you want  
“location ~ php” or “location /folder/app/app.php” or something else  
instead? Good luck with it, f – Francis D. removed\_email\_address@domain.invalid  
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ nginx mailing list  
removed\_email\_address@domain.invalid [nginx Info Page](http://mailman.nginx.org/mailman/listinfo/nginx)

---

<div class="post-metadata">

**Author:** ![Yoel\_JimSSnez\_Del\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/9de0a6/32.png) [@Yoel\_JimSSnez\_Del\_V](https://www.ruby-forum.com/u/Yoel_JimSSnez_Del_V)\
**Post date:** [January 28, 2016, 11:58pm UTC](https://www.ruby-forum.com/t/php-path-info-problem/243917/4 "2016-01-28T23:58:19Z")

</div>

On Thu, Jan 28, 2016 at 08:43:13PM +0000, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Hi there,

> For instance i want yo access to /final/app/app.PHP/controller/action/ i hace  
> this location un nginx.conf
> 
> Location /final/app{
> 
> try\_files $uri /app.php$is\_args$args;
> 
> } but still same 404 im using wt-nmp tryin to move from apache

So the request /final/app/app.PHP/controller/action/ will serve the  
file $document\_root/final/app/app.PHP/controller/action/ if it exists,  
or it will do an internal rewrite to the url /app.php.

Which location{} in your config will handle that (sub)request?

The page at

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.

comes up when I search for “php nginx path\_info”. It has an example  
configuration that may be worth examining.

Good luck with it,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
