【发布时间】:2018-08-14 02:26:09
【问题描述】:
我正在使用 macos 的默认 apache。我的 wp 网站无法安装新插件或更新插件。 但这在实时站点中正常工作。这些是我在尝试安装新插件时看到的列表错误:
错误提示:安装失败:内部服务器错误
按钮安装状态:更新失败!
在控制台调试中我看到:.../wp-admin/admin-ajax.php 500(内部服务器 错误)
我尝试搜索并以某些方式进行操作,例如:更改 chown,权限为 777,添加了 define('FS_METHOD', 'direct'),更改 memory_limit... 但是还是不行。
所以我经历了,当我在文件 .../wp-admin/includes/class-wp-upgrader.php 的第 450 行的 @set_time_limit( 300 ); 行中发表评论时,我看到它正在工作。但我不明白为什么会这样?
public function install_package( $args = array() ) {
global $wp_filesystem, $wp_theme_directories;
$defaults = array(
'source' => '', // Please always pass this
'destination' => '', // and this
'clear_destination' => false,
'clear_working' => false,
'abort_if_destination_exists' => true,
'hook_extra' => array()
);
$args = wp_parse_args($args, $defaults);
// These were previously extract()'d.
$source = $args['source'];
$destination = $args['destination'];
$clear_destination = $args['clear_destination'];
//@set_time_limit( 300 ); **If I comment at here it's working**
if ( empty( $source ) || empty( $destination ) ) {
return new WP_Error( 'bad_request', $this->strings['bad_request'] );
}
$this->skin->feedback( 'installing_package' );
....
}
谁能建议我如何解决这个问题?
谢谢
【问题讨论】: