mautic-documentation icon indicating copy to clipboard operation
mautic-documentation copied to clipboard

Make a list of all required PHP modules

Open StoppingBuck opened this issue 5 years ago • 10 comments

Inspired by this old, closed Mautic issue I think it would be a good idea to have a list of the required PHP modules somewhere in the Documentation - the docs mention the required PHP version, but not what extensions should be enabled. There is an extensions check done during installation, as the Getting started mentions in passing, but it would be nice to have a list somewhere in the docs so we don't have to go digging in app/bundles/InstallBundle/Configurator/Step/CheckStep.php to find it :slightly_smiling_face:


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

StoppingBuck avatar Jul 17 '20 07:07 StoppingBuck

Thanks for the suggestion @StoppingBuck - I've often thought that this would be really helpful!

RCheesley avatar Jul 17 '20 07:07 RCheesley

Simply take your source code

https://github.com/mautic/mautic/blob/b584b356315fea69208daac881541f4c7d01311a/composer.json#L6-L16

ask PHP CompatInfo what extensions are used

https://github.com/llaville/php-compat-info

and remove default extensions (mainly php -n -m)

Done 🍏

szepeviktor avatar Jul 17 '20 19:07 szepeviktor

For 2.16 (since I haven't upgraded to M3 yet):

Going through https://github.com/mautic/mautic/blob/2.16/app/bundles/InstallBundle/Configurator/Step/CheckStep.php together with https://github.com/mautic/mautic/blob/2.16/app/bundles/InstallBundle/Translations/en_US/messages.ini I seem to find these PHP modules:

Mandatory:

  • php-ctype
  • php-curl
  • php-fileinfo
  • php-json
  • php-mbstring
  • php-tokenizer
  • php-session (turned on by default in PHP, see @szepeviktor comment below)
  • php-openssl (turned on by default in PHP, see @szepeviktor comment below)
  • php-prce (turned on by default in PHP, see @szepeviktor comment below)
  • XML extensions. The code mentions both "the SimpleXML extension", "the XML extension" and php-xml, but I'm guessing they're all the same module. At least on Ubuntu, php-simplexml is a virtual package pointing to php-xml. It might also be referring to libxml.

Optional:

  • php-iconv (optional)
  • php-imap (optional)
  • php-intl (optional)
  • php-posix (optional)
  • php-zip (optional) - EDIT: Seems to be mandatory for the M3 upgrade script

Some not-directly-module-related checks:

  • mautic.install.apc.version="When using APC, you must use version %minapc% or newer. You have version %currentapc% installed. Please update your APC extension."
  • CheckStep also checks for Suhosin: mautic.install.suhosin.whitelist="Suhosin is not properly configured, add <strong>phar</strong> to <strong>suhosin.executor.include.whitelist</strong> in your PHP configuration."
  • Likewise, mautic.install.xdebug.exception.trace="Xdebug's 'show_exception_trace' option should be disabled in your PHP configuration." and mautic.install.xdebug.scream="Xdebug's 'scream' option should be disabled in your PHP configuration."
  • Also mautic.install.xdebug.nesting="Set <strong>xdebug.max_nesting_level</strong> to at least <strong>250</strong> in your PHP configuration to stop Xdebug's infinite recursion protection from erroneously throwing a fatal error."
  • And finally mautic.install.extension.eaccelerator="eAccelerator is incompatible with Mautic. Please disable it."

Next step is to check what has changed for M3 - and then, find where to put the list :slightly_smiling_face:

StoppingBuck avatar Aug 12 '20 11:08 StoppingBuck

Some PHP extensions are build into the php binary.

You may survey your php binary by issuing php -n -m

💡 There are funky linux distributions lacking some extension from the php binary.

szepeviktor avatar Aug 12 '20 12:08 szepeviktor

PHP 7.3.21-1+0~20200807.66+debian9~1.gbp18a1c2 has

Core date filter hash libxml openssl pcntl pcre Reflection session sodium SPL standard zlib

php7.3-xml on e.g. Debian contains

/usr/lib/php/20180731/dom.so
/usr/lib/php/20180731/simplexml.so
/usr/lib/php/20180731/wddx.so
/usr/lib/php/20180731/xml.so
/usr/lib/php/20180731/xmlreader.so
/usr/lib/php/20180731/xmlwriter.so
/usr/lib/php/20180731/xsl.so

szepeviktor avatar Aug 12 '20 12:08 szepeviktor

Another one that's needed (found out by accident) is php-mysqli (if you are using mysqli as database connector)

StoppingBuck avatar Aug 28 '20 14:08 StoppingBuck

What about imagemagick/graphicsmagick or (My)SQL client, cron? Is this documented anywhere already?

CybotTM avatar Jan 18 '21 12:01 CybotTM

Thanks @CybotTM for your many comments today! Indeed as the issue highlights, this is not currently documented but we want to improve this. One of our strategic initiatives is to improve the install upgrade process and the accompanying documentation however we have not yet managed to get folk together to form the team. Would that be of interest?

If you would like to kick it off you can make a PR to this repo and review the styleguide for contributing here.

RCheesley avatar Jan 18 '21 16:01 RCheesley

@RCheesley , thanks for the hint, but I'm currently busy with building a Mautic container image. Which is updatable and for all major 3 versions: https://github.com/netresearch/docker-mautic - my findings are added there.

CybotTM avatar Feb 13 '21 12:02 CybotTM

Great - would be awesome if you would consider joining the team who are maintaining the official Docker image - it is very much under resourced and we would welcome more involvement!

RCheesley avatar Feb 13 '21 12:02 RCheesley