XinYi Chua
XinYi Chua

Reputation: 281

Running PHP in Django

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!

Upvotes: 8

Views: 18667

Answers (2)

moopet
moopet

Reputation: 6185

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.

Upvotes: 4

mehulved
mehulved

Reputation: 381

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.

Upvotes: 6

Related Questions