Documentation

Add a PHP version

Install another PHP branch next to the existing ones, adjust its php.ini, offer it to websites and move sites over, all from the panel.

Step by step 2 min read Updated

Before you start#

StackRegent runs PHP through FastCGI in IIS, with each website's PHP running as the subscription's own Windows user and a php.ini built from the server-wide file of its version plus the website's own settings. Several PHP versions can be installed side by side, and each website chooses its own.

The builds come from windows.php.net: the non-thread-safe x64 builds that FastCGI uses. PHP needs the Microsoft Visual C++ 2015-2022 Redistributable, which the panel installs first if it is missing. The server needs outbound HTTPS to windows.php.net.

Step 1: Open PHP Settings#

Go to Tools & Settings › PHP Settings. The Installed versions table shows each installed version, its folder and how many websites use it.

Step 2: Read the release list#

Under Available from windows.php.net, click Check. The panel reads the current list of PHP branches and builds.

Step 3: Install the branch#

Click Install next to the branch you need, for example a newer 8.x branch for an application that requires it. The installation runs as a task; follow it in the Task Manager. The download is checked against the published checksum before anything is unpacked.

Step 4: Review its php.ini#

Click php.ini next to the new version, check the values your sites rely on (memory_limit, upload_max_filesize, post_max_size, max_execution_time, the extensions you need), and click Save and update websites.

New versions are installed with disable_functions listing the functions that start programs or shells (exec, passthru, shell_exec, system, popen, proc_open and its helpers) plus show_source, dl, pcntl_exec, symlink and link. Uploaded web shells depend on these; ordinary sites do not. Websites cannot change this line. Composer, WP-CLI and Laravel Artisan started from the panel are not affected. Remove a function from the line only if an application you trust really needs it.

Step 5: Offer it to websites#

Make sure Offered to websites is ticked for the new version. Untick it for versions you want to keep installed but no longer offer for new choices.

Step 6: Move a website to the new version#

Open the website and its PHP Settings tool, choose the new PHP version and save. Test the site, then move the next one. To change the default for new subscriptions, set PHP version on the PHP Settings tab of the service plan; empty means the newest installed version.

Updating and removing versions#

When a newer build of an installed branch exists, the table offers Update to followed by the version; this keeps the branch and its php.ini. Remove deletes a version's folder and is unavailable while any website uses it, so move sites off first. The same versions are also listed under Tools & Settings › Server Components, which shows how many websites use each.

Before migrating sites from another server, install the PHP versions they use: the migration checks flag subscriptions whose PHP version is missing, and such sites otherwise run on the nearest installed version.

The server components chapter covers PHP, ASP.NET and the other runtimes.

Frequently asked questions

Can I run several PHP versions on one IIS server?

Yes. StackRegent installs PHP branches side by side, each with its own server-wide php.ini, and every website picks its own version under its PHP Settings tool.

Why does my PHP application say exec is disabled?

New PHP versions are installed with exec, shell_exec, system and similar functions disabled, because uploaded web shells rely on them. If a trusted application needs one, remove it from the disable_functions line in that version's php.ini under Tools & Settings › PHP Settings.

Why is Remove greyed out for a PHP version?

Websites still use that version. Move them to another version in each website's PHP Settings, then remove it.

Was this article helpful?

Something missing? Ask in the community or open a ticket.