Step‑by‑Step Guide to Installing and Configuring PHP 8 in phpstudy on Windows
This tutorial explains how to download PHP 8, integrate it into the phpstudy environment on Windows, resolve common runtime errors, enable required extensions, and verify the setup with sample code, providing a complete workflow for developers needing a ready‑to‑use PHP 8 development stack.
Introduction
The article shows how to install PHP 8 for use with phpstudy, a Windows‑based development environment, and explains why the extensions need to be enabled for full functionality.
1. Install PHP 8
Download the Windows binaries from https://windows.php.net/download#php-8.0 and extract them to a folder named php8 inside the phpstudy installation directory (usually D:\phpstudy_pro\Extensions\php\php8.0.2nts).
After extraction, place the PHP 8 folder under the main PHP directory of phpstudy and switch the PHP version in the phpstudy panel.
2. Run PHP 8 Error Handling
If PHP fails to start (e.g., error 502) or shows the warning
PHP Warning: 'C:\Windows\SYSTEM32\VCRUNTIME140.dll' 14.0 is not compatible with this PHP build linked with 14.28, open a command prompt, navigate to the PHP 8 folder and run php -v to reproduce the error.
Download the compatible runtime from https://www.yuque.com/u30882/rx39g7/kns2a2, install it, restart the computer, and the warning should disappear.
3. Perfectly Combine phpstudy and PHP 8
After the PHP 8 binaries are in place, the default extensions are disabled. Open phpstudy’s extension manager or edit the php.ini file to uncomment the required extension lines (e.g., extension=curl).
Also adjust the extension_dir directive in php.ini to point to the correct extensions folder, then restart the phpstudy environment.
Test the configuration with a simple script (e.g., a ThinkPHP 6 database query) to ensure PHP 8 can connect to MySQL and execute code correctly.
4. Summary
The phpstudy‑PHP 8 integration is now complete; remember to restart after any configuration change, follow the original phpstudy extension settings, update extension_dir, and verify with php -v if errors persist.
Restart the environment after editing configuration files.
Reference the original phpstudy extension list when enabling extensions.
Update extension_dir to the correct path.
If php -v still reports errors, repeat the runtime fix.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
php Courses
php中文网's platform for the latest courses and technical articles, helping PHP learners advance quickly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
