<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta content="text/html; charset=utf-8" http-equiv="content-type" />
		<title>Remi's RPM repository</title>
		<link href="../enterprise/7/remi/x86_64/repoview/layout/repostyle.css" type="text/css" rel="stylesheet" />
		<meta content="index,follow" name="robots" />
		<link rel="shortcut icon" href="/favicon.ico" />
</head>
<?php
define('FC_EOL', 30);
define('FC_DEV', 33);
define('EL_EOL', 5);
define('EL_DEV', 9);
define('COUNTER', __DIR__ . "/counter.txt");

$osvers = [
    'RHEL 8'    => ['7.2','7.3'],
    'RHEL 7'    => '5.4',
    'RHEL 6'    => '5.3',
    'CentOS 8'  => ['7.2','7.3'],
    'CentOS 7'  => '5.4',
    'CentOS 6'  => '5.3',
    'Fedora 33' => '7.4',
    'Fedora 32' => '7.4',
    'Fedora 31' => '7.3',
];
$osmin = [
    'RHEL 8'    => '5.6',
    'RHEL 7'    => '5.4',
    'RHEL 6'    => '5.4',
    'CentOS 8'  => '5.6',
    'CentOS 7'  => '5.4',
    'CentOS 6'  => '5.4',
    'Fedora 33' => '5.6',
    'Fedora 32' => '5.6',
    'Fedora 31' => '5.6',
];
$osmax = [
    'RHEL 8'    => '8.0',
    'RHEL 7'    => '8.0',
    'RHEL 6'    => '7.3',
    'CentOS 8'  => '8.0',
    'CentOS 7'  => '8.0',
    'CentOS 6'  => '7.3',
    'Fedora 33' => '8.0',
    'Fedora 32' => '8.0',
    'Fedora 31' => '8.0',
];
$osname = [
    'RHEL 8'    => 'RHEL-8',
    'RHEL 7'    => 'RHEL-7 (maintained until June 2024)',
    'RHEL 6'    => 'RHEL-6 (maintained until November 2020)',
    'CentOS 8'  => 'CentOS 8',
    'CentOS 7'  => 'CentOS 7 (maintained until June 2024)',
    'CentOS 6'  => 'CentOS 6 (maintained until November 2020)',
    'Fedora 33' => 'Fedora 33 (development version)',
    'Fedora 32' => 'Fedora 32',
    'Fedora 31' => 'Fedora 31',
];
$grpname = [
    'RHEL'    => 'Red Hat Enterprise Linux',
    'CentOS'  => 'CentOS',
    'Fedora'  => 'Fedora',
];
$types = [
    'base' => 'Default / Single version (simplest way)',
    'scl'  => 'Multiple versions simultaneously',
];
$phpvers = [
	// use false when only SCL
	'8.0' => 'remi-php80',
    '7.4' => 'remi-php74',
    '7.3' => 'remi-php73',
    '7.2' => 'remi-php72',
    '7.1' => 'remi-php71',
    '7.0' => 'remi-php70',
    '5.6' => 'remi-php56',
    '5.5' => 'remi-php55',
    '5.4' => 'remi-php54',
];
$phpname = [
	':devel'  => 'Development version, not ready for production',
		'8.0' => '8.0.0rc1',
	':stable' => 'Stable versions - usage recommended',
		'7.4' => '7.4.11 (active support until November 2021)',
		'7.3' => '7.3.23 (active support until December 2020)',
	':secure' => 'Security only versions',
		'7.2' => '7.2.34 (security only support until November 2020)',
	':eol'    => 'Deprecated versions - usage discouraged',
		'7.1' => '7.1.33 (no upstream support since December 2019)',
		'7.0' => '7.0.33 (no upstream support since December 2018)',
		'5.6' => '5.6.40 (no upstream support since January 2019)',
		'5.5' => '5.5.38 (no upstream support since July 2016)',
		'5.4' => '5.4.45 (no upstream support since September 2015)',
];
$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);

?>
<body>
	<div id="page">
		<div id="top">
			<h1><span><a href="/">Remi's RPM repository - Configuration wizard</a></span></h1>
		</div>
		<p id="prelude">
			<a href="https://blog.remirepo.net/">Blog</a> |
			<a href="https://forum.remirepo.net/">Forum</a> |
			<a href="https://rpms.remirepo.net/">Repository</a> |
			<a href="https://rpms.remirepo.net/wizard/">Wizard</a>
		</p>
		<div id="wrapper">
			<div id="main">
				<div id="content">
                                    <h2>Operating system and version selection</h2>
                                    <form method='post'>
                                    <ul class="pkglist">
                                    <li><p>Operating system:
                                        <select name='os' onChange='submit()'>
                                        <option value=''>--</option>
<?php
                                        $prev = false;
                                        foreach($osvers as $osver => $phpver) {
                                            list($dist, $ver) = explode(' ', $osver, 2);
                                            if ($dist != $prev) {
                                                if ($prev) echo "</optgroup>";
                                                printf("<optgroup label='%s'>", $grpname[$prev=$dist]);
                                            }
                                            printf("<option value='%s' %s>&nbsp;&nbsp;&nbsp;&nbsp;%s</option>", $osver, ($osver===$os ? 'selected' : ''), $osname[$osver]);
                                        }
?>
                                        </optgroup></select>
                                    </p></li>
                                    <li><p>Wanted PHP version:
                                        <select name='php' onChange='submit()'>
                                        <option value=''>--</option>
<?php
                                        foreach($phpname as $phpver => $name) {
											if (is_numeric($phpver)) {
												printf("<option value='%s' %s>%s</option>", $phpver, ($phpver===$php ? 'selected' : ''), $name);
											} else {
                                                printf("<optgroup label='%s'>", $name);
											}
										}
?>
                                        </select>
                                    </p></li>
                                    <li><p>Type of installation:
                                        <select name='type' onChange='submit()'>
                                        <option value=''>--</option>
<?php
                                        foreach($types as $typeref => $name) printf("<option value='%s' %s>%s</option>", $typeref, ($typeref===$type ? 'selected' : ''), $name);
?>
                                        </select>
                                    </p></li>
                                    </ul>
                                    </form>
                                    <h2>Wizard answer</h2>
                                    <ul class="pkglist">
<?php
$counter = intval(@file_get_contents(COUNTER));

//printf("<p>Debug: $os, $type, $php (%s)</p>", print_r($_POST, true));
$err = false;
if ($os) {
    list($dist, $ver) = explode(' ', $os, 2);    
    if ($ver == 6) {
        $days = (int)((mktime(0,0,0,11,30,2020) - time()) / (60 * 60 * 24));
        printf("<li><b>WARNING: %s</b> will reach its <b>end of life</b> in November 2020, in <b>$days days</b>, upgrade is strongly recommended.</li><br />", $os);
    }
    if (($dist == 'Fedora' && $ver<=FC_EOL) || ($dist != 'Fedora' && $ver<=EL_EOL)) {
        printf("<li><b>%s</b> have reached its <b>end of life</b>, upgrade is strongly recommended.</li><br />", $os);
    }
    if (($dist == 'Fedora' && $ver>=FC_DEV) || ($dist != 'Fedora' && $ver>=EL_DEV)) {
        printf("<li><b>WARNING: %s</b> is a <b>development</b> version, not ready for production.</li><br />", $os);
    }
}
if ($php && $os) {
    printf("<li><b>%s</b> provides PHP version <b>%s</b> in its official repository</li><br />",
		$os,
		is_array($osvers[$os]) ? implode(', ', $osvers[$os]) : $osvers[$os]
	);
    if (version_compare($php, '5.6', '<')) {
        printf("<li><b>WARNING</b>, PHP version <b>%s</b> have reached its eod of life, despite packages have security fix, you should consider a maintained version.</li><br />", $php);
    }
}
if ($php && $os && $type && !$err) {
    if ($dist == 'Fedora') {
		$mod = ($ver >= 29);
        $yum = 'dnf';
        printf("<li>Command to install the Remi repository configuration package:");
        printf("<pre>    $yum install https://rpms.remirepo.net/fedora/remi-release-%d.rpm</pre>", $ver);
        printf("</li><br />");
    
    } else {
		$mod = ($ver >= 8);
		if ($ver >= 8) {
	        $yum = 'dnf';
		} else {
	        $yum = 'yum';
		}
	    printf("<li>Command to install the EPEL repository configuration package:");
	    printf("<pre>    $yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-%d.noarch.rpm</pre></li><br />", $ver);
        printf("<li>Command to install the Remi repository configuration package:");
        printf("<pre>    $yum install https://rpms.remirepo.net/enterprise/remi-release-%d.rpm</pre>", $ver);
        printf("</li><br />");

        printf("<li>Command to install the yum-utils package (for the yum-config-manager command):");
        printf("<pre>    $yum install yum-utils</pre>");
        printf("</li><br />");
        if ($dist == 'RHEL' && $ver < 8) {
            printf("<li>On <b>RHEL</b> you (probably) need to enable the <b>optional channel</b> for some dependencies.</li><br />");
            printf("</li><li>Command to enable:");
            if ($ver == 7) {
                printf("<pre>    subscription-manager repos --enable=rhel-7-server-optional-rpms</pre>");
            } else {
                printf("<pre>    rhn-channel --add --channel=rhel-$(uname -i)-server-optional-6</pre>");
            }
            printf("</li><br />");
        }
    }
    if ($type == 'base') {
        printf("<li>You want a <b>single version </b> which means replacing base packages from the distribution</li><br />");

        printf("<li>Packages have the <b>same name</b> than the base repository, ie php-*</li><br />");

        if (version_compare($php, $osmax[$os], '>')) {
            printf("<li>Sorry, but PHP version greater than <b>%s</b> are not available for <b>%s</b>.</li><br />", $osmax[$os], $os);

        } else if (!$phpvers[$php]) {
            printf("<li>Sorry, but PHP version <b>%s</b> are not yet available for <b>%s</b> as single version, try multiple versions.</li><br />", $php, $os);

        } else if (version_compare($php, $tmp=(is_array($osvers[$os]) ? $osvers[$os][0] : $osvers[$os]), '<')) {
            printf("<li>Sorry, but PHP version older than <b>%s</b> are not available for <b>%s</b>, try multiple versions.</li><br />", $tmp, $os);

        } else {
            if ($dist == 'Fedora' && version_compare($php, $tmp=(is_array($osvers[$os]) ? $osvers[$os][0] : $osvers[$os]), '=')) {
                $repo = 'remi';
            } else {
                $repo = $phpvers[$php];
            }
            if ($dist != 'Fedora') {
                printf("<li>Some common <b>dependencies</b> are available in <b>remi-safe</b> repository, which is enabled by default</li><br />");
            } else if ($repo != 'remi') {
                printf("<li>Some common <b>dependencies</b> are available in <b>remi</b> repository, which need to be enabled");
                printf("<pre>    dnf config-manager --set-enabled remi</pre></li><br />");
            }

            if ($dist == 'Fedora' || $yum == 'yum') {
                printf("<li>PHP version <b>%s</b> packages are available for <b>%s</b> in <b>%s</b> repository</li><br />", $php, $os, $repo);
	            printf("<li>Command to enable the repository:");
            }
            if ($dist == 'Fedora') {
                printf("<pre>    dnf config-manager --set-enabled %s</pre></li><br />", $repo);
                if ($mod) {
                    printf("<li>Command to disable the modular repository:");
                    printf("<pre>    dnf config-manager --set-disabled remi-modular</pre></li><br />");
                    printf("<li>Alternatively, you may prefer the modern way, by to enabling the module stream for $php:");
                }
            } else if ($yum == 'yum') { // EL-6, 7
                printf("<pre>    yum-config-manager --disable 'remi-php*'");
                printf(   "\n    yum-config-manager --enable   %s</pre></li><br />", $repo);

                printf("<li>You can check the list of the enabled repositories:");
                printf("<pre>    yum repolist</pre></li><br />");
                printf("<li>If the <b>priorities</b> plugin is enabled, ensure %s have higher priority (a lower value) than %s</li><br />", $repo, ($dist == 'Fedora' ? 'fedora' : 'base and updates'));
            } else { // EL-8, module only
                printf("<li>You have to enable the module stream for $php:");
            }

            if ($mod) {
                printf("<pre>    dnf module reset php");
                printf(   "\n    dnf module install php:remi-%s</pre>", $php);
                printf("</li><br />");
            }

            printf("<li>Command to upgrade (the repository only provides PHP):");
            printf("<pre>    $yum update</pre>");
            printf("</li><br />");

            printf("<li>Command to install <b>additional</b> packages:");
            printf("<pre>    $yum install php-xxx</pre>");
            printf("</li><br />");

            if (version_compare($php, '7.0', '>=')) {
                printf("<li>Command to install <b>testing</b> packages:");
                if ($dist != 'Fedora' && $mod) {
                   printf("<pre>    $yum --enablerepo=remi-modular-test install php-xxx</pre>", $repo);
                } else {
                   printf("<pre>    $yum --enablerepo=%s-test install php-xxx</pre>", $repo);
                }
                printf("</li><br />");
            }

            printf("<li>Command to check the installed version and available extensions:");
            printf("<pre>    php --version\n    php --modules</pre>");
            printf("</li><br />");
        }
        $counter++;
        @file_put_contents(COUNTER, "$counter\n");

    } else {
        printf("<li>You want <b>multiple versions </b> which means using a <a href='https://www.softwarecollections.org/en/'>Software Collection</a></li><br />");
        $scl='php'.str_replace('.', '', $php);
        
        if (version_compare($php, $osmax[$os], '>')) {
            printf("<li>Sorry, but PHP version greater than <b>%s</b> are not available for <b>%s</b>.</li><br />", $osmax[$os], $os);
        } else if (version_compare($php, $osmin[$os], '<')) {
            printf("<li>Sorry, but PHP version older than <b>%s</b> are not available for <b>%s</b>.</li><br />", $osmin[$os], $os);
        } else {
            if (!$phpvers[$php]) {
                printf("<li><b>WARNING</b>: PHP version <b>%s</b> is a <b>development</b> version, not ready for production.</li><br />", $php);
            }
            if ($dist=='Fedora') {
                $repo = ($phpvers[$php] ? 'remi' : 'remi-test'); // Dev version

                printf("<li>The <b>%s</b> collection is available in the <b>$repo</b> repository</li><br />", $scl);
                printf("<li>Command to install:");
                printf("<pre>    $yum --enablerepo=$repo install %s</pre>", $scl);
                printf("</li><br />");
                printf("<li>Command to install additional packages:");
                printf("<pre>    $yum --enablerepo=$repo install %s-php-xxx</pre>", $scl);
            } else {
                $repo = ($phpvers[$php] ? 'remi-safe' : 'remi-test'); // Dev version
                $opt  = ($phpvers[$php] ? '' : '--enablerepo=remi-test'); // Dev version

                printf("<li>The <b>%s</b> collection is available in the <b>$repo</b> repository</li><br />", $scl);
                printf("<li>Command to install:");
                printf("<pre>    $yum $opt install %s</pre>", $scl);
                printf("</li><br />");
                printf("<li>Command to install <b>additional</b> packages:");
                printf("<pre>    $yum $opt install %s-php-xxx</pre>", $scl);
            }
            printf("</li><br />");
            if ($phpvers[$php]) {
                printf("<li>Command to install <b>testing</b> packages:");
                printf("<pre>    $yum --enablerepo=remi-test install %s-php-xxx</pre>", $scl);
                printf("</li><br />");
            }

            printf("<li>Command to check the installed version and available extensions:");
            printf("<pre>    %s --version\n    %s --modules</pre>", $scl, $scl);
            printf("</li><br />");
        }
        $counter++;
        @file_put_contents(COUNTER, "$counter\n");
    }
} else if (!$os) {
    echo "<li><p>Please select the operating system you are running.</p></li>";
    echo "<li><p><b>Tips</b>: check the content of /etc/redhat-release.</p></li>";

} else if (!$php) {
    echo "<li><p>Please select PHP version you want to use.</p></li>";
	echo "<li><p><b>Tips</b>: read: <a href='https://www.php.net/supported-versions.php'>PHP Supported Versions</a></li>";

} else if (!$err) {
    echo "<li><p>Please select installation type</p></li>";
    echo "<li><p><b>Tips</b>: read the <a href='https://blog.remirepo.net/pages/English-FAQ#scl'>FAQ</a></p></li>";
}
?>
                                    </ul>
                                </div>
			</div>
			<div id="sidebar">
				<h2>Useful links</h2>
				<ul class="levbarlist">
					<li><a href="https://blog.remirepo.net/pages/Config-en" class="nlink" title="Repository configuration">Repository configuration</a></li>
					<li><a href="https://blog.remirepo.net/pages/English-FAQ"  class="nlink" title="F.A.Q.">F.A.Q.</a></li>
					<li><a href="https://forum.remirepo.net/"  class="nlink" title="Forum">Forum</a></li>
					<li><a href="https://github.com/remicollet/remirepo/issues"  class="nlink" title="Bug tracker">Bug tracker</a></li>
					<li><a href="https://blog.remirepo.net/post/2012/09/03/remirepo-IRC-channel-on-freenode-network"  class="nlink" title="IRC channel">IRC channel</a></li>
					<li><a href='https://twitter.com/RemiRepository'>Repository twitter account</a></li>
					<li><?php
					printf("<b>%d answers</b> given", $counter);
					?></li>
				</ul><br /><br /><br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><div>
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHLwYJKoZIhvcNAQcEoIIHIDCCBxwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCCgxEE65DWq8388bFX5PaEG8cAOPUkBi8wbB8QZowA33/RG2ZL2AMMMYPuXfFUDB/oa1huOaWmTdoyi9vFuBYw8bxYniwXlkoZWOABdYIckvy5KMJX3bK8WU6wDLlVJvnPy6+Vp/nDK0c823zM1ZHX5ZEiMtO7ddCH4h5ckGVH6DELMAkGBSsOAwIaBQAwgawGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI4M5ItoPa/1iAgYh/cDUWOuv2PZOUYssgGD+Ntl6uQnpQX6KxqFpvIrbe6RwvDQncvvczSuXI+I7V2iWa/B5SMJnRXlbImrgnJrn6sFITNYzn0396jk89sd7auNYmP7zIKHxzUUNkiT3JeEagIJeHyiPSkVEcwYLFB5/sUVzY+8PtAbp+wwC5t7Q7AiHJiG9wY4UwoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNV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GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTAwNjA0MDU1NTEwWjAjBgkqhkiG9w0BCQQxFgQUo6DkEDxwjY+LFKOw0Vcxh7zRkPYwDQYJKoZIhvcNAQEBBQAEgYCzm9l6X7egJAMom1ZVdV1MqM30cxNGrQeQNQhgj8NnNs4N8uJ+sGeEXDlLdkkUJS4mUlAG6JwvOcCGr++NJUF+qmpQmX7YzbjBnt3pnWfcCrtYVkgCg/d0M+0ZEWTQEP3aMqIL/zeg70LYhg4/kgfR2jrN2IwxkChLoiZi6bQulQ==-----END PKCS7-----
" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" />
<img alt="" src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" width="1" height="1" />
</div></form>

			</div>
		</div>
	        <hr style="clear:both;"/>
	        
	</div>
</body>
</html>