Topic on Project:Support desk

[RESOLVED] Fatal error: cannot access private property

13
146.115.5.162 (talkcontribs)

Hi, trying to resolve an issue with file uploads. Uploading works fine, but upon successful upload, the user goes to a blank page (i.e. a PHP error). The error is: PHP Fatal error: Cannot access private property LocalFile::$description in /var/www/w/includes/filerepo/file/File.php on line 205, referer: http://[our wiki site]/wiki/Special:Upload. Files appear on the wiki fine, so at this point, it's mostly annoying. Google's not turning up anything similar. Any thoughts?

88.130.124.240 (talkcontribs)

Which version of MediaWiki are you using?

Do you maybe have a problem after you did an update? E.g. that you have not replaced all files with the new ones?

Do you use any extensions, which somehow manipulate file upload in some way?

146.115.5.162 (talkcontribs)

Using MediaWiki 1.23.1 and PHP 5.5.9. Not using many extensions, and none that are related to file uploads.

Ciencia Al Poder (talkcontribs)

I'd suggest to download the latest 1.23 version and reupload it again on your server. This seems like you upgraded over an old installation and some files left unmodified with the old version.

It would be good if you unpack all new files on an empty folder and copy over your data (LocalSettings.php, extensions, and uploads if they're in subdirectories of the installation)

18.207.1.184 (talkcontribs)

I downloaded and upgraded to a fresh copy of 1.23.3. Copied over my LocalSettings, logo and favicon files, and 3 extensions I use -- BreadCrumbs, MobileFrontend, and HipchatNotifications. Upgrade went fine, no issues at all viewing pages, I go to upload a file... exact same error.

I feel like this must be external to MediaWiki, but don't know how to debug PHP in this instance.

Florianschmidtwelzow (talkcontribs)

First: The error message above is from your apache error_log, right? Can you enable error reporting in php to see the error's directly on the page (instead of a white page?). Information how to do this, you can find here. Maybe there are other erros, too?

Ciencia Al Poder (talkcontribs)

Yes, an error backtrace would be incredibly useful here. Be sure to set $wgShowExceptionDetails = true;

146.115.5.162 (talkcontribs)

I'll try that now and post results. I also just figured out that if I uncheck the "Watch this file" then I don't get the error message.

146.115.5.162 (talkcontribs)

Actually, the error is not from Apache's log, it's what is displayed when a user uploads a file. In LocalSettings.php, we have the following enabled:

### begin debugging code

$wgDebugLogFile = "./logging/debug-output.log";
$wgDebugComments = true;

$wgShowExceptionDetails = true;

error_reporting( E_ALL );
ini_set( 'display_errors', 1 );
### end debugging code
Ciencia Al Poder (talkcontribs)

Please try again and post your error message.

Your original error message from the first comment contains the "Referer:" part that's only displayed on apache's error log.

146.115.5.162 (talkcontribs)

My mistake--here's the error when viewed in the browser: Fatal error: Cannot access private property LocalFile::$description in /var/www/w/includes/filerepo/file/File.php on line 205

Florianschmidtwelzow (talkcontribs)
146.115.5.162 (talkcontribs)

I edited the code out that got the description field, and it "works", although the notification is a little messed up. Thanks for the help!

Reply to "[RESOLVED] Fatal error: cannot access private property"