# .XML running PHP getting 403

**URL:** <https://www.ruby-forum.com/t/xml-running-php-getting-403/244113>\
**Category:** NGINX\
**Created:** [February 22, 2016, 12:46pm UTC](https://www.ruby-forum.com/t/xml-running-php-getting-403/244113 "2016-02-22T12:46:43Z")\
**Posts on this page:** 2\
**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:** [February 22, 2016, 12:46pm UTC](https://www.ruby-forum.com/t/xml-running-php-getting-403/244113/1 "2016-02-22T12:46:43Z")

</div>

Hi,

I want a PHP file to have the extension of .xml but when i do the below  
when  
accessing the php file via web browser i get a access denied.

location ~ ^(.+.xml)(/.\*)?$ {  
fastcgi\_pass unix:/var/run/php5-fpm.sock;  
fastcgi\_index index.php;  
include fastcgi.conf;  
}

do i need to add anything like allow or something to this block?

Posted at Nginx Forum:

> **[.XML running PHP getting 403](https://forum.nginx.org/read.php?2,264704,264704#msg-264704)**
>
> Hi, I want a PHP file to have the extension of .xml but when i do the below when accessing the php file via web browser i get a access denied. location ~ ^(.+\\.xml)(/.\*)?$ { fastcgi\_pass unix:/var/run/php5-fpm.sock; fastcgi\_index index.php;

---

<div class="post-metadata">

**Author:** ![txt3rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/9de0a6/32.png) [@txt3rob](https://www.ruby-forum.com/u/txt3rob)\
**Post date:** [February 22, 2016, 2:10pm UTC](https://www.ruby-forum.com/t/xml-running-php-getting-403/244113/2 "2016-02-22T14:10:15Z")

</div>

Hello,

On 2/22/16 6:46 AM, txt3rob wrote:

> do i need to add anything like allow or something to this block?

You can uncomment “security.limit\_extensions” in php-fpm.conf (or  
whatever your OS uses to configure php-fpm and its pools) and set it  
there, like:

security.limit\_extensions = .php .xml

–  
Jim O.

“Never argue with a fool, onlookers may not be able to tell the  
difference.” - Mark Twain
