Title: wp-blog-header.php problem in external html
Last modified: August 22, 2016

---

# wp-blog-header.php problem in external html

 *  [wdevel](https://wordpress.org/support/users/wdevel/)
 * (@wdevel)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wp-blog-headerphp-problem-in-external-html/)
 * Hello,
 * I have a WP in a directory (eg. /wp/)
    The domain is [http://www.example.com](http://www.example.com)(
   for example).
 * I have implement some fuctions from WP to my main index.html file. To be specific
   I parse the Featured Images from the 20 latest posts.
 * Code is this:
 * Above the HTML tag
 *     ```
       <?
   
       define('WP_USE_THEMES', false);
       include('wp/wp-blog-header.php'); <-- Cause WSOD + strange Characters
       //include('/wp/wp-blog-header.php');  <--- NO WSOD But The code doesn't work
       //include(dirname(__FILE__) .'/wp/wp-blog-header.php'); <--- NO WSOD But The code doesn't work
       //include($_SERVER['DOCUMENT_ROOT'].'/wp/wp-blog-header.php'); <-- NO WSOD But The code doesn't work
       ?>
       ```
   
 * In Body Tag:
 *     ```
       <?php
       	$counterPost = 1;
         $thumbnails = get_posts('numberposts=6');
         foreach ($thumbnails as $thumbnail) {
           if ( has_post_thumbnail($thumbnail->ID)) {
       		$counterPost ++;
             echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">';
             echo get_the_post_thumbnail($thumbnail->ID, array(120,120));
             echo '</a>';
             echo '  ';
           }
           if ($counterPost % 2 != 0){
       	echo '<br><br>';
       	}
         }
       ?>
       ```
   
 * I have just update to the latest version and I have the following issue:
 * In [http://www.example.com/](http://www.example.com/) or [http://www.example.com/index.html](http://www.example.com/index.html)
   I have a White Screen of Death and some strange characters (like on this post:
   [http://wordpress.stackexchange.com/questions/115219/strange-characters-appeared-in-header](http://wordpress.stackexchange.com/questions/115219/strange-characters-appeared-in-header))
   I am using `include` to bypass the `require` Fatal Error But I still got (Fatal)
   problem – a WSOD.
 * The most “fascinating thing” is that IF I try to access to my site like this:
   [http://example.com/](http://example.com/) or [http://example.com/index.html](http://example.com/index.html)**–
   Without www–** I didnt see any problem. As you can see the problem is only in
   the (**www**) .
 * Of course, I am using apache 2.2.x and WHM/Cpanel the latest, and the www is 
   a symbolic link to public_html. I double check the permissions and everything
   is 644 and 755 for folders.
 * Also, I has some custom rewrite rules to redirect the traffic from non-www to
   www, but I have disabled it for testing reason, till the time that I can find
   a solution about that problem with the wp-blog-header.php.
 * Moreover, The MOST fascinating thing is that:
    I have copied the index.html and
   I rename it to ind2.html. I tried to access the **www**.example.com/ind2.html
   and **EVERYTHING works!** I haven’t a WSOD, No Strange characters, Nothing. These
   2 files (index.html and ind2.html) are exactly the same.
 * Whats going on ?? Any thoughts? How can I fix it ??
 * Can you suggest me any other code to see the Feature images (and to be hyperlinked)
   in the external html page ?
 * PHP Error_log from root folder:
 *     ```
       [18-Sep-2014 22:45:55 UTC] PHP Warning:  include(/wp/wp-blog-header.php): failed to open stream: No such file or directory in /home/(account)/public_html/domain.com/index.html on line 10
       [18-Sep-2014 22:45:55 UTC] PHP Warning:  include(): Failed opening '/wp/wp-blog-header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/(account)/public_html/domain.com/index.html on line 10
       ```
   
 * PHP Error log from wp folder: Empty .

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

 *  [jherrington1](https://wordpress.org/support/users/jherrington1/)
 * (@jherrington1)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wp-blog-headerphp-problem-in-external-html/#post-5309848)
 * You are trying to run php inside an html file? That wouldn’t work. To do that
   you would need it to be index.php … not index.html.
 *  Thread Starter [wdevel](https://wordpress.org/support/users/wdevel/)
 * (@wdevel)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/wp-blog-headerphp-problem-in-external-html/#post-5309877)
 * [@jherrington1](https://wordpress.org/support/users/jherrington1/) ofc you can.
   You can run php code from html file. Google: php Apache handler / Addtype.

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

The topic ‘wp-blog-header.php problem in external html’ is closed to new replies.

## Tags

 * [external](https://wordpress.org/support/topic-tag/external/)
 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)
 * [wp-blog-header.php](https://wordpress.org/support/topic-tag/wp-blog-header-php/)
 * [WSOD](https://wordpress.org/support/topic-tag/wsod/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [wdevel](https://wordpress.org/support/users/wdevel/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/wp-blog-headerphp-problem-in-external-html/#post-5309877)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
