Cannot locate wp-load.php

Hello all,

When I try to upload images within a plugin I am using I get the following error: Cannot locate wp-load.php . (also see the message below).

I already tried to add the code below into my application.php file but it does not solve the problem.

Probably the plugin is is badly coded, but nonetheless if someone knows a solution that would be great!

Best regards,


It’s looking for the file here /var/www/wordpress/wp-load.php

It should probably be looking for it here /srv/www/
(I’m making a few assumptions here, most significantly that you’re using Bedrock)

More specifically, even if that file does exist where it’s looking, it’s not going to be able to access it because PHP doesn’t have access to that path. Your open_basedir is set to /srv/www/:/tmp which means PHP can only access files within /srv/www/ and /tmp.

/var/www/wordpress/ is outside of those paths. (note /srv/www vs /var/www)

Based on what you’ve posted, I’d guess that it’s looking in a hard-coded path or it’s a path that was saved to the database and you need to update it. Either way, that plugin is doing it wrong so you’ll have to patch it or go yell at the plugin author.

1 Like

Thanks for your help QW!!!

You were right about the path fix. I just had to change it into:

Sometimes I think: where would I be without the roots community? :smiley:

That plugin is doing it wrong. Please send this link to the developer: