Jump to content

[SOLVED] Can't get script to find openssl


Craig79

Recommended Posts

Hello,

 

I'm running CentOS on a VPS. Openssl is indeed located at /usr/bin/openssl. The problem is that my script keeps saying it can't find it. Here's the script:

 

-------------------------------------------------------------------------

 

//Sample PayPal Button Encryption: Copyright 2006,2007 StellarWebSolutions.com

//Not for resale  - license agreement at

//http://www.stellarwebsolutions.com/en/eula.php

//Updated: 2007 04 04

 

$custom = stripslashes(trim($_POST['custom']));

 

#Set home directory for OpenSSL

//putenv("HOME=~");

putenv("HOME=/home/admin/domains/xxx.com/public_html/temp/");

// xxx is fake!

 

# private key file to use

$MY_KEY_FILE = "/home/admin/my-prvkey.pem";

 

# public certificate file to use

$MY_CERT_FILE = "/home/admin/my-pubcert.pem";

 

# Paypal's public certificate

$PAYPAL_CERT_FILE = "/home/admin/paypal_cert.pem";

 

# path to the openssl binary

$OPENSSL = "/usr/bin/openssl";

 

// stuff here...

 

 

function paypal_encrypt($hash)

{

//Sample PayPal Button Encryption: Copyright 2006,2007 StellarWebSolutions.com

//Not for resale - license agreement at

//http://www.stellarwebsolutions.com/en/eula.php

 

global $MY_KEY_FILE;

global $MY_CERT_FILE;

global $PAYPAL_CERT_FILE;

global $OPENSSL;

 

if (!file_exists($MY_KEY_FILE)) {

echo "ERROR: MY_KEY_FILE $MY_KEY_FILE not found\n";

}

 

if (!file_exists($OPENSSL)) {

echo "ERROR: OPENSSL $OPENSSL not found\n";

}

 

---------------------------------------------------------------------------------

 

...and the last line is where I get the error message echo'd out.

 

I'm using DirectAdmin and my username is 'admin' so my files are located at /home/admin/domains/xxx.com/public_html/ 

 

openssl is definitely there, but PHP can't seem to find it. Could someone please tell me why? Thanks!

 

Link to comment
https://forums.phpfreaks.com/topic/138513-solved-cant-get-script-to-find-openssl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.