views:

101

answers:

2

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

+3  A: 

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!';
?>
Mike B
Turned out to be an issue with short tags. Previous devs working on the project were ASP ninjas and didn't know this could be a stumbling block. I haven't used short tags with PHP since forever, so it never occurred to me to check that out.Thanks for the quick help. I can now go on vacation in peace. :)
Pranav Negandhi
A: 

If you created a note, and then used PHP code as body of the node, then check the input format has been set to "PHP code"; differently, the PHP code will be parsed as text, and the <?php ?> tags escaped.
This would explain why you see them.

If this is not the case, then I would check what reported by Mike B, or that the files with extension .php are not considered PHP files.

kiamlaluno