diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 0235cb9c..6e71ad68 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -470,6 +470,21 @@ class EEStackController(CementBaseController): Log.debug(self, 'Creating directory /var/log/php5/') os.makedirs('/var/log/php5/') + # For debian install xdebug + + if EEVariables.ee_platform_distro == "debian": + EEShellExec.cmd_exec("pear install xdebug") + + with open("/etc/php5/mods-available/xdebug.ini", + encoding='utf-8', mode='a') as myfile: + myfile.write(";zend_extension=/usr/lib/php5/20131226/" + "xdebug.so") + + EEFileUtils.create_symlink(self, ["/etc/php5/" + "mods-available/xdebug.ini", + "/etc/php5/fpm/conf.d" + "/20-xedbug.ini"]) + # Parse etc/php5/fpm/php.ini config = configparser.ConfigParser() Log.debug(self, "configuring php file /etc/php5/fpm/php.ini") diff --git a/ee/cli/plugins/stack_upgrade.py b/ee/cli/plugins/stack_upgrade.py index 6cc0e4e2..2216a2c9 100644 --- a/ee/cli/plugins/stack_upgrade.py +++ b/ee/cli/plugins/stack_upgrade.py @@ -75,15 +75,27 @@ class EEStackUpgradeController(CementBaseController): EERepo.remove(self, ppa="ppa:ondrej/php5") EERepo.add(self, ppa=EEVariables.ee_php_repo) else: - EERepo.remove(self, repo_url="deb http://packages.dotdeb.org " - "{0}-php55 all" - .format(EEVariables.ee_platform_codename)) - EERepo.add(self, repo_url=EEVariables.ee_php_repo) + EEAptGet.purge(self, ["php5-xdebug"]) + EEFileUtils.searchreplace(self, EEVariables.ee_repo_file_path, + "php55", "php56") Log.info(self, "Updating apt-cache, please wait...") EEAptGet.update(self) Log.info(self, "Installing packages, please wait ...") EEAptGet.install(self, EEVariables.ee_php) + + if EEVariables.ee_platform_distro == "debian": + EEShellExec.cmd_exec("pear install xdebug") + + with open("/etc/php5/mods-available/xdebug.ini", + encoding='utf-8', mode='a') as myfile: + myfile.write(";zend_extension=/usr/lib/php5/20131226/" + "xdebug.so") + + EEFileUtils.create_symlink(self, ["/etc/php5/mods-available/" + "xdebug.ini", "/etc/php5/fpm/conf.d" + "/20-xedbug.ini"]) + Log.info(self, "Successfully updated from PHP 5.5 to PHP 5.6") else: self.app.args.print_help() diff --git a/ee/core/variables.py b/ee/core/variables.py index d2eb9b5a..ed89c87e 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -82,9 +82,12 @@ class EEVariables(): ee_php_repo = ("deb http://packages.dotdeb.org {codename}-php56 all" .format(codename=ee_platform_codename)) ee_php = ["php5-fpm", "php5-curl", "php5-gd", "php5-imap", - "php5-mcrypt", "php5-xdebug", "php5-common", "php5-readline", + "php5-mcrypt", "php5-common", "php5-readline", "php5-mysql", "php5-cli", "php5-memcache", "php5-imagick", - "memcached", "graphviz"] + "memcached", "graphviz", "php-pear", "php5-dev"] + + if ee_platform_distro == 'Ubuntu': + ee_php = ee_php + ["php5-xdebug"] # MySQL repo and packages if ee_platform_distro == 'Ubuntu':