PHP not working on sub-server

8 posts / 0 new
Last post
#1 Wed, 10/23/2013 - 09:24
Kenny26

PHP not working on sub-server

Hello, I have a dedicated server running on Debian 7. I installed Webmin and configure my domain as domaine.com. I uploaded my Wordpress into the public_html folder on the FTP.

I then created a sub-server to get a subdomain like dev.domain.com or I want to install different or CMS website to get familiar with them.

But I have a problem when executing php files on dev.domain.com address, the files are not interpreted and e I see their contents directly appear in my browser.

Here is a screenshot: http://picsup.fr/xR

Thank you for your help.

Wed, 10/23/2013 - 10:11
andreychek

Howdy,

Hmm, sub-servers should work without a problem on Debian 7.

Which PHP version are you using?

You can determine by running the command "php -v".

-Eric

Wed, 10/23/2013 - 11:24
Kenny26

Thanks for reply :)

I'm using PHP 5.4.4

Wed, 10/23/2013 - 14:17
andreychek

Hmm, that appears to be correct.

Is there by chance a .htaccess file in the public_html folder?

Having a .htaccess file with certain lines in it could cause what you're describing... if you have one, try renaming it to "htaccess.old" or something like that and see if you continue to observe the same behavior.

-Eric

Wed, 10/23/2013 - 14:31
Kenny26

On the domain.com public_html i have a .htaccess for wordpress.

I rename it but it's not working when i try to run wordpress on dev.domain.com :(

Wed, 10/23/2013 - 19:43
andreychek

If you go into System Settings -> Re-Check Config, does it detect any problems?

-Eric

Thu, 10/24/2013 - 14:22
Kenny26

Hi, I have no error when i re-check config.

I have try something today:

I have try a modification on php5.conf in /etc/apache2/mods-available/ When I uncomment SetHandler application/x-httpd-php php work on dev.domain.com but not on domain.com.

If that can guide you on search...

Thanks

Fri, 03/21/2014 - 23:26
mojojuju

I've been experiencing this same problem with Virtualmin GPL on a OpenVZ VPS running Debian 7.

The server is not a subserver, but a top level server. I'm pretty familiar with installing Virtualmin, and everything usually works great out of the box, but with this particular install on Debian 7, php scripts aren't being executed and are being shown as plain text.

The server is using mod_php.

What fixed the problem for me was to add the following lines to /etc/apache2/mods-available/mime.conf :

AddHandler php5-script .php AddType text/html .php

After saving and reloading Apache, PHP scripts are running fine.

Topic locked