logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Php does not run on virtual hosts

 
Post new topic   Reply to topic    Apache Forum Index -> Other Software



View previous topic :: View next topic  
Author Message
MattPaulin



Joined: 18 Feb 2016
Posts: 1
Location: New Zealand, Auckland

PostPosted: Thu 18 Feb '16 9:11    Post subject: Php does not run on virtual hosts Reply with quote

I've just installed a suse leap 42.1 lamp server. Seems to run fine but for this issue. Php files run fine in the primary htdocs directory, and if localhost/dir/file.php is used, but if addressed by www.domain.com/file.php they download rather than run. I have spent a day trying to figure out why. This is a new, default install, and I cannot find anywhere that the php facility is blocked for virtual hosts. I've checked php.ini http.conf, and the virtual host configuration file. It must be somewhere! I'm a Linux newbie so if someone could give me a pointer of exactly what to look for, or where, I'd really appreciate it.
Thx
Matt
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6255
Location: Germany, Next to Hamburg

PostPosted: Fri 26 Feb '16 11:45    Post subject: Reply with quote

it seems that PHP is only enabled for localhost and not in the global context.

Add this to your vhost

Code:

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Other Software
Page 1 of 1