phpapachedrupal-6parsing-error

PHP parsing error in Drupal-based website


I am working on a Drupal-based website that works fine on the remote server (LAMP stack) as well as all other developer's systems (WAMP stack). But when I try to run it, the PHP code is spit out in the browser along with the HTML instead of being parsed like it should.

There's very little information that I can glean from error logs. PHP itself is installed properly and a clean Drupal installation works. It's only the code that I check out from our repository that goes awry and only on my own system.

Pretty URL's also don't work, and I have to use the /q=xxx format to get to pages at all. Pretty URL's just end up with a parsing error in weird locations when there shouldn't be any parsing error there. I reiterate - the code works well everywhere else except on my system.

Is there even some place I can begin to look to solve this problem?

.p


Solution

  • If you see PHP code in the html then the interpreter is not being invoked. PHP is either not installed or mis-configured. Are you using short tags? If so, do you have the short tags option enabled in php.ini?

    An easy way to test this is to through out all the variables and try a simple php script outside of Drupal. Put the following in a script and run it. This could give you some idea of what's going on.

    <?php
      echo 'Hello World!';
    ?>
    
    <?
      echo 'Hello World!';
    ?>