wp-load.php
-
Your ajax script loads wp-load.php with this statement:
require_once ( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . ‘/wp-load.php’ );
This fails if wp-content/plugins has been moved to a non-standard location. I’ve extracted a few lines from the settings table to illustrate our set up below:
ABSPATH WP absolute path. /home/lamp/wordpress/core/wp5.2.1/
WPPA_ABSPATH ABSPATH windows proof /home/lamp/wordpress/core/wp5.2.1/
WPPA_PATH Path to plugins directory. /home/lamp/wordpress/wp-content/www.otu.asn.au/plugins/wp-photo-album-plus
WPPA_NAME Plugins directory name. wp-photo-album-plus
WPPA_URL Plugins directory URL. https://www.otu.asn.au/wp-content/plugins/wp-photo-album-plus
WPPA_UPLOAD The relative upload directory. wp-content/www.otu.asn.au/uploads
WPPA_UPLOAD_PATH The upload directory path. /home/lamp/wordpress/core/wp5.2.1/wp-content/www.otu.asn.au/uploads/wppaIf I replace the above line with
require_once ( ‘/home/lamp/webroot/otu/wp-load.php’ );
and in wp-config I add:
define(‘WPPA_REL_UPLOADS_PATH’, ‘wp-content/www.otu.asn.au/uploads’);
define(‘WPPA_REL_DEPOT_PATH’, ‘wp-content/www.otu.asn.au’);
Then everything works.
So you do have support for moving wp-content/uploads but not support for moving the plugins directory.Our set up works with these redirects:
RewriteCond %{REQUEST_URI} !^/wp-content/www.otu.asn.au/(.*)
RewriteCond %{REQUEST_URI} ^/wp-content/(.*)
RewriteRule ^/wp-content/(.*) /wp-content/%{SERVER_NAME}/%1We have a large number of small WP websites sharing a server. They share WP core code and some common/large plugins. All this optimises use of OPCache memory.
The page I need help with: [log in to see the link]
- The topic ‘wp-load.php’ is closed to new replies.