Re: Setting up Django and PHP with Apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I fixed it! The AddType was indeed sufficient, but it was wrong! It was supposed to be application/x-httpd-php not application/x-httpd-php5. Silly mistake.
On Nov 28, 2007 12:11 PM, Victor Trac < victor.trac@xxxxxxxxx> wrote:
On Nov 28, 2007 1:52 AM, Matt Magin <matt.azmoo@xxxxxxxxx> wrote:
Hi there.

I'm trying to set up Apache so that Django and PHP5 will work together. I want it so that Django is set up to control everything in the document root, with PHP5 enabled for specific directories. I can get both to work separately, but I can't seem to get them to work in parallel.

For Django I have:

<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/usr/local/www/djangoapps'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE intranet.settings
PythonDebug On
</Location>

This works fine. Django is all up and running and life is good.

Then I have this:

<Location /safetysigns/>
AddType application/x-httpd-php5 .php
SetHandler default-handler
</Location>

But every time I try and access the /safetysigns/index.php page it just prompts me to download the source.

There are no messages in the error log, which is really frustrating me.

Any ideas?

Cheers,
Matt

You should take out the "SetHandler default-handler" directive, which tells apache to handle it as static content rather than pass it off externally to the php parser.  The AddType by itself should be sufficient, provided PHP is actually loaded via mod_php or cgi.

--
http://www.victortrac.com


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux