Installing the SSH2 extension on a Windows machine with Apache requires the OpenSSL and libssh2 libraries. Here's a step-by-step guide:
1. Obtain the PHP SSH2 PECL Extension:
Download the Win32 SSH2 PECL extension from here, ensuring to select the version compatible with your PHP installation.
2. Extract and Copy Files:
Extract the contents of the downloaded archive. Copy the following files to the appropriate locations:
3. Register the DLL:
Open a command prompt as an administrator and run the following command:
C:\> regsvr32 libssh2.dll
4. Update php.ini:
Edit your php.ini file and add the following lines to enable the SSH2 extension:
extension=php_openssl.dll extension=php_ssh2.dll
5. Restart Apache:
Restart the Apache service to load the extension.
6. Considerations for 64-bit PHP:
If you're using 64-bit PHP, you'll need to obtain the 64-bit versions of the SSH2 libraries and DLLs. Resources such as the one linked in the answer can provide these.
Additional Notes:
The above is the detailed content of How do I install the SSH2 extension on a Windows machine with PHP?. For more information, please follow other related articles on the PHP Chinese website!