# Executing php script inside public directory

**URL:** <https://www.ruby-forum.com/t/executing-php-script-inside-public-directory/70072>\
**Category:** Radiant CMS\
**Created:** [September 26, 2006, 5:59pm UTC](https://www.ruby-forum.com/t/executing-php-script-inside-public-directory/70072 "2006-09-26T17:59:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [September 26, 2006, 5:59pm UTC](https://www.ruby-forum.com/t/executing-php-script-inside-public-directory/70072/1 "2006-09-26T17:59:27Z")

</div>

I’ve a PHP script (an online survey software) which I’d like to execute  
along Radiant. I copied the script (which is working well under another  
non-radiant served domain) under /myradiantapp/public directory. I  
modified  
the /myradiantapp/.htaccess file as follows:

RewriteCond %{REQUEST\_URI} ^/survey/.\*  
RewriteRule .\* - [L]

What I get is not parsed by radiant but the PHP script is not executed  
when  
I invoke this URL:

[http://www.example.com/survey/index.php](http://www.example.com/survey/index.php)

but it is simply shown by the browser as if it were a plain text file.

I guess is a PHP configuration issue (since it seems radiant  
relinquished  
its control on the pph script file), but the very same script worked  
well on  
the same machine (with the same php and apache configuration).

I’m running a vps on rimuhosting.

Any help would be appreciated. Thank you.

–M

---

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [September 26, 2006, 6:03pm UTC](https://www.ruby-forum.com/t/executing-php-script-inside-public-directory/70072/2 "2006-09-26T18:03:27Z")

</div>

One thing you may want to check is that your php configuration was not  
specified in the .htaccess where your survey script previously lived.  
It may be that the server hasn’t been told to process .php files as  
php scripts in the new location.

Kev

> **[Digital Marketing Agency Glasgow | Digital Blueprint | Scotland](https://www.digitalblueprint.co.uk/)**
>
> Digital Blueprint is a full-service creative design and digital marketing agency that helps visionary companies realise their strengths and elevate their brands, crafting authentic experiences that engage and inspire audiences at every touch point.

On 9/26/06, Maurizio B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Any help would be appreciated. Thank you.

–  
Kevin A.

Technical Director  
BN23 Search Ltd.

---

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [September 26, 2006, 8:53pm UTC](https://www.ruby-forum.com/t/executing-php-script-inside-public-directory/70072/3 "2006-09-26T20:53:53Z")

</div>

I think whats happening is that your php files are still trying to be  
served by the ruby server. Try changing the proxy setup to something  
like this:

ProxyRequests Off  
ProxyPreserveHost On  
ProxyPass /survey !  
ProxyPass / [http://localhost:2502/](http://localhost:2502/)  
ProxyPassReverse / [http://localhost:2502/](http://localhost:2502/)

Notice the extra line with “/survey !” in there. This should stop  
apache from sending requests that start with /survey to the proxy  
server.

Hope it helps, or at least provides some other directions to look at.

Kev

> **[Digital Marketing Agency Glasgow | Digital Blueprint | Scotland](https://www.digitalblueprint.co.uk/)**
>
> Digital Blueprint is a full-service creative design and digital marketing agency that helps visionary companies realise their strengths and elevate their brands, crafting authentic experiences that engage and inspire audiences at every touch point.

On 9/26/06, Maurizio B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Search: [http://radiantcms.org/mailing-list/search/](http://radiantcms.org/mailing-list/search/)  
> Site:  
> [http://lists.radiantcms.org/mailman/listinfo/radiant](http://lists.radiantcms.org/mailman/listinfo/radiant)

–  
Kevin A.

Technical Director  
BN23 Search Ltd.

---

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [September 26, 2006, 9:43pm UTC](https://www.ruby-forum.com/t/executing-php-script-inside-public-directory/70072/4 "2006-09-26T21:43:57Z")

</div>

Kev, you are great, man. The /survey ! directive did the trick! Many  
thanks.  
–Maurizio

---

<div class="post-metadata">

**Author:** ![Maurizio\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@Maurizio\_B](https://www.ruby-forum.com/u/Maurizio_B)\
**Post date:** [September 26, 2006, 8:37pm UTC](https://www.ruby-forum.com/t/executing-php-script-inside-public-directory/70072/5 "2006-09-26T20:37:51Z")

</div>

All configurations parameters are in the httpd.con files:

[http://pastie.caboo.se/15005](http://pastie.caboo.se/15005)

It seems the only different setting is in the proxypass directive for  
the  
radiant-powered web site versus the static-php one.

Any ideas, suggestion?

Thank you.
