无法加载动态库

I got this problem while installing Composer into UniserverZ, I run this command

php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php 

and it returns the error

PHP Warning: PHP Startup: Unable to load dynamic library './extensions\php_curl.dll' - Attempt to access invalid address. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './extensions\php_openssl.dll' - Attempt to access invalid address. in Unknown on line 0

Could some one help me. I already try to enable php_curl.dll and php_openssl.dll in php.ini. And also enable load module mod_ssl in httpd.conf . But it still not working and error still the same. I am trying to install Laravel5.

Uniform Server XII / Windows 7 64-bit / php 5.6

In the steps below php should be replaced with your php root directory, which for me was: B:\UniServerZ\core\php56 And ext is the name of your extensions directory, usually just "ext" or "extensions"

This worked for me:

  1. Make sure your php path is in your PATH Environmental Variable:
    • Open Control Panel -> System -> Advances system settings -> Environmental Variables
    • You may have a Path variable in both your User variables and your System variables, check both. If your php directory isn't listed, add it. If more than one php directory is listed, remove the extra ones.
  2. Make sure you have these dll-s present:
    • php\libeay32.dll
    • php\libssh2.dll
    • php\ssleay32.dll
    • php*ext*\php_curl.dll (where ext is your extension directory)
  3. Edit your php.ini file in your php path, i.e. php\php.ini and make sure to have (or uncomment):
    • extension=php*ext*\php_curl.dll (or just extension=php_curl.dll might work)
    • extension=php_openssl.dll
    • I also had, but not sure if it's relevant: curl.cainfo = php\extras\ssl\cacert.pem (your certificate)
    • and: openssl.cafile="B:\UniServerZ\core\php56\extras\ssl\cacert.pem"
  4. I also had to copy ALL FOUR of the above dll-s to my C:\Windows\System32 and my C:\Windows\SysWOW64 directories
  5. And I had to reboot the machine (really, restarting the command prompt was not enough)

Hope this helps!