Operating system and version selection
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 has reached its end of life, upgrade is strongly recommended.
- WARNING: %s is a development version, not ready for production.
- WARNING: %s will reach its end of life in $eol, in $months months, upgrade is heartily recommended.
- WARNING: %s will reach its end of life in $eol, in $weeks weeks, upgrade is strongly recommended.
- WARNING: %s will reach its end of life in $eol, in $days days, upgrade is urgently recommended.
- %s provides PHP version %s in its official repository
- WARNING, PHP version %s have reached its end of life, despite packages have security fixes, you should consider a maintained version.
- PHP %s is a maintained version (> %s).
- $arch is not planed for now
- aarch64 for Fedora $ver is not planed for now
- aarch64 for Enterprise Linux $ver is not planed for now
- Command to install the Remi repository configuration package:");
printf("
$yum install https://rpms.remirepo.net/fedora/remi-release-%d.rpm
", $ver); printf(" - Command to enabled the CRB repository:");
printf("
subscription-manager repos --enable codeready-builder-for-rhel-%d-%s-rpms
- Command to enabled the CRB repository:");
printf("
dnf config-manager --set-enabled %s
- Command to install the EPEL repository configuration package:");
printf("
$yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-%d.noarch.rpm
- Command to install the Remi repository configuration package:");
printf("
$yum install https://rpms.remirepo.net/enterprise/remi-release-%d.rpm
", $ver); printf(" - Command to install the yum-utils package (for the yum-config-manager command):");
printf("
$yum install yum-utils
"); } if ($ver == EL_DEV && EPEL_DEV < 2) { printf(" - As EPEL is not yet fully populated, you probably have to enable the main repository:");
printf("
dnf config-manager --enable remi
- On RHEL you (probably) need to enable the optional channel for some dependencies.
- 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(" - You want a single version which means replacing base packages from the distribution
- Packages have the same name than the base repository, ie php-*
- Sorry, but PHP version greater than %s are not available for %s.
- Sorry, but PHP version %s are not yet available for %s as single version, try multiple versions.
- Sorry, but PHP version older than %s are not available for %s, try multiple versions.
- Some common dependencies are available in remi-safe repository, which is enabled by default
- Some common dependencies are available in remi repository, which need to be enabled");
printf("
dnf config-manager --set-enabled remi
- PHP version %s packages are available for %s in remi-modular repository
- You have to enable the module stream for $php, and update the old version if installed:");
printf("
dnf module switch-to php:remi-%s
", $php); printf(" - If no version is installed, command to install the php stream default profile:");
printf("
dnf module install php:remi-%s
", $php); printf(" - PHP version %s packages are available for %s in %s repository
- Command to enable the repository:");
printf("
yum-config-manager --disable 'remi-php*'"); printf( "\n yum-config-manager --enable %s
- You can check the list of the enabled repositories:");
printf("
yum repolist
- If the priorities plugin is enabled, ensure %s have higher priority (a lower value) than %s
- If an old version is installed, command to upgrade:");
printf("
$yum update
"); printf(" - If no version is installed, command to install the php command:");
printf("
$yum install php-cli
"); printf(" - Command to install additional packages (xxx for SAPI or extension name):");
printf("
$yum install php-xxx
"); printf(" - Command to install testing packages:");
printf("
$yum --enablerepo=%s-test install php-xxx
", $repo); printf(" - Command to check the installed version and available extensions:");
printf("
php --version\n php --modules
"); printf(" - You want multiple versions which means using a Software Collection
Tips: For Software Collection usage read: "; echo "My PHP Workstation
";
if (version_compare($php, $osmax[$os], '>')) {
printf("- Sorry, but PHP version greater than %s are not available for %s (%s).
- Sorry, but PHP version older than %s are not available for %s (%s).
- WARNING: PHP version %s is a development version, not ready for production.
- Some common dependencies are available in remi repository, which need to be enabled");
printf("
dnf config-manager --set-enabled remi
- The %s collection is available in the $repo repository
- Command to install:");
printf("
$yum install %s
", $scl); printf(" - Command to install additional packages:");
printf("
$yum install %s-php-xxx
", $scl); } else { $repo = 'remi-safe'; //($phpvers[$php] ? 'remi-safe' : 'remi-test'); // Dev version $opt = ""; //($phpvers[$php] ? '' : '--enablerepo=remi-test'); // Dev version printf(" - The %s collection is available in the $repo repository
- Command to install:");
printf("
$yum $opt install %s
", $scl); printf(" - Command to install additional packages:");
printf("
$yum $opt install %s-php-xxx
", $scl); } printf(" - Command to install testing packages:");
printf("
$yum --enablerepo=remi-test install %s-php-xxx
", $scl); printf(" - Command to check the installed version and available extensions:");
printf("
%s --version\n %s --modules
", $scl, $scl); printf(" - When a single version is installed, command in default path (/usr/bin/php) can be installed:");
printf("
$yum install %s-syspaths
", $scl); printf(" Please select the operating system you are running.
";
echo "Tips: check the content of /etc/redhat-release.
";
} else if (!$php) {
echo "Please select PHP version you want to use.
";
echo "Tips: read: PHP Supported Versions
";
} else if (!$err) {
echo "Please select installation type
";
echo "Tips: read the FAQ
";
}
?>
", $os); } else if (($dist == 'Fedora' && $ver>=FC_DEV) || ($dist != 'Fedora' && $ver>=EL_DEV)) { printf("
", $os); } else if ($ver == 7 || $ver == 38 || ($dist=="CentOS" && $ver == 8)) { if ($ver == 38) $days = mktime(0, 0, 0, 5, 21, 2024); else if ($ver == 9) $days = mktime(0, 0, 0, 5, 31, $dist=="CentOS" ? 2027 : 2032); else if ($ver == 8) $days = mktime(0, 0, 0, 5, 31, $dist=="CentOS" ? 2024 : 2029); else if ($ver == 7) $days = mktime(0, 0, 0, 6, 30, 2024); $eol = date("F Y", $days); $days = (int)(($days - time()) / (60 * 60 * 24)); $weeks = round($days/7); $months = round($days/30); if ($months >= 6) { printf("
", $os); } else if ($weeks >= 8) { printf("
", $os); } else { printf("
", $os); } } } if ($php && $os) { printf("
", $os, is_array($osvers[$os]) ? implode(', ', $osvers[$os]) : $osvers[$os] ); if (version_compare($php, PHP_SEC, '<')) { printf("
", $php); } // else printf("
", $php, PHP_SEC); } if ($arch == 'ppc64le' || $arch == 's390x') { printf("
"); $err =true; } else if ($arch == 'aarch64') { if ($os && $dist === 'Fedora') { if ($ver < 39) { printf("
"); $err =true; } } else if ($os && $ver < 8) { printf("
"); $err =true; } else if ($os && $ver == 8) { // no older SCLs $osmin['RHEL 8'] = $osmin['CentOS 8'] = '7.2'; } } if ($php && $os && $type && !$err) { if ($dist == 'Fedora') { $mod = ($ver >= 29); $yum = 'dnf'; printf("
"); } else { $mod = ($ver >= 8); if ($ver >= 8) { $yum = 'dnf'; } else { $yum = 'yum'; } switch ($os) { case 'RHEL 8': case 'RHEL 9': printf("
", $ver, $arch); break; case 'CentOS 8': case 'CentOS 9': printf("
", $ver < 9 ? 'powertools' : 'crb'); break; } if ($ver < EL_DEV || EPEL_DEV > 0) { printf("
", $ver); } printf("
"); if ($yum === "yum") { printf("
", $ver); } printf("
"); if ($dist == 'RHEL' && $ver < 8) { printf("
"); printf("
"); } } if ($type == 'base') { printf("
"); $min = $osminbase[$os]; printf("
"); if (version_compare($php, $osmax[$os], '>')) { printf("
", $osmax[$os], $os); } else if (!$phpvers[$php]) { printf("
", $php, $os); } else if (version_compare($php, $min, '<')) { printf("
", $min, $os); } else { if ($mod) { $repo = 'remi-modular'; } else { $repo = $phpvers[$php]; } if ($dist != 'Fedora') { printf("
"); } else if ($repo != 'remi') { printf("
"); } if ($mod) { printf("
", $php, $os); printf("
"); printf("
"); } else { printf("
", $php, $os, $repo); printf("
", $repo); printf("
"); printf("
", $repo, ($dist == 'Fedora' ? 'fedora' : 'base and updates')); printf("
"); printf("
"); } printf("
"); if (version_compare($php, '7.0', '>=')) { printf("
"); } printf("
"); } $counter++; @file_put_contents(COUNTER, "$counter\n"); } else { printf("
"); $scl='php'.str_replace('.', '', $php); echo "
", $osmax[$os], $os, $arch); } else if (version_compare($php, $osmin[$os], '<')) { printf("
", $osmin[$os], $os, $arch); } else { if (!$phpvers[$php]) { printf("
", $php); } if ($dist=='Fedora') { $repo = 'remi'; //($phpvers[$php] ? 'remi' : 'remi-test'); // Dev version printf("
"); printf("
", $scl); printf("
"); printf("
", $scl); printf("
"); printf("
"); if ($phpvers[$php]) { printf("
"); } printf("
"); printf("
"); } $counter++; @file_put_contents(COUNTER, "$counter\n"); } } else if (!$os) { echo "