Solved

Apache,  not running php on top level

Posted on 2016-09-20
14
71 Views
Last Modified: 2016-09-20
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
0
Comment
Question by:Ess Kay
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 29

Expert Comment

by:Randy Downs
ID: 41806498
Maybe there is another page being executed rather than index.php.

This in .htaccess?

DirectoryIndex index.php
0
 
LVL 15

Accepted Solution

by:
gplana earned 500 total points
ID: 41806499
looks like php is not enabled. Try this:

sudo a2enmod php5

and restart apache:

sudo service apache2 restart
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 41806504
read full question please

php WORKS just not top level
0
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
LVL 55

Expert Comment

by:Julian Hansen
ID: 41806505
Can we see your httpd.conf
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 41806516
heres an example

Doesn't work :
example1.com


works:
example1.com/index.php
example1.com/bla/
example1. com/bla/index.php
0
 
LVL 29

Expert Comment

by:Randy Downs
ID: 41806526
example1.com will open default page. How about example1.com/index.php?
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 41806532
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
 
LVL 29

Expert Comment

by:Randy Downs
ID: 41806558
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
 
LVL 15

Expert Comment

by:gplana
ID: 41806560
I think the problem can be on .htaccess file on the root. Maybe if you attach this file we can help you.
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 41806564
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
 
LVL 15

Author Comment

by:Ess Kay
ID: 41806570
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
 
LVL 29

Expert Comment

by:Randy Downs
ID: 41806577
Try adding this to .htacess

DirectoryIndex index.php
0
 
LVL 15

Author Comment

by:Ess Kay
ID: 41806587
index.php is default already,  just doesn't render the php,  shows code instead
0
 
LVL 15

Author Closing Comment

by:Ess Kay
ID: 41806624
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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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 …

820 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