This worked for me and found it hidden in the PHP manual. Make sure you put the location of libeay32.dll and ssleay32.dll in your windows path.
This is assuming your running on a windows machine: You can set your path using command line. Type "Path" and press enter to see current path then Set Path=xxxxxxxxxxx Copying exacly as show then at end adding the path to the files above.
This needs to be done on the server running your PHP.
Here is the easier way: Click start then Run or windows button + R to open a Run window. Type "systempropertiesadvanced" (don't type the quotes)
Now click on "Environment Variables"
In the bottom half under "System Variables" find the path entry.
Edit this line by adding a semi-colon to the end of the line then the path to the files.
Click Ok, Ok, Ok. Now try it again and it should work.
The location of these files for me was d:\xampp\php and remember the semi-colon to separate your entries.