Skip to content
View in the app

A better way to browse. Learn more.

AlphaGNU

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Standalone CWP PHP CLI Build Manager: Build PHP 7.4–8.5, PHP-FPM, Selector, Switcher and PIE Extensions

Featured Replies

AlphaGNU Standalone CWP PHP Build Manager

Managing 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.x

  • PHP Selector

  • PHP-FPM

  • PHP Switcher

  • Multiple PHP versions in one command

  • One-line CLI installation

  • PIE extension installation

  • Dedicated PHP 8.5 runtime for PIE

  • Automatic dependencies for extensions such as Redis, Memcached and Imagick


Installation/Update

This 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 Versions

PHP Selector

Build 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 Selector

php-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 Switcher

Switcher uses one exact version:

php-manager switcher 8.5.10

Installed under:

/usr/local/php/

Dedicated PHP Runtime for PIE

The 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 PIE

You can find available PHP extension package names by visiting:

https://packagist.org/extensions

Search for the extension you want to install and use its PIE package name.

Install an Extension for PHP-FPM

For example, install Memcached for PHP-FPM 7.4:

php-manager pie 7.4 php-memcached/php-memcached fpm

Redis:

php-manager pie 7.4 phpredis/phpredis fpm

Imagick:

php-manager pie 7.4 imagick/imagick fpm

APCu:

php-manager pie 7.4 apcu/apcu fpm

You can also specify the exact PHP version:

php-manager pie 7.4.33 imagick/imagick fpm

When 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 Versions

You 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 fpm

The manager resolves each minor version to the corresponding installed PHP version and installs the extension for each target.

Install an Extension for All PHP Versions

To install an extension for all installed PHP versions across all three PHP managers, use:

php-manager pie all imagick/imagick

You can also restrict all to a specific PHP manager:

php-manager pie all imagick/imagick fpm
php-manager pie all imagick/imagick selector
php-manager pie all imagick/imagick switcher

PHP Manager Targets

Use the following target names:

Target

PHP Manager

fpm

PHP-FPM Selector

selector

PHP Selector

switcher

PHP Switcher

For example:

php-manager pie 8.3 imagick/imagick fpm

installs Imagick for the installed PHP 8.3.x PHP-FPM Selector version.

php-manager pie 8.3 imagick/imagick selector

installs Imagick for the installed PHP 8.3.x PHP Selector version.

php-manager pie 8.3 imagick/imagick switcher

installs Imagick for the installed PHP 8.3.x PHP Switcher version.

PIE Runtime

PIE runs using the dedicated PHP 8.5 runtime:

/usr/local/php-pie/bin/php

The 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-config

This 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 Method

On some servers, the standard CWP PHP build process can fail because of dependency problems such as:

  • zlib

  • libzip

  • PCRE2

  • GD libraries

  • incompatible system development packages

Instead 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.


Summary

AlphaGNU 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.

Screenshot 2026-09-02 123040.png

Screenshot 2026-09-02 123216.png

  • 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.

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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.