Title: Embed PHP
Last modified: August 19, 2016

---

# Embed PHP

 *  [gapingredgroovie](https://wordpress.org/support/users/gapingredgroovie/)
 * (@gapingredgroovie)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/embed-php/)
 * Hi All,
 *  I’m new to working with PHP (still a student) and have been attempting to embed
   WordPress into an HTML apDiv in Dreamweaver. The reasoning is because I want 
   to keep the unified appearance and navigation functionality. The apDiv is set
   for scroll overflow as well.
 * The php script I dropped into the HTML page is:
    <div id=”apDiv16″> <?php include(“
   wordpress/index.php”); ?> </div>
 * The error I keep getting while trying to view the HTML page is:
    Fatal error:
   main() [function.require]: Failed opening required ‘./wp-blog-header.php’ (include_path
   =’.:/usr/lib/php’) in /homepages/14/d240057214/htdocs/wordpress/index.php on 
   line 17
 * When I revise the script to the following:
    <div id=”apDiv16″> <?php include(“/
   wordpress/index.php”); ?> </div>
 * I get nothing (not even errors) in the apDiv… I’d rather see the errors. At least
   I know I’m closer to the mark.
 * My question is whether it’s even possible to embed an “include” into an apDiv,
   and if so, what is the correct script I need to drop into my HTML document’s 
   apDiv?
 * I have also created and uploaded a .htaccess file according to my provider’s (
   1and1.com) instructions for parsing php within an HTML document.
 * Thanks for any help offered. My head is swimming on this one and the life buoy
   has a leak!
 * Regards

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

 *  [NC@WP](https://wordpress.org/support/users/ncwp/)
 * (@ncwp)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/embed-php/#post-855083)
 * It’s a directory structure issue. When you include `/wordpress/index.php`, the
   code runs as if it resided in the directory in which the including file is located.
   Consequently, none of the subsequent includes work.
 * What you need to do is to put WordPress into an iframe.
 * The alternative is to so something like this:
 *     ```
       <div id="apDiv16">
       <?php
   
       readfile('http://localhost/wordpress/');
   
       ?>
       </div>
       ```
   
 * but it is a little slower and may produce bad links.
 *  Thread Starter [gapingredgroovie](https://wordpress.org/support/users/gapingredgroovie/)
 * (@gapingredgroovie)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/embed-php/#post-855137)
 * Fantastic, NC! Worked like a charm and loads quite well actually. You were right
   about the incorrect directory structure and the code you so kindly posted was
   exactly what I needed. Of course, all I had to do on my end was to drop in the
   correct URL and it was all right there. Too cool for words, but my many thanks
   regardless.
 * Regards!

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

The topic ‘Embed PHP’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [gapingredgroovie](https://wordpress.org/support/users/gapingredgroovie/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/embed-php/#post-855137)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
