Title: Weird bug: WordPress auto convert PHP to HTML code
Last modified: August 21, 2016

---

# Weird bug: WordPress auto convert PHP to HTML code

 *  Resolved [tien-nguyen](https://wordpress.org/support/users/tien-nguyen/)
 * (@tien-nguyen)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/weird-bug-wordpress-auto-convert-php-to-html-code/)
 * Dear all,
 * I just install a new Centos server with Ngnix and php-fpm.
 * Now, I am develop a template with my site at: bloggeritems.com
    But a weird error
   is when I code like below:
 *     ```
       <div class="blog-info">
       				<?php $fname = 'Blogger Items'; ?>
   
       				<?php if ( is_archive() ) : ?>
       					<h1 class="site-title"><?echo $fname;?></h1>
       				<?php else : ?>
       					<h2 class="site-title"><?echo $fname?></h2>
       				<?php endif; ?>
   
       				<p class="site-description"><?php bloginfo( 'description' ); ?></p>
       			</div>
       ```
   
 * The output result will like below:
 *     ```
       <div class="blog-info">
   
       									<h2 class="site-title"><!--?echo $fname?--></h2>
   
       				<p class="site-description">Blogger and Blogspot Organization created amazing templates, widget, guide, tips, discussions and all free for you.</p>
       			</div>
       ```
   
 * Mean `<?echo $fname;?>` in PHP will become `<!--?echo $fname?-->` in HTML
    This
   is WP bug or I am a noob?
 * Appreciate all helps.
 * Best regards,
    Tien Nguyen

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Ken Mackenzie](https://wordpress.org/support/users/kenmackenzie/)
 * (@kenmackenzie)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/weird-bug-wordpress-auto-convert-php-to-html-code/#post-4086411)
 * Looks like you probably dont have php shortcodes enabled so that php code that
   begins with “<?” is not recognised and therefore the code not executed. For example
   <? Echo $fname; ?>…
 * In your php.ini file on your server, search for and then make sure the following
   line is set as follows, then restart your web server software:
 * short_open_tag=On
 * That should fix it.
 * Cheers,
 * Ken
 *  [Ken Mackenzie](https://wordpress.org/support/users/kenmackenzie/)
 * (@kenmackenzie)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/weird-bug-wordpress-auto-convert-php-to-html-code/#post-4086412)
 * Or else , change all instances of <? to <?php
 * (:-)
 *  Thread Starter [tien-nguyen](https://wordpress.org/support/users/tien-nguyen/)
 * (@tien-nguyen)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/weird-bug-wordpress-auto-convert-php-to-html-code/#post-4086418)
 * Dear Ken,
 * Thank for your suggestion, it’s working now. I found NGNIX can not process <?,
   you must use <?php.
 * Best regards,
    Tien
 *  [davewatts](https://wordpress.org/support/users/davewatts/)
 * (@davewatts)
 * [12 years ago](https://wordpress.org/support/topic/weird-bug-wordpress-auto-convert-php-to-html-code/#post-4086456)
 * you could try this php/js/smarty online formatting tool, if you get stuck
 * [https://www.ejectamenta.com/online-apps/code2html.html](https://www.ejectamenta.com/online-apps/code2html.html)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Weird bug: WordPress auto convert PHP to HTML code’ is closed to new 
replies.

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [wordpress-theme](https://wordpress.org/support/topic-tag/wordpress-theme/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [davewatts](https://wordpress.org/support/users/davewatts/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/weird-bug-wordpress-auto-convert-php-to-html-code/#post-4086456)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
