Mailgun extension producing PHP Fatal Error about dependency Guzzle6
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. MediaWiki 1.27 installed on Ubuntu 14.04
  2. Download extension from: https://github.com/wikimedia/mediawiki-extensions-Mailgun (Version linked to on Mediawiki is missing main Mailgun.php file)
  3. Add Mailgun extension to LocalSettings.php
  4. Add settings below (but with my own information)
$wgMailgunAPIKey = "key-asdfasdfasdf";
$wgMailgunDomain = "example.in";
  1. Go to Special:EmailUser and send email
  2. Get 500 server error in client
  3. Run `tail /var/log/apache2/error.log
PHP Fatal error:  Class 'Http\\Adapter\\Guzzle6\\Client' not found in /var/www/html/extensions/Mailgun/MailgunHooks.php on line 44, referer: https://www.example.org/index.php/Special:ConfirmEmail

Actual results
Get 500 server error and fatal error above

Expected results
For it to redirect to proper page (not sure what that is yet, cause don't have it working) and send the email

Things I've tried

  • Install composer and run composer update both from within main mediawiki directory and Mailgun extension directory
  • Add require autoload.php
  • rebuildLocalizationCache.php

Any help? I'm a ruby guy so a bit lost at this point. Tried everything that I find to be obvious.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 28 2016, 11:42 PM

Wow. Sad at this thing showing up.

Can you share your php version, Guzzle requires PHP >= 5.5.0 to start up as per http://docs.guzzlephp.org/en/latest/overview.html

This dependency is installed once your run composer update directly from extensions/Mailgun/ can you check if guzzlehttp exists in Mailgun/vendor/ ?

@01tonythomas Sure! Thank you for your quick reply.

PHP version: PHP 5.5.9-1ubuntu4.19 (cli) (built: Jul 28 2016 19:31:33)

Yes. guzzlehttp exists in /Mailgun/vendor/. Here are the contents of extensions/Mailgun/vendor:

autoload.php  bin  composer  doctrine  guzzlehttp  jakub-onderka  mailgun  phpdocumentor  php-http  phpspec  phpunit  psr  sebastian  symfony  webmozart

@01tonythomas Quick update, I've actually got it working. I'm honestly not sure what happened between last night and now... I just grepped my bash history and nothing that I've done was different than last night...even more frustrating than if it still wasn't working.

I was going to edit your extensions wiki page, but first wanted to verify:

  1. The download link here does not come with Mailgun.php for some reason. You have to download it from git for the correct package.
  2. You need to install composer
  3. You need to run composer from the extension/Mailgun/ directory.
  4. You have to run maintainence/rebuildLocalizationCache.php

These steps seem necessary to get it to work however are not covered in the wiki documentation.

01tonythomas closed this task as Resolved.Jun 10 2017, 3:11 PM