With the continuous growth of web applications, PHP, as a mainstream server-side scripting language, is widely used in website and application development. Many developers and system administrators may encounter configuration challenges when setting up a PHP environment on Alibaba Cloud Windows servers. This article will guide you step-by-step on installing and configuring PHP on Alibaba Cloud Windows server to ensure PHP runs smoothly.
First, log in to the Alibaba Cloud Windows server via Remote Desktop, open a browser and visit the official PHP download page to select and download the Windows-compatible PHP version. During installation, you can choose the default path or customize the installation directory as needed.
Next, you need to install and configure IIS (Internet Information Services) on the Windows server:
Make sure the FastCGI module is enabled. If not installed, you can enable the "CGI" feature in the server roles and features.
Open the php.ini file in the PHP installation directory and make the following adjustments:
Also, ensure to enable commonly used PHP extensions:
extension=php_mbstring.dll extension=php_exif.dll extension=php_mysqli.dll extension=php_openssl.dll
After finishing the configuration above, go back to IIS Manager, right-click the server name, select "Manage" then "Restart" to apply the changes.
To verify PHP is working, create a test.php file with the following content:
<?php phpinfo(); ?>
Place this file in the web root directory, then visit http://your-server-ip/test.php in a browser. If the PHP info page displays, your PHP environment is properly set up and running.
Following these steps, you can successfully install and configure PHP on an Alibaba Cloud Windows server to support web application development and deployment. Proper configuration enhances performance and provides a reliable foundation for future development.