How can environment variables be properly set for OpenSSL on Windows XP for certificate generation?

To properly set environment variables for OpenSSL on Windows XP for certificate generation, you can use the `set` command in the command prompt to set the `OPENSSL_CONF` variable to point to the location of your OpenSSL configuration file. This will ensure that OpenSSL uses the correct configuration settings when generating certificates.

<?php
// Set the OPENSSL_CONF environment variable to point to the OpenSSL configuration file
exec('set OPENSSL_CONF=C:\path\to\openssl.cnf');

// Now you can use OpenSSL commands to generate certificates
exec('openssl req -new -newkey rsa:2048 -nodes -keyout key.pem -out cert.csr');
exec('openssl x509 -req -days 365 -in cert.csr -signkey key.pem -out cert.pem');
?>