From 4867709a6ee1cd881860c38c61364de79b73187d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 27 Jun 2014 12:10:39 +0000 Subject: [PATCH] enable mcyrpt PHP extension for Ubuntu 14.04+ --- doc/rpm-build/post_install.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/rpm-build/post_install.php b/doc/rpm-build/post_install.php index 6d600c3ccc..ed994a900b 100755 --- a/doc/rpm-build/post_install.php +++ b/doc/rpm-build/post_install.php @@ -64,6 +64,7 @@ $config = array( 'cyrus' => '', // deprecated use 'imap' 'install-update-app' => '', // install or update a single (non-default) app 'webserver_user'=> 'apache', // required to fix permissions + 'php5enmod' => '', ); // read language from LANG enviroment variable @@ -121,6 +122,11 @@ function set_distro_defaults($distro=null) $config['start_db'] = '/etc/init.d/mysql'; $config['start_webserver'] = '/etc/init.d/apache2'; } + // enable mcrypt + if (file_exists('/usr/sbin/php5enmod')) + { + $config['php5enmod'] = '/usr/sbin/php5enmod -s ALL mcrypt'; + } $config['autostart_db'] = '/usr/sbin/update-rc.d mysql defaults'; $config['autostart_webserver'] = '/usr/sbin/update-rc.d apache2 defaults'; $config['webserver_user'] = 'www-data'; @@ -293,6 +299,11 @@ if (!file_exists($config['header']) || filesize($config['header']) < 200) // def } run_cmd($setup_ldap); } + // enable mcrypt extension eg. for Ubuntu 14.04+ + if (!empty($config['php5enmod'])) + { + run_cmd($config['php5enmod']); + } // create header $setup_header = $setup_cli.' --create-header '.escapeshellarg($config['config_passwd'].','.$config['config_user']).