WordPress.org

Ready to get started?Download WordPress

Forums

Doozy of a problem with enclosures (2 posts)

  1. topher1078
    Member
    Posted 5 years ago #

    I’m having a doozy of a problem with enclosures. In trying to start a podcast, I realized that WordPress was not creating enclosures for media files. I checked MIME types on the server, turned off permalinks, and nothing - WordPress would not create the enclosure for the audio file, so neither various podcasting plugins nor the RSS feed (with the plugin active or inactive) would recognize it. Even tried a brand new WordPress install, new database and everything, and still nothing.

    HOWEVER (and this is where I’m starting to pull my hair out) when I use WordPress with an internal url on the same server as my public site, everything works PERFECTLY. Example.com is my public site, hosted on my server, and test.example.ltd is the internal test site (hosted on the same server). test.example.ltd works perfectly with enclosures, while example.com does not. I’ve even switched back and forth - my live, public site will not create enclosures under example.com, but the exact same site WILL under test.example.ltd. A brand new WordPress install WILL create enclosures on test.example.ltd, but will NOT create enclosures on example.com.

    I have no idea why a URL would effect whether or not WordPress would create an enclosure, and the only thing I can think of is that there’s some weird DNS error.

    If anyone has any ideas I would greatly appreciate it!

  2. alanft
    Member
    Posted 5 years ago #

    WP actually fetches the HTTP headers of URIs in the content of your post to get MIME and length data. the code is in wp-includes/functions.php the do_enclose() function:

    if ( $headers = wp_get_http_headers( $url) ) { ... enclosure making code ... }

    how WP gets the header depends on your PHP setup (it's usually via the HTTP extension to PHP)

    So, yes any failure to reach that enclosure-to-be's URL from the server executing the WP PHP, will fail to make enclosures. whether through a DNS failing or too-many referrals, etc.

Topic Closed

This topic has been closed to new replies.

About this Topic