WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#8195 closed defect (bug) (fixed)

Plugin Installer failed

Reported by: tsingzero Owned by:
Milestone: 2.7 Priority: high
Severity: major Version: 2.7
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

defect on 2.7-beta2-9638
2.7 beta1 doesn't have this problem.

in some enviroment, the working_dir on the host will be something like: /home/user/www/site/wp-content/upgrade and plugins_dir: /home/user/www/site/wp-content/plugins

but in the ftp context, the working_dir will be: /www/site/wp-content/upgrade and plugins_dir could be: /www/site/wp-content/plugins.

So, in the wp-admin/includes/plugin-install.php, function wp_install_plugin has the call:
$res = update_pluginfiles_base_dir($working_dir . '/' . $filelist[0], $plugins_dir . $filelist[0]);

if we install the plugin: all-in-one-seo-pack

will be: $res = update_pluginfiles_base_dir("/www/site/wp-content/upgrade/all-in-one-seo-pack", "/www/site/wp-content/plugins/all-in-one-seo-pack");

and in the function: update_pluginfiles_base_dir($from, $to):
it will call: $files = list_files($from), which would opendir("/www/site/wp-content/upgrade/all-in-one-seo-pack"), then if will fail.

when update_pluginfiles_base_dir

Change History (3)

comment:1 tsingzero5 years ago

defect on 2.7-beta2-9638, but 2.7 beta1 doesn't have this problem.

in some enviroment, the working_dir on the host will be something like: /home/user/www/site/wp-content/upgrade and plugins_dir: /home/user/www/site/wp-content/plugins

but in the ftp context, the working_dir will be: /www/site/wp-content/upgrade and plugins_dir could be: /www/site/wp-content/plugins.

So, in the wp-admin/includes/plugin-install.php, function wp_install_plugin has the call: $res = update_pluginfiles_base_dir($working_dir . '/' . $filelist[0], $plugins_dir . $filelist[0]);

if we install the plugin: all-in-one-seo-pack

will be: $res = update_pluginfiles_base_dir("/www/site/wp-content/upgrade/all-in-one-seo-pack", "/www/site/wp-content/plugins/all-in-one-seo-pack");

and in the function: update_pluginfiles_base_dir($from, $to): it will call: $files = list_files($from), which would opendir("/www/site/wp-content/upgrade/all-in-one-seo-pack"), then if will fail.

comment:2 ryan5 years ago

Possibly due to [9523].

comment:3 ryan5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [9664]) Revert [9523]. fixes #8195 see #7395

Note: See TracTickets for help on using tickets.