Archive for the 'WAMP' Category

October 23rd, 2019
3:31 pm
Installing a WAMP server under Windows 7

Posted under WAMP

This was done in order to test demo software targetted for Zen’s cPanel hosting environment.

In particular, I had a need for a simple PHP back end service which would be called from an Angular microapp, to integrate with Yoti’s identity platform.

The basic WAMP server was downloaded and installed from here. This proceeded straightforwardly and allowed a simple php script to be called from a browser.

Next, I needed to enable TLS 1.2 to allow integration with Yoti, as this can only be done via SSL (however a localhost SSL is acceptable).

This blog here had all the basic details and was followed and implemented.

However, when creating the certificate using the above blog you get an error stating there was an error in reading the openssl conf file
This stack overflow post had a fix for the problem. I added a system environment variable per the answers as follows:-

name: OPENSSL_CONF
value: E:\OpenSSL-Win64\bin\openssl.cfg

i.e. pointing to the cfg file under wherever you install (noting that the file type is cfg under windows)
This then works permanently every time you use openssl, and saves having to type the same value as a -config switch every time.
Note that the blog has the Directory value as a direct value, not a tag in angle brackets.
However there is also a <Directory… > tag with sub elements
Further down in the blog is a post with a further example by David Green (who is the blog author) on May 17, 2019 at 3:57 pm
In his example in this post, he has clearly edited the <Directory> tag rather than adding as a separate variable, so I did the same.

 

Following the above my simple php example was able to connect to Yoti and displayed the QR code.
When scanned by the mobile app, it also verified the profile correctly and attempted the redirect back with the one-time token.
However, the Yoti PHP code, when trying to connect to Yoti, threw the following error:-

[23-Oct-2019 12:53:37 UTC] PHP Fatal error: Uncaught exception ‘Yoti\Exception\RequestException’ with message ‘SSL certificate problem: unable to get local issuer certificate’ in E:\wamp64\www\microapps\age-verification-api\vendor\yoti\yoti-php-sdk\src\Yoti\Http\Curl\RequestHandler.php:73

The crux of the issue was that the php curl function, which Yoti was using to contact its web service, was not ssl enabled properly hence the failure.
This blog helped re the issue re adding the required certificate and enabling mod_ssl and php+opensl.

One more hurdle though – there are 2 php.ini files that need editing – one in the version of php I was using (5.6.40 in this case), and another symlink one pointed to from a php.ini symlink under E:\wamp64\bin\apache\apache2.4.39\bin. You can use dir/a to see where such a symlink points – in this case it was another ini file in the relevant php directory – E:/wamp64/bin/php/php5.6.40/phpForApache.ini. This fixed this problem. This post here explains the issue about the double ini files.

This then allowed Yoti to work successfully – its api was able to curl back to the Yoti site via ssl as required, and an age verification was able to successfully return a date of birth.

Comments Off on Installing a WAMP server under Windows 7