Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By bransam on
Anyone have any idea why my index.php code is showing in my browser rather than the rendered HTML? I know this should be obvious to me, but I'm working on two hours sleep :(
Amy
Comments
Show link?
My best guess is that you have an open <code> or <pre> tag somewhere and you need to close it.
Are you sure you picked your
Are you sure you picked your php as your input type?
Can you post a sample? This might be it, depending: Junk {head} {styles} codes as output http://drupal.org/node/42080
Sounds like a server issue
Sounds like a server issue to me. Have you tried running another PHP file, such as phpinfo?
Yes, this is a server
Yes, this is a server problem. Many base setups only look to render .htm or .html files. You need to tell them to all look for .php files and execute them as well. Otherwise they will just render them as txt files. -Gman
phpinfo shows only code as well
Is this my hosting's problem, or something I'm doing wrong?
Is it just index.php? Try
Is it just index.php? Try putting a file like the one below in your web root and see if it renders...
If it doesn't work, then it's probably a php/server issue. If it does work, check that the opening php tag in your index.php is ok. Also, check the opening php tag on any modules or theme files you've recently opened.
http://www.trailheadinteractive.com
May be you used php short
May be you used php short syntax (<? ?>) instead of
in your file.
if
works fine, then this is server issue. Otherwise, it is php syntax issue. You can set "short_open_tag" on in your php.ini file.
kashif
www.kashifmughal.com
.htaccess file is the issue
I had a similar problem with a drupal 7.14 installation submitted from outside vendor. Replacing the .htaccess file under /drupal folder with a vesion from fresh drupal installation solved the problem.