WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#35026 closed defect (bug) (duplicate)

Themes, Plugins, Core re-install broken WordPress 4.4

Reported by: S1L1K0N Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: Filesystem API Keywords:
Focuses: Cc:
PR Number:

Description

FTP within WordPress 4.4 is not working. Was working perfectly on WP 4.3.1. Details below:

OS: FreeBSD 10.2-RELEASE
apache24-2.4.16_1
php56-5.6.14 (and associated supporting libraries/modules, all 5.6.14)
mysql55-client-5.5.44_1
mysql55-server-5.5.44

WordPress error upon attempted plugin installation:

Installing Plugin: BuddyPress 2.4.2
Downloading install package from https://downloads.wordpress.org/plugin/buddypress.2.4.2.zip

Unpacking the package…

Installing the plugin…

Could not create directory. /data/www/mmfa/wp-content/plugins/buddypress/bp-activity

Plugin install failed.

Return to Plugin Installer

WordPress error upon attempted theme installation (theme below is an example):

Installing Theme: TechNews 1.5.5
Downloading install package from https://downloads.wordpress.org/theme/technews.1.5.5.zip

Unpacking the package…

Installing the theme…

Could not copy file. /data/www/mmfa/wp-content/themes/technews/404.php

Theme install failed.

WordPress error upon core re-installation attempt:

Update WordPress
Downloading update from https://downloads.wordpress.org/release/en_CA/wordpress-4.4.zip

Unpacking the update…

The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

Installation Failed

Whenever I try to install a theme, plugin or even re-install 4.4 from the Wordpress dashboard I get the 'Could not copy file.' error; this was working fine under WordPress 4.3.1; same supporting applications as above, filesystem permissions have not been modified from when they were working (they are 775).
Apache24 keeps recording the following in my error log (/var/log/mmfa/error.log) everytime Wordpress tries to call it's FTP function:

PHP Warning: Illegal string offset 'name' in /data/www/mmfa/wp-admin/includes/class-ftp.php on line 730, referer: http://www.mmfa.lan/wp-admin/update.php?action=install-plugin&plugin=buddypress&_wpnonce=780b9abbc7

PHP Warning: Illegal string offset 'name' in /data/www/mmfa/wp-admin/includes/class-ftp.php on line 730, referer: http://www.mmfa.lan/wp-admin/update.php?action=install-theme&theme=technews&_wpnonce=c548125e78

PHP Warning: Illegal string offset 'name' in /data/www/mmfa/wp-admin/includes/class-ftp.php on line 730, referer: http://www.mmfa.lan/wp-admin/update-core.php?action=do-core-reinstall

Looks like something is borked in ../wp-admin/includes/class-ftp.php after the 4.4 upgrade, but I'm not a PHP wizard so I can't say what.

Earlier today I was trying to get support through the main wordpress support site, https://wordpress.org/support/topic/ftp-not-working-wordpress-44?replies=10#post-7769293

Thanks.

Change History (10)

#1 @SergeyBiryukov
4 years ago

  • Component changed from Gallery to Filesystem API
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @S1L1K0N, welcome to Trac!

Thanks for the report, we're already tracking this issue in #34976.

#2 follow-up: @SergeyBiryukov
4 years ago

  • Milestone set to 4.4.1
  • Resolution duplicate deleted
  • Status changed from closed to reopened

On second thought, reopening for further investigation, per comment:45:ticket:34976.

#3 in reply to: ↑ 2 ; follow-up: @S1L1K0N
4 years ago

Replying to SergeyBiryukov:

On second thought, reopening for further investigation, per comment:45:ticket:34976.

Sure thing, let me know if there's anything else I can provide. Thanks.

#4 in reply to: ↑ 3 @S1L1K0N
4 years ago

Replying to S1L1K0N:

Replying to SergeyBiryukov:

On second thought, reopening for further investigation, per comment:45:ticket:34976.

Sure thing, let me know if there's anything else I can provide. Thanks.

I reverted the website I was working on to WP 4.3.1; everything is working great again, but I thought I'd point out that the PHP Warning: Illegal string offset 'name' in /data/www/mmfa/wp-admin/includes/class-ftp.php persist, so this doesn't appear to be the issue preventing 4.4 from working as it appears these errors were always there, I just didn't have any issues when I was on 4.3.1 so I never checked the error logs.

As I mentioned, the FTP functionality broke after upgrading to WP 4.4, and I tried a fresh install (right down to a new sql database/user) and that didn't make any difference, it is broken out of the box, thanks.

#5 @dd32
4 years ago

This is definitely a distinct issue from #34976.

The issue that is happening here, is that the regular expression changes in #33432 are failing on this particular FTP servers output (which might I add, almost every server out there seems to display differently), looking at the changes I'm not sure what the issue is, for reference these are the only changes:
class-ftp.php
class-ftp-sockets.php
class-ftp-pure.php

In order to debug this though, some extra information about the system is going to be required. I'll send @S1L1K0N an email shortly to sort it out.

#6 @dd32
4 years ago

I've traced this ultimately down to the same as #34976

The problem is that PemFTP doesn't handle failure cases of rawlist() properly.
Previously, nlist() would return an empty array, however rawlist() returns [ 'ftpd: /wordpress-testing/if/path/exists: No such file or directory' ] which trips up our checks.

I'm going to leave this open as a distinct issue from #34976 though, because although it's caused by the same change [33648] PemFTP needs to be fixed.

#7 @dd32
4 years ago

Turns out switching from using $this->ftp->rawlist() to using $this->ftp->dirlist() in the WP_Filesystem_ftpsockets::exists() method also fixes this (as it handles detecting the above error).

This doesn't help with #34976 though where LIST doesn't work but NLST did.

#8 @dd32
4 years ago

  • Milestone 4.4.1 deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed

Duplicate of #34976.

Just going to revert this and maybe try again one day.

#9 @dd32
4 years ago

In 35946:

Filesystem: Avoid PHP warnings when using the FTP Sockets class.
See #35026

#10 @S1L1K0N
4 years ago

Thanks to @dd32 for all his time in helping pin-point this issue. It appears another option to fix this is to install the missing library:

php56-ftp-5.6.14 The ftp shared extension for php

using *BSD's package manager (or build it from the ports tree). If a person is using the *BSD package manager to install the Wordpress dependencies the above package is not included.

Last edited 4 years ago by S1L1K0N (previous) (diff)
Note: See TracTickets for help on using tickets.