WebFaction
Community site: login faq

I'm wanting to run a little php script and iframe it into my osqa sidebar. Is it possible that I could do this? If so.. what directory would I put my php script in, on the osqa site, to be able to show it in the browser?

Thanks!

asked 06 Feb '12, 15:20

andi
5335
accept rate: 0%


No, it's not possible to actually run PHP from within your Django site. Requests to Django go from the front-end Nginx server directly to your application's Apache which serves Django via mod_wsgi. There isn't any PHP support in this stack.

To do what you're attempting to do, you will want to create a separate Static/CGI/PHP application mounted to a URL subpath as described in our website record documentation. You can use this to put your script at something like http://www.example.com/phpscript/ . Then, you just serve that URL in your iframe.

This works because the entire /phpscript subpath is redirected to the server-wide Apache+PHP server which can handle your PHP script and produce output. The iframe is just referencing that URL.

Hope that helps!

permanent link

answered 06 Feb '12, 19:38

ryans ♦♦
5.0k103860
accept rate: 43%

Perfect. Thanks so much!!

(06 Feb '12, 20:00) andi
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×265
×43

question asked: 06 Feb '12, 15:20

question was seen: 16,673 times

last updated: 06 Feb '12, 20:00

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM