Solved

Apache Error when using AllowOverride All

Posted on 2009-03-31
3
545 Views
Last Modified: 2013-12-13
Hi,

I am trying to get CakePHP on subdomains working on Aptana Cloud.

I have edited httpd.conf and added a VirtualHost (see code below). This all seems to work but I am getting an error when accessing php. From searching I have found that the solution is to change AllowOverride from None to All, I have done this but now every time I visit the site I get a dialog asking me if I want to download the php file. If I change it back to None then the files load but with a php error.

Any ideas what is wrong with it?

Thanks

Mike
<VirtualHost *:80>

DocumentRoot /path/to/files

ServerName subdomain.mydomain.com

<Directory /path/to/files>

    Options Indexes FollowSymLinks

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

</VirtualHost>

Open in new window

0
Comment
Question by:learnitlists
3 Comments
 

Accepted Solution

by:
learnitlists earned 0 total points
ID: 24034174
Ok I solved it finally, I had a legacy AddHandler in one of my .htaccess files which was causing the problem.
0
 
LVL 6

Expert Comment

by:karlwilbur
ID: 24173386
Awesome that you solved the problem. You might want to post a little more detail as to exactly how the legacy AddHandler directive was triping you up. This will help others that may have a similar issue.

Also, FWIW, I try to avoid "AllowOverride All" if at all possible. I explicitly allow only what is needed in the htaccess file.
E.G.
For ModRewrite:
    AllowOverride FileInfo

For Basic Authentication:
    AllowOverride AuthConfig

For Throttling:
    AllowOverride Limit
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now