Skip to content

PHP Code Being Output Instead Of Rendered

Share

This may start to happen with some of your php scripts following a php upgrade.
Rather then your PHP code being rendered, instead you get a page full of the actual code.

This is do to the way the file was written, it’s most likely using the short hand php open tag:

<?

instead of

<?php

You can either modify your code so it’s using the full

<?php

or you can do 1 of the following.

Enable short_open_tag through php.ini

Find the line that says

short_open_tag = Off

in your php.ini file and change it to on.

Enable short_open_tag through .htaccess

In order to enable this through your .htaccess file you need to add the following line.

php_flag short_open_tag off

I hope this helps.

Share Our Posts

Share this post through social bookmarks.

  • Delicious
  • Digg
  • Newsvine
  • RSS
  • StumbleUpon
  • Technorati

Related posts:

  1. PHP Warning: date() and strftime()

Comments

Tell us what do you think.

There are no comments on this entry.

Trackbacks

Websites mentioned my entry.

There are no trackbacks on this entry

Add a Comment

Fill in the form and submit.

Twitter Status

Archives