From 4638f990ceb4b314ce15ddfcfeeb638432273c95 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 18 Dec 2015 10:33:16 +0100 Subject: initial import --- wizard/index.php | 225 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 wizard/index.php (limited to 'wizard/index.php') diff --git a/wizard/index.php b/wizard/index.php new file mode 100644 index 00000000..546487f9 --- /dev/null +++ b/wizard/index.php @@ -0,0 +1,225 @@ + + + + + Remi's RPM repository + + + + + '5.4', + 'RHEL 6' => '5.3', + 'RHEL 5' => '5.1', + 'CentOS 7' => '5.4', + 'CentOS 6' => '5.3', + 'CentOS 5' => '5.1', + 'Fedora 23' => '5.6', + 'Fedora 22' => '5.6', + 'Fedora 21' => '5.6', +]; +$types = [ + 'base' => 'Single version', + 'scl' => 'Multiple versions', +]; +$phpvers = [ + '7.0' => 'remi-php70', + '5.6' => 'remi-php56', + '5.5' => 'remi-php55', + '5.4' => 'remi', +]; +$php = (isset($_POST['php']) && isset($phpvers[$_POST['php']]) ? $_POST['php'] : false); +$os = (isset($_POST['os']) && isset($osvers[$_POST['os']]) ? $_POST['os'] : false); +$type = (isset($_POST['type']) && isset($types[$_POST['type']]) ? $_POST['type'] : false); + +?> + +
+ +

+ Blog | + Forums | + Repository +

+
+
+
+

Operating system and version selection

+
+
    +
  • Operating system: + +

  • +
  • PHP version: + +

  • +
  • Type of installation: + +

  • +
+
+

Wizard answer

+
    +Debug: $os, $type, $php (%s)

    ", print_r($_POST, true)); +$err = false; +if ($os) { + list($dist, $ver) = explode(' ', $os, 2); + if (($dist == 'Fedora' && $ver<=FC_EOL) || ($dist != 'Fedora' && $ver<=EL_EOL)) { + printf("
  • %s have reached its end of life, upgrade is strongly recommended.

  • ", $os); + } +} +if ($php && $os) { + printf("
  • %s provides PHP version %s in its official repository

  • ", $os, $osvers[$os]); + + if ($ver < 6 && version_compare($php, '7.0', '>=')) { + printf("
  • Sorry, but PHP version %s is not available for %s, you need to run a more recent OS.

  • ", $php, $os); + $err = true; + } +} +if ($php && $os && $type && !$err) { + if ($dist == 'Fedora') { + $yum = 'dnf'; + printf("
  • Command to install the Remi repository configuration package:"); + printf("
        $yum install http://rpms.remirepo.net/fedora/remi-release-%d.rpm
    ", $ver); + printf("

  • "); + + } else { + $yum = 'yum'; + printf("
  • Command to install the EPEL repository configuration package:"); + printf("
        $yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-%d.noarch.rpm
    ", $ver); + printf("

  • Command to install the Remi repository configuration package:"); + printf("
        $yum install http://rpms.remirepo.net/enterprise/remi-release-%d.rpm
    ", $ver); + printf("

  • "); + if ($dist == 'RHEL') { + printf("
  • On RHEL you (probably) need to enable the optional channel for some dependencies.

  • "); + printf("
  • Command to enable:"); + if ($ver == 7) { + printf("
        subscription-manager repos --enable=rhel-7-server-optional-rpms
    "); + } else { + printf("
        rhn-channel --add --channel=rhel-$(uname -i)-server-optional-6
    "); + } + printf("

  • "); + } + } + if ($type == 'base') { + printf("
  • You want a single version which means replacing base packages from the distribution

  • "); + + if (version_compare($php, $osvers[$os], '<')) { + printf("
  • Sorry, but PHP version older than %s are not available for %s, try multiple versions.

  • ", $osvers[$os], $os); + + } else if (version_compare($php, $osvers[$os], '=')) { + printf("
  • PHP version %s packages are available for %s in remi repository

  • ", $php, $os); + printf("
  • Command to upgrade:"); + printf("
        $yum --enablerepo=remi update 'php*'
    "); + printf("

  • "); + printf("
  • Command to install additional packages:"); + printf("
        $yum --enablerepo=remi install php-xxx
    "); + printf("

  • "); + + } else { + printf("
  • PHP version %s packages are available for %s in %s repository

  • ", $php, $os, $phpvers[$php]); + printf("
  • Command to enable the repository:"); + if ($dist == 'Fedora') { + printf("
        dnf config-manager --enable %s
    ", $phpvers[$php]); + } else { + printf("
        yum-config-manager --enable %s
    ", $phpvers[$php]); + } + printf("

  • "); + printf("
  • Command to upgrade (the repository only provides PHP):"); + printf("
        $yum update
    "); + printf("

  • "); + printf("
  • Command to install additional packages:"); + printf("
        $yum install php-xxx
    "); + printf("

  • "); + printf("
  • Command to check the installed version and available extensions:"); + printf("
        php --version\n    php --modules
    "); + printf("

  • "); + } + } else { + printf("
  • You want multiple versions which means using a Software Collection

  • "); + $scl='php'.str_replace('.', '', $php); + + if ($dist=='Fedora' || version_compare($php, '5.6', '<')) { + printf("
  • The %s collection is available in the remi repository

  • ", $scl); + printf("
  • Command to install:"); + printf("
        $yum --enablerepo=remi install %s
    ", $scl); + printf("

  • "); + printf("
  • Command to install additional packages:"); + printf("
        $yum --enablerepo=remi install %s-php-xxx
    ", $scl); + printf("

  • "); + } else { + printf("
  • The %s collection is available in the remi-safe repository

  • ", $scl); + printf("
  • Command to install:"); + printf("
        $yum install %s
    ", $scl); + printf("

  • "); + printf("
  • Command to install additional packages:"); + printf("
        $yum install %s-php-xxx
    ", $scl); + printf("

  • "); + } + printf("
  • Command to check the installed version and available extensions:"); + printf("
        %s --version\n    %s --modules
    ", $scl, $scl); + printf("

  • "); + } +} else if (!$os) { + echo "
  • Please select the operating system you are running.

  • "; + +} else if (!$php) { + echo "
  • Please select PHP version you want to use.

  • "; + +} else if (!$err) { + echo "
  • Please select installation type

  • "; +} +?> +
+
+
+ +
+
+ +
+ + -- cgit