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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.