- # noninteractive to avoid mysql password prompt
- DEBIAN_FRONTEND=noninteractive apt-get -y install mediawiki ImageMagick php5-mysqlnd php-apc
+ DEBIAN_FRONTEND=noninteractive apt-get install -y imagemagick
+ if apt-get install -s mediawiki &>/dev/null; then
+ # mediawiki is packaged in jessie backports.
+ DEBIAN_FRONTEND=noninteractive apt-get -y install php5-apcu mediawiki
+ else
+ # https://www.mediawiki.org/wiki/Manual:Installation_requirements
+ if apt-get install -s php7.0 &>/dev/null; then
+ # note, 7.0 is untested by the editor here, since it's not
+ # available in debian 8. it's listed as supported
+ # in the mediawiki page.
+ # noninteractive to avoid mysql password prompt.
+ DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 \
+ default-mysql-server \
+ php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-xml \
+ php7.0-apcu php7.0-mbstring
+ else
+ # note: mbstring is recommended, but it's not available for php5 in
+ # debian jessie.
+ DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 \
+ default-mysql-server \
+ php5 php5-mysql libapache2-mod-php5 php5-apcu
+ fi
+ fi