简体   繁体   English

插件文件中的路径错误

[英]Wrong path within plugin files

I'm running the latest version of WordPress (3.5.1), hostet with Strato and since yesterday some of my plugins are not getting the correct path to their files. 我正在运行最新版本的WordPress(3.5.1),与Strato进行了主机托管,从昨天开始,我的某些插件未获得指向其文件的正确路径。

UPDATE: It's not a Multisite! 更新:这不是一个多站点!

All files are still on the server and haven't been changed or updated since friday (at this point the site was live without issues). 自星期五以来,所有文件都仍在服务器上,并且未更改或更新过(此时该站点已正常运行,没有任何问题)。 The problem is that the plugins are looking at some kind of internal path which looks something like this: website/wp-content/plugins/xxx/xxx/xx/xx/123456789/htdocs/website/wp-content/plugins/akismet/akismet.css so all I get is an error 404 (Not Found) 问题在于插件正在寻找某种类似于以下website/wp-content/plugins/xxx/xxx/xx/xx/123456789/htdocs/website/wp-content/plugins/akismet/akismet.css的内部路径: website/wp-content/plugins/xxx/xxx/xx/xx/123456789/htdocs/website/wp-content/plugins/akismet/akismet.css所以我得到的只是错误404(未找到)

I cannot locate the problem and I'm not getting any PHP errors or anything like that; 我找不到问题,也没有收到任何PHP错误或类似信息; only the paths are broken... the plugins are even working, but without images, css and scripts! 只有路径被破坏了……这些插件甚至可以正常工作,但是没有图像,CSS和脚本!

Therefore I've deactivated all of the plugins but as soon as I activate them again, I'm running into the same problem. 因此,我已经停用了所有插件,但是一旦再次激活它们,就会遇到同样的问题。

And finally I've already contacted the provider, but they cannot help at all because it seems to be a problem within WordPress. 最后,我已经联系了提供商,但是他们根本无济于事,因为这似乎是WordPress中的问题。

UPDATE: I've completely removed all of the plugins, but even if I now download and activate a new plugin the path is broken as mentioned above... 更新:我已经完全删除了所有插件,但是即使我现在下载并激活一个新插件,路径也如上所述被破坏了。

UPDATE2: The wrong path looks like this: UPDATE2:错误的路径如下所示:

domain.com/wp-content/plugins/mnt/web1/a1/12/123456789/htdocs/
/website/wp-content/plugins/akismet/akismet.css

instead of domain.com/wp-content/plugins/akismet/akismet.css (actually the second version of the path is working, but all of the plugins are calling the first version, even if completely new installed) 而不是domain.com/wp-content/plugins/akismet/akismet.css (实际上,该路径的第二个版本正在运行,但是所有插件都调用了第一个版本,即使安装了全新的插件)

UPDATE3: Sorry, I'm not able to go more into detail, because I've no clue what's going wrong, so I'm giving it a try from another perspective: everything is working fine, with the exception of the plugins. UPDATE3:对不起,我无法进一步详细介绍,因为我不知道出了什么问题,所以我尝试从另一个角度进行尝试:除插件外,其他一切正常。 The plugins are even displayed in the frontend, but without any CSS, JavaScript or images. 插件甚至显示在前端,但没有任何CSS,JavaScript或图像。 The same thing happens in the backend. 后端发生相同的事情。 I can see all of the plugins and manage (install, edit, configure,...) them, but there is no styling. 我可以看到所有插件并进行管理(安装,编辑,配置...),但是没有样式。 Everything in case of the design seems to call a wrong path. 设计时的一切似乎都在错误的路径上。 In doing so the first part of the path is okay, and also the last part, but in the middle there are numbers which should normally not be displayed within a frontend path because they are a part of the Strato server root directory. 这样,路径的第一部分就可以了,最后一部分也可以,但是在中间,有些数字通常不应在前端路径中显示,因为它们是Strato服务器根目录的一部分。

It seems your the WP_CONTENT_URL is not correct. 看来您的WP_CONTENT_URL不正确。

This is defined as in ./wp-includes/default-constants.php: 这是在./wp-includes/default-constants.php中定义的:

 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');

So check your settings > general > WordPress Address (URL) 因此,请检查您的设置>常规> WordPress地址(URL)

You can also try to define the correct WP_CONTENT_URL in your wp-config.php: 您也可以尝试在wp-config.php中定义正确的WP_CONTENT_URL

   define( 'WP_CONTENT_URL', 'http://www.yourdomain.com/wp-content');

When the above don't help check your .htaccess. 如果上述方法不起作用,请检查您的.htaccess。 Maybe wp-content/ is rewrite to the fullpath. 也许wp-content /被重写为全路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM