def install_php(self):
if self.args.force or prompt(red(' * Install PHP (y/n)?'), default='y') == 'y':
try:
sudo('apt-get install php5 php5-cli php5-mysql php5-gd php5-curl libapache2-mod-php5 php5-mcrypt -y')
# do apache config
put(StringIO(self.apache_dir_index), '/etc/apache2/mods-enabled/dir.conf', use_sudo=True)
sudo('service apache2 restart')
print(green(' * Installed php5 and php5-mysql in the system.'))
except:
print(red(' * Install php5 and php5-mysql failed.'))
# write phpinfo for test
put(StringIO(self.phpinfo), '{0}/info.php'.format(self.apache_web_dir), use_sudo=True)
print(green(' * Done'))
print()
评论列表
文章目录