ServerLamp.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:ezhost 作者: zhexiao 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号