当我将代码更新到我的wordpress网站时,我遇到了这个错误,整个网站都变成空白,因此我无法进行任何更改,当我像以前一样保存它时,它便开始工作。
另外,在本地主机上安装时,同一个站点也有问题。
在wp-config完成所有设置后,我看到的是这样的:
/<!-- ========== END HTML ============== -->
index
C:\xampp\htdocs\acm\index.php
C:\xampp\htdocs\acm\wp-blog-header.php
C:\xampp\htdocs\acm\wp-load.php
C:\xampp\htdocs\acm\wp-config.php
C:\xampp\htdocs\acm\wp-settings.php
C:\xampp\htdocs\acm\wp-includes\load.php
C:\xampp\htdocs\acm\wp-includes\default-constants.php
C:\xampp\htdocs\acm\wp-includes\plugin.php
C:\xampp\htdocs\acm\wp-includes\class-wp-hook.php
C:\xampp\htdocs\acm\wp-includes\version.php
C:\xampp\htdocs\acm\wp-includes\compat.php
C:\xampp\htdocs\acm\wp-includes\class-wp-list-util.php
C:\xampp\htdocs\acm\wp-includes\functions.php
C:\xampp\htdocs\acm\wp-includes\option.php
C:\xampp\htdocs\acm\wp-includes\class-wp-matchesmapregex.php
C:\xampp\htdocs\acm\wp-includes\class-wp.php
C:\xampp\htdocs\acm\wp-includes\class-wp-error.php
C:\xampp\htdocs\acm\wp-includes\pomo\mo.php
C:\xampp\htdocs\acm\wp-includes\pomo\translations.php
C:\xampp\htdocs\acm\wp-includes\pomo\plural-forms.php
C:\xampp\htdocs\acm\wp-includes\pomo\entry.php
C:\xampp\htdocs\acm\wp-includes\pomo\streams.php
C:\xampp\htdocs\acm\wp-includes\wp-db.php
C:\xampp\htdocs\acm\wp-includes\cache.php
C:\xampp\htdocs\acm\wp-includes\default-filters.php
C:\xampp\htdocs\acm\wp-includes\l10n.php
C:\xampp\htdocs\acm\wp-includes\class-wp-locale.php
C:\xampp\htdocs\acm\wp-includes\class-wp-locale-switcher.php
C:\xampp\htdocs\acm\wp-includes\class-wp-walker.php
C:\xampp\htdocs\acm\wp-includes\class-wp-ajax-response.php
C:\xampp\htdocs\acm\wp-includes\formatting.php
C:\xampp\htdocs\acm\wp-includes\capabilities.php
C:\xampp\htdocs\acm\wp-includes\class-wp-roles.php
C:\xampp\htdocs\acm\wp-includes\class-wp-role.php
C:\xampp\htdocs\acm\wp-includes\class-wp-user.php
C:\xampp\htdocs\acm\wp-includes\class-wp-query.php
C:\xampp\htdocs\acm\wp-includes\query.php
C:\xampp\htdocs\acm\wp-includes\date.php
C:\xampp\htdocs\acm\wp-includes\theme.php
C:\xampp\htdocs\acm\wp-includes\class-wp-theme.php
C:\xampp\htdocs\acm\wp-includes\template.php
C:\xampp\htdocs\acm\wp-includes\user.php
C:\xampp\htdocs\acm\wp-includes\class-wp-user-query.php
C:\xampp\htdocs\acm\wp-includes\class-wp-session-tokens.php
C:\xampp\htdocs\acm\wp-includes\class-wp-user-meta-session-tokens.php
C:\xampp\htdocs\acm\wp-includes\meta.php
C:\xampp\htdocs\acm\wp-includes\class-wp-meta-query.php
C:\xampp\htdocs\acm\wp-includes\class-wp-metadata-lazyloader.php
C:\xampp\htdocs\acm\wp-includes\general-template.php
C:\xampp\htdocs\acm\wp-includes\link-template.php
C:\xampp\htdocs\acm\wp-includes\author-template.php
C:\xampp\htdocs\acm\wp-includes\post.php
C:\xampp\htdocs\acm\wp-includes\class-walker-page.php
C:\xampp\htdocs\acm\wp-includes\class-walker-page-dropdown.php
C:\xampp\htdocs\acm\wp-includes\class-wp-post-type.php
C:\xampp\htdocs\acm\wp-includes\class-wp-post.php
C:\xampp\htdocs\acm\wp-includes\post-template.php
C:\xampp\htdocs\acm\wp-includes\revision.php
C:\xampp\htdocs\acm\wp-includes\post-formats.php
C:\xampp\htdocs\acm\wp-includes\post-thumbnail-template.php
C:\xampp\htdocs\acm\wp-includes\category.php
C:\xampp\htdocs\acm\wp-includes\class-walker-category.php
C:\xampp\htdocs\acm\wp-includes\class-walker-category-dropdown.php
C:\xampp\htdocs\acm\wp-includes\category-template.php
C:\xampp\htdocs\acm\wp-includes\comment.php
C:\xampp\htdocs\acm\wp-includes\class-wp-comment.php
C:\xampp\htdocs\acm\wp-includes\class-wp-comment-query.php
C:\xampp\htdocs\acm\wp-includes\class-walker-comment.php
C:\xampp\htdocs\acm\wp-includes\comment-template.php
C:\xampp\htdocs\acm\wp-includes\rewrite.php
并重定向到“ / index / en /”。
某处必须有一个重写配置,但是如何找到它并将其删除或将其更正为localhost?
我不确定,但是我可以对此文件做出反应: “ /react/config/env.js”设置
function getEnvironment(nodeEnv) {
const raw = Object.keys(process.env).reduce((env, key) => {
const newEnv = env;
newEnv[key] = process.env[key];
return newEnv;
}, {
NODE_ENV: nodeEnv,
API_URL: nodeEnv === 'production' ? 'http://host.com' : 'http://localhost/acm',
});
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
const newEnv = env;
newEnv[key] = JSON.stringify(raw[key]);
return newEnv;
}, {}),
};
return { raw, stringified };
}
module.exports = getEnvironment;