前一段时间,我尝试通过FTP上传一个主题到WordPress,但每当我试图看到预览时,它总是给我以下错误:
PHP致命错误:在E:'Domains'joseramosadvogados.com.br'wwwroot'wp-includes'option.php on line 818中允许的内存大小为134217728字节(试图分配261904字节)
/**
* Delete user interface settings.
*
* Deleting settings would reset them to the defaults.
* This function has to be used before any output has started as it calls setcookie().
*
* @since 2.7.0
*
* @param mixed $names The name or array of names of the setting to be deleted.
* @return bool true if deleted successfully/false if not.
*/
function delete_user_setting( $names ) {
if ( headers_sent() ) {
return false;
}
$all_user_settings = get_all_user_settings();
$names = (array) $names;
$deleted = false;
foreach ( $names as $name ) {
if ( isset( $all_user_settings[$name] ) ) {
unset( $all_user_settings[$name] );
$deleted = true; /*line 818*/
}
}
if ( $deleted ) {
return wp_set_all_user_settings( $all_user_settings );
}
return false;
}
但过了一会儿,它又给了我一个错误屏幕:
PHP警告:is_readable() [function。: open_basedir限制生效。文件(/languages//pt_BR.mo)不在允许的路径内:(E:'Domains'joseramosadvogados.com.br)在E:'Domains'joseramosadvogados.com.br'wwwroot'wp-includes'l10n.p on line 471
/**
* Filter MO file path for loading translations for a specific text domain.
*
* @since 2.9.0
*
* @param string $mofile Path to the MO file.
* @param string $domain Text domain. Unique identifier for retrieving translated strings.
*/
$mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
if ( !is_readable( $mofile ) ) return false; /*line 471*/
$mo = new MO();
if ( !$mo->import_from_file( $mofile ) ) return false;
if ( isset( $l10n[$domain] ) )
$mo->merge_with( $l10n[$domain] );
$l10n[$domain] = &$mo;
return true;
}
我对PHP知之甚少,所以你们能帮我找到这两个问题的根源吗?(我尝试了一些人们通过互联网说的东西,比如。htaccess,在<?php
行之后添加"set_include_path('.');",停用插件…
open_basedir restriction in effect
意味着你正在使用一个生活在黑暗时代的网站主机。这些天没有人禁用open_basedir
。
事实上PHP没有足够的内存来运行也指向主机。尝试在您的wp-config.php文件中添加下面的"define"行,并在文件中打开的<?php
下面添加几行空白:
define('WP_MEMORY_LIMIT', '64M');
,看看是否至少可以消除内存错误。