Apache, not running php on top level

Hi guys/gals,

We were playing with our deb linux server with some upgrades and looks like something was misadjusted


What he have now is PHP not rendering the top level domain showing source code instead.  

www.example.com  - >> shows the php source code as plain text


www.example.com/test  - >> php works fine


We just updated php 5.5 to php 5. 6
Everything was working fine before.

I know its something easy we missed,  any ideas?  thanks
LVL 15
Ess KayEntrapenuerAsked:
Who is Participating?
 
gplanaConnect With a Mentor Commented:
looks like php is not enabled. Try this:

sudo a2enmod php5

and restart apache:

sudo service apache2 restart
0
 
Randy DownsOWNERCommented:
Maybe there is another page being executed rather than index.php.

This in .htaccess?

DirectoryIndex index.php
0
 
Ess KayEntrapenuerAuthor Commented:
read full question please

php WORKS just not top level
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Julian HansenCommented:
Can we see your httpd.conf
0
 
Ess KayEntrapenuerAuthor Commented:
heres an example

Doesn't work :
example1.com


works:
example1.com/index.php
example1.com/bla/
example1. com/bla/index.php
0
 
Randy DownsOWNERCommented:
example1.com will open default page. How about example1.com/index.php?
0
 
Ess KayEntrapenuerAuthor Commented:
example1.com opens index.php  but doesn't run php,  just shows  raw code


example1.com/index.php  executes the php,  shows desired output
0
 
Randy DownsOWNERCommented:
Is there another index.html file or something similar (e.g., index,htm) that is opening or is it really index.php that is showing the code?
0
 
gplanaCommented:
I think the problem can be on .htaccess file on the root. Maybe if you attach this file we can help you.
0
 
Ess KayEntrapenuerAuthor Commented:
i doubt that is the issue,  as we host about 80 domains on the server and issue is for each domain after the update
0
 
Ess KayEntrapenuerAuthor Commented:
heres on htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Open in new window

0
 
Randy DownsOWNERCommented:
Try adding this to .htacess

DirectoryIndex index.php
0
 
Ess KayEntrapenuerAuthor Commented:
index.php is default already,  just doesn't render the php,  shows code instead
0
 
Ess KayEntrapenuerAuthor Commented:
Thanks fellas.  Looks like issue was local.  

But what fixed the issue originally was this comment so hes getting some points.



Was seeing the cached version of page.

Simple refresh fixed issue locally,  Otherwise it was working the entire time


Thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.