• I’ve searched and it seems this is an unresolved issue. Upon installation, going into Options|Miscellaneous shows that “URI for this directory” is set to /wp-content but the recommended value is https://[mysite]/%5Bmydirectory%5D/wp-content

    Files upload correctly, but the code tag that WP generates is incorrect. Embedding this code in a post directs the browser to look in https://[mysite]/wp-content which is not where the image is located.

    A hack is easy enough: upon installation, go into Options|Miscellaneous and correct the incorrect entry. But this is a hack, not a solution. Does anyone have any insight about why it doesn’t install correctly in the first place?

    I’ve set this up at https://www.clickety.com/wp for anyone who cares to look. The only difference is that I’ve called the upload directory upload instead of wp-content.

    The admin password is just the letter a — I choose much better password for my real sites! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • /wp-content is the default I think, but WP presents an alternative just under that box which invariably works.

    Bear in mind that some people (myself included) store no files in the wp structure so having it like it is or having it correct would still mean it needs altering.

    I’d not call it a hack though ??

    Thread Starter hallsey

    (@hallsey)

    What baffles me is that the code appears to try to set fileupload_url correctly. The install.php routine calls function populate_options() in upgrade-schema.php. There we find this code:


    function populate_options() {
    global $wpdb;
    $guessurl = preg_replace('|/wp-admin/.*|i', '', 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    add_option('siteurl', $guessurl, __('WordPress web address'));
    //other add_options calls removed from example for brevity
    add_option('fileupload_url', get_option('siteurl') . '/wp-content');

    It looks like the code tries to set fileupload_url to something more than just /wp-content, but it’s as if siteurl is blank at the time this line executes.

    However, at the end of the installation, I’ve verified that siteurl does have the correct value, and moreover, I can’t find a place where it might have acquired the correct value afterward.

    I’m not up to speed on PHP enough to figure out what’s going on here.

    Moderator James Huff

    (@macmanx)

    There is nothing wrong with setting /wp-content as the default upload directory. Essentially, “/wp-content” is a relative URL which points to the /wp-content/ directory inside your blog’s directory. Under most server configurations, it should work. But, as Podz has mentioned, the upload directory is frequently customized on the user’s end, so this really doesn’t matter.

    Thread Starter hallsey

    (@hallsey)

    I know. It’s only an issue for me because I’m trying to setup WP for some people who will then distribute it amongst themselves. I’m trying to make it as turnkey as possible because these folks are the type who, if you say move the mouse, they pick the mouse up and move it! ??

    And I still don’t understand why this line doesn’t do what it’s supposed to:

    add_option('fileupload_url', get_option('siteurl') . '/wp-content');

    I program in other languages (just starting with PHP), and that line appears to me to concatenate the contents of the option ‘siteurl’ plus the string ‘/wp-content’

    Now, the option ‘siteurl’ has a value, yet the option ‘fileupload_url’ winds up with just ‘/wp-content’

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Installation sets fileupload_url incorrectly (?)’ is closed to new replies.