8

Is there a way to run PHP scripts in django? I have a plugin in TinyMCE that runs PHP scripts, and it is able to work using XAMPP's Apache. However, Django does support running of PHP script and therefore the plugin is not able to work. I would like to know if there is a way to configure Django to run PHP scripts.

Any help or pointers appreciated. Many Thanks!

1
  • 2
    This question is not clear. Apache can continue to run PHP while also running a Django site with mod_wsgi. I don't understand why you think you need Django to run the PHP scripts. Commented Sep 13, 2012 at 17:50

2 Answers 2

6

Django isn't a HTTP server. You need a HTTP server like Apache, Nginx, etc along with the correct php module to run your PHP script.

Then you can configure Django to run on the same server. Here's an howto for running Django with Apache https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/. Then you can configure your PHP script to run on the same server.

After that, how your PHP script interacts with Django project is implementation specific.

Sign up to request clarification or add additional context in comments.

1 Comment

This is the best answer
4

Well, there's Django-php which lets you run PHP in Django templates - http://animuchan.net/django_php/

Though I'd draw your attention to the FAQ section of that website.

3 Comments

the faq is hilarious..+1 just for that
@moopet the link is broken

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.