Why are my PHP files are not being executed (PHP keywords/syntax being ignored)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jarrett.roberts@gmail.com

    Why are my PHP files are not being executed (PHP keywords/syntax being ignored)

    I have been hosting a website on the same server for roughly 2 years.
    The entire site is based on a group of PHP scripts. Today, without
    changing a thing, the server stopped recognizing all PHP keywords and
    syntax. When I use firefox, the page simply displays a text/plain
    version of my source code. When I use IE, the page loads as text/html,
    however, all lines of PHP code (between "<?" and "?>") are displayed as
    text.

    My assumption is that my host has stopped providing PHP extensions.
    Can anybody confirm this or give me another explanation?

    All help is greatly appreciated!

    -JR

  • Gordon Burditt

    #2
    Re: Why are my PHP files are not being executed (PHP keywords/syntax being ignored)

    >I have been hosting a website on the same server for roughly 2 years.[color=blue]
    >The entire site is based on a group of PHP scripts. Today, without
    >changing a thing, the server stopped recognizing all PHP keywords and
    >syntax. When I use firefox, the page simply displays a text/plain
    >version of my source code. When I use IE, the page loads as text/html,
    >however, all lines of PHP code (between "<?" and "?>") are displayed as
    >text.
    >
    >My assumption is that my host has stopped providing PHP extensions.
    >Can anybody confirm this or give me another explanation?
    >
    >All help is greatly appreciated![/color]

    Your files are not being treated as PHP, but as text. It is possible
    that the Apache directive to treat .php files as PHP got lost.
    (It's possible this was in one of YOUR .htaccess files, rather than
    the Apache config file, but if the host is offering PHP, there's
    not a lot of point in making it difficult to use.)

    Or PHP is broken (I've managed to do this to myself upgrading some
    of the libraries PHP uses.) Or your host upgraded Apache and didn't
    configure in PHP. Ask your host what's going on.

    Incidentally, it's just this sort of thing that makes it worthwhile
    to keep stuff like DB passwords *OUTSIDE* the document tree. If PHP
    breaks, as it has apparently in your case, it still won't serve
    the passwords. If it's not broken, PHP can get to it, but it will
    use it, not display it, assuming the code is written to do that.

    Gordon L. Burditt

    Comment

    • Colin McKinnon

      #3
      Re: Why are my PHP files are not being executed (PHP keywords/syntax being ignored)

      jarrett.roberts @gmail.com wrote:
      [color=blue]
      > I have been hosting a website on the same server for roughly 2 years.
      > The entire site is based on a group of PHP scripts. Today, without
      > changing a thing, the server stopped recognizing all PHP keywords and
      > syntax. When I use firefox, the page simply displays a text/plain
      > version of my source code. When I use IE, the page loads as text/html,
      > however, all lines of PHP code (between "<?" and "?>") are displayed as
      > text.
      >
      > My assumption is that my host has stopped providing PHP extensions.
      > Can anybody confirm this or give me another explanation?
      >
      > All help is greatly appreciated!
      >[/color]

      Don't you use '<?php' to start your code blocks? Maybe the provider has
      switched short_open_tag off.

      C.

      Comment

      Working...