September 2Sep 2 AlphaGNU Standalone CWP PHP Build ManagerManaging multiple PHP versions on CWP can sometimes be difficult, especially when dependency issues involving zlib, libzip, PCRE2, GD, or other libraries cause normal PHP builds to fail.The AlphaGNU Standalone CLI CWP PHP Build Manager provides a simple alternative: build PHP directly from official PHP source while maintaining CWP-compatible PHP layouts.Why use it?If PHP installation is failing on a server because of dependency or repository problems, this manager can be used to quickly build and install the required PHP version without relying on CWP's PHP build scripts or Remi PHP packages.It supports:PHP 7.4.x through PHP 8.5.xPHP SelectorPHP-FPMPHP SwitcherMultiple PHP versions in one commandOne-line CLI installationPIE extension installationDedicated PHP 8.5 runtime for PIEAutomatic dependencies for extensions such as Redis, Memcached and ImagickInstallation/UpdateThis script will install the latest PHP even if it is not released in the CWP repository; it will download it from php.net when you specify the version during installation.Download the latest package:Install it:rm -rf /root/php-manager mkdir -p /root/php-manager cd /root/php-manager wget https://www.alphagnu.com/upload/cwp-php-manager/cwp_php_manager_alphagnu_v2.zip unzip cwp_php_manager_alphagnu_v2.zip chmod +x install.sh bin/* ./install.sh sed -i -E '/^[[:space:]]*extension_dir[[:space:]]*=[[:space:]]*["'\'']\/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-[0-9]+["'\''][[:space:]]*$/ s/^/;/' /usr/local/php/php.ini Verify:php-manager --help Start the interactive menu:php-manager Build PHP VersionsPHP SelectorBuild multiple versions:php-manager selector 7.4.33 8.2.29 8.3.8 8.4.25 8.5.10 Installed under:/opt/alt/phpXY/usr/ PHP-FPM Selectorphp-manager fpm 7.4.33 8.2.29 8.3.8 8.4.25 8.5.10 Installed under:/opt/alt/php-fpmXY/usr/ PHP SwitcherSwitcher uses one exact version:php-manager switcher 8.5.10 Installed under:/usr/local/php/ Dedicated PHP Runtime for PIEThe manager includes a separate PHP 8.5 CLI runtime exclusively for PIE. The first time you run the PIE installer, it will take some time because PHP will be built.It is installed at:/usr/local/php-pie/ Build or verify it with:php-manager pie-runtime 8.5.10 Verify:/usr/local/php-pie/bin/php -v This runtime does not replace the server's default PHP and does not create an FPM service.Install PHP Extensions with PIEYou can find available PHP extension package names by visiting:https://packagist.org/extensionsSearch for the extension you want to install and use its PIE package name.Install an Extension for PHP-FPMFor example, install Memcached for PHP-FPM 7.4:php-manager pie 7.4 php-memcached/php-memcached fpmRedis:php-manager pie 7.4 phpredis/phpredis fpmImagick:php-manager pie 7.4 imagick/imagick fpmAPCu:php-manager pie 7.4 apcu/apcu fpmYou can also specify the exact PHP version:php-manager pie 7.4.33 imagick/imagick fpmWhen using only the major/minor version, such as 7.4, PHP Manager automatically detects the installed PHP 7.4.x version.Install an Extension for Multiple PHP VersionsYou can install the same extension for multiple PHP versions in a single command:php-manager pie 8.0 8.1 8.2 8.3 8.4 8.5 imagick/imagick fpmThe manager resolves each minor version to the corresponding installed PHP version and installs the extension for each target.Install an Extension for All PHP VersionsTo install an extension for all installed PHP versions across all three PHP managers, use:php-manager pie all imagick/imagickYou can also restrict all to a specific PHP manager:php-manager pie all imagick/imagick fpmphp-manager pie all imagick/imagick selectorphp-manager pie all imagick/imagick switcherPHP Manager TargetsUse the following target names:TargetPHP ManagerfpmPHP-FPM SelectorselectorPHP SelectorswitcherPHP SwitcherFor example:php-manager pie 8.3 imagick/imagick fpminstalls Imagick for the installed PHP 8.3.x PHP-FPM Selector version.php-manager pie 8.3 imagick/imagick selectorinstalls Imagick for the installed PHP 8.3.x PHP Selector version.php-manager pie 8.3 imagick/imagick switcherinstalls Imagick for the installed PHP 8.3.x PHP Switcher version.PIE RuntimePIE runs using the dedicated PHP 8.5 runtime:/usr/local/php-pie/bin/phpThe PIE runtime is separate from the PHP Selector, PHP-FPM Selector, and PHP Switcher installations.The extension is compiled against the selected target PHP version using that target's own:phpize php-configThis allows the dedicated PIE runtime to build extensions for the selected PHP installation while keeping the existing PHP Manager installations separate.Quick PHP Recovery / Alternative Build MethodOn some servers, the standard CWP PHP build process can fail because of dependency problems such as:zliblibzipPCRE2GD librariesincompatible system development packagesInstead of spending time troubleshooting the CWP build wrapper, you can use AlphaGNU PHP Manager to build the required PHP version directly from the official PHP source.For example:php-manager fpm 8.3.8 or:php-manager selector 8.3.8 This makes the manager useful not only for installing additional PHP versions, but also as a quick alternative when the normal CWP PHP build process is blocked by dependency issues.SummaryAlphaGNU PHP Manager provides a standalone way to manage PHP versions on CWP-compatible servers without depending on CWP's PHP build wrapper scripts or Remi repositories.It supports:PHP Selector PHP-FPM PHP Switcher PIE Extensions Dedicated PHP 8.5 PIE Runtime Multiple PHP Versions One-Line Builds For servers where normal PHP builds are failing due to dependency problems, it provides a practical and faster alternative for getting the required PHP version installed.
September 2Sep 2 Author If there are any issues, let me know. I'll try to fix them.CHANGELOG: https://www.alphagnu.com/upload/cwp-php-manager/changelog.txt
September 2Sep 2 Author To install the ionCube and SourceGuardian loaders across all installed PHP environments which are installed, run this scriptcurl -fsSL https://www.alphagnu.com/upload/ioncube-sourceguardian-install.sh | bash
September 2Sep 2 Author While using the PHP Manager CLI script to install PHP (FPM) in CWP, the php-fpm.conf configuration file needs to be present in the Apache conf.d directory.If the php-fpm.conf file is missing, you can run the following command to create it. This loads the FPM module required for PHP-FPM to work:mkdir -p /usr/local/apache/conf.d; if [ ! -f /usr/local/apache/conf.d/php-fpm.conf ]; then printf '%s\n' '<IfModule !proxy_fcgi_module>' ' LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so' '</IfModule>' > /usr/local/apache/conf.d/php-fpm.conf; fi; systemctl restart httpd The command creates the file only if it doesn't already exist, then restarts Apache.** Copy the whole command and paste it into the SSH terminal as root and execute.
Wednesday at 07:21 PM4 days Thanks for this Sandeep. Do you think your will integrate it into CWP?I appreciate the thought that went into it and that the TUI has options/ variables visually displayed, that goes a long way in making it a tool that people will use without having to be specific command or syntax fluent to get waht needs to be done. Soon Sandeep I will be sending you a little something so you can buy yoirself a coffee or something.Again, your devops and sharing is appracited.
Thursday at 05:57 PM3 days Author 22 hours ago, enetworkassociates said:Thanks for this Sandeep. Do you think your will integrate it into CWP?I appreciate the thought that went into it and that the TUI has options/ variables visually displayed, that goes a long way in making it a tool that people will use without having to be specific command or syntax fluent to get waht needs to be done.Soon Sandeep I will be sending you a little something so you can buy yoirself a coffee or something.Again, your devops and sharing is appracited.Thank you very much for your kind words and support. I really appreciate it!At this time, there are no plans to integrate this project into CWP. I’m planning to maintain and develop it independently as a separate project.I’m glad you found the TUI and its approach useful. Thanks again for taking the time to check it out.
Create an account or sign in to comment