Support » Networking WordPress » admin-ajax.php not found when inserting media in directory-based subsites

  • Resolved bradkamradt

    (@bradkamradt)


    Hi. I have a fresh install of WordPress multisite in its own directory. Primary blog — which works fine — is at the root. Subsites are directory-based. We are running no plugins and only default WP themes. .htaccess and wp-config.php mods have been copied and recopied directly from the Network Setup WP Dashboard.

    The problem we’re experiencing is that subsite admins cannot insert media into their pages and posts. (Uploads are fine, but “Add Media” insertions fail.) Console inspection reveals that admin-ajax.php is not found on subsites; it appears WP is looking for it at http://site.edu/SUBSITE/wp-admin/admin-ajax.php instead of http://site.edu/wp-admin/admin-ajax.php or http://site.edu/wordpress/wp-admin/admin-ajax.php.

    Hope this makes sense. I have no idea how to address this issue and need a solution ASAP for a training initiative that’s about to begin. Any suggestions? THANKS SO MUCH!

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter bradkamradt

    (@bradkamradt)

    Still looking for ideas and/or solutions on this. THANKS!

    (Sorry, just realized I should not have bumped this. Don’t seem able to delete it.)

    • This reply was modified 4 years, 6 months ago by bradkamradt.
    • This reply was modified 4 years, 6 months ago by bradkamradt.

    Trying to add media to your posts/pages? Try browsing the media library, and copy the link to your uploaded files. That is one work-around. If it doesn’t work… please provide me a URL to your site, so I can take a closer look. Without a URL… I’m aren’t able to figure out what your problem is.

    Thread Starter bradkamradt

    (@bradkamradt)

    Site is at sandbox.www.nau.edu. Appreciate the thought re: workaround, but that may not give us what we need since it doesn’t match training materials we have access to from Lynda.com. Hoping there’s a non-core way to remove the /SITEURL/ from the admin-ajax.php file path that currently yields 404 error. Or rewrite via .htaccess. Or something. Thoughts? THANKS SO MUCH!

    The Sites folder that is dynamic is needed because, that enables multisites to have individual media libraries.Alternatively… you can centralize all of your media files by setting up a url for your multisite: media.yoursite.com or yoursite.com/media
    Please tell me the steps to reproduce a problem.

    Thread Starter bradkamradt

    (@bradkamradt)

    Steps to reproduce:

    1) Head to sandbox.www.nau.edu/wp-signup.php
    2) Create a user account and site for yourself (blocking search-engine traffic, please)
    3) Open console and get ready to see error(s)
    4) Try to add an image to a page or post on your site using “Add Media” and “Insert into…”
    5) admin-ajax.php will show up as 404 not found, presumably due to your site slug being inserted in the path to admin-ajax.php

    THANKS!

    • This reply was modified 4 years, 6 months ago by bradkamradt.

    I tried inserting media… but no 404 errors found. Are you still getting errors?

    Thread Starter bradkamradt

    (@bradkamradt)

    And were you able to successfully insert media? When we try, nothing happens and console indicates that admin-ajax.php isn’t found: https://drive.google.com/file/d/0B45kVJQNbZhoRW5PUHhVVFBUTFU/view?usp=sharing

    Thread Starter bradkamradt

    (@bradkamradt)

    Ah, I see. Looks like you may have uploaded a WAV file. Problem may be specific to images?

    got the image uploaded. Have you tried reinstalling WordPress by using the reinstall button at the wp-admin/network, and going to updates, and click on reinstall WordPress. The only workaround is to copy a url to an image when inserting images to your post/page. Are you still having problems?

    Thread Starter bradkamradt

    (@bradkamradt)

    Yes, still having trouble. Adding/uploading media to library is not the problem. Inserting into a page or post still is due to that 404 not found error.

    Good idea re: reinstalling WordPress. Just did that but unfortunately have same poor results.

    I’m still left feeling like the issue to be addressed is the inclusion of the site slug in the path to admin-ajax.php. Just not sure how to correct for that.

    Tempted to blow away this instance entirely and reinstall WP and multisite from scratch. Don’t want to go there unless we’re at the end of the road re: other options.

    Appreciate your time and input so far, Fairy Rider!

    If you were about to reinstall WordPress with a fresh install… its always a good idea to backup data, and your content. You can also go to codex.wordpress.org to get help. What kind of host you were using, is it shared hosting, or a VPS hosting plan with your website?
    What is a goal for your website… are you planning on getting users for your site, and develop content for your visitors, or both. At this instance… I’m building my website to publish fictional stories, opinions, and educational content. As I viewed the ajax.php file via developer tools… I discovered that file was displayed with a number 0.
    Most likely you had an improper setting or configuration with your install of wordpress.

    Thread Starter bradkamradt

    (@bradkamradt)

    We have a VPS arrangement. This particular website will be used for training, and needs to mirror a WordPress course via Lynda.com to the extent possible.

    I just tested in an already established multisite instance with the same hosting environment, and everything works as it should. Methinks it’s time to try a fresh install to see if this problem is replicable.

    Thanks, Fairy-Rider, for the input!

    If the problem still occurs; you had an option to reinstall WordPress altogether… what I mentioned earlier in this thread always backup user data, and files,–so it’s easier for you to restore users without recreating them.
    Let me know if you finally solved a problem.

    Thread Starter bradkamradt

    (@bradkamradt)

    Still having this problem where images cannot be inserted using WYSIWYG/GUI in, pages and posts. May not actually be a multisite issue — I set up a fresh single-site install and am now experiencing the same issue there.

    I’m going to reach out to our host and see if they’re perhaps blocking access to admin-ajax.php due to excessive calls or related high CPU usage. Still have no idea what’s actually going on here or how to fix it.

    🙁

    If this is the case, try upgrading your hosting plan to a dedicated hosting plan later on.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘admin-ajax.php not found when inserting media in directory-based subsites’ is closed to new replies.