Skip to main content

How to fix "PAYMENTECH_HOME must be defined for CGI applications to work" error while using paymentech Orbital Perl SDK?

"PAYMENTECH_HOME must be defined for CGI applications to work" - How to fix this error happened while using Chase paymentech Orbital Perl SDK?

This topic cover the issue of not passing of Environment variables from Apache to CGI scripts

Following error is occuring some times when trying to use PAYMENTECH perl SDK:

Software error:
PAYMENTECH_HOME must be defined for CGI applications to work
BEGIN failed--compilation aborted at /usr/local/share/perl5/Paymentech/ line 47.
Compilation failed in require at line 25.
BEGIN failed--compilation aborted at line 25.

Chase Paymentech offers Payment gateways for processing credit card payments for eCommerce websites. One of their products, Orbital Payment Gateway which uses a Perl SDK which is to installed on the server and a perl script will use this SDK to generate calls to paymentech server to process the payment and return the result of transaction to the user.

Process happens something like this:

Suppose your site is a PHP driven ECommerce website, After the checkout process , website submits payment info along with Credit card information to a Perl script on your server's CGI location. The perl script will be using the SDK which is installed on the server and the script uses the SDK function to process the payment info and return the result of the transaction to the user.

The above mentioned error happened in the "" script and this is the page where the payment info is submitted from the PHP side of the website.

There will be statement like the one given below, which will try to load the SDK module

use Paymentech::CGI;

But on some conditions CGI script may not be able to access the Environment variable PAYMENTECH_HOME which tells the location of SDK. That is sometimes when CGI sciript runs under apache the system doesn't pass the PAYMENTECH_HOME variable to the script.

One reason for this is, when the CGI (common gateway interface) is running in a suEXEC environment, the environment variable may get unaccessible. The suexec module gets readded or uncommented within the apache configuration file so in order to fix this issue, we have to comment out the line and restart apache. Perl Payment scripts required an environment variable, PAYMENTECH_HOME, to be set. As suEXEC scrubs the environment that is passed to the CGI scripts, this variable is not being passed correctly, which was causing perl script failing. to fix this disable suEXEC module completely. This happens when the Plesk or Apache is updated and config file is rewritten.

To disable suEXEC, the following line was commented in /etc/httpd/conf/httpd.conf and Apache was restarted:

#LoadModule suexec_module modules/

Another situation:

If I define it like
export $PAYMENTECH_HOME=/usr/local/paymentech from the shell before I run perl script.cgi everything works fine.But if I run it under apache the system doesn't pass the PAYMENTECH_HOME variable to the script.

- One option is to define the Environment variable in Environment variable file. Find the File so you could put your definition right in somewhere near the top of the file. Ie, add an export MYVAR=value line to envvars (should be located in /etc/apache2) or the script that starts apache (in /etc/init.d), and add your PassEnv MYVAR where it's wanted in your apache configuration.

export PAYMENTECH_HOME=/usr/local/paymentech

- Other option is to use the "PassEnv" and "SetEnv" directives in httpd.conf to tell apache to pass certain environment variables from its own environment to any CGI scripts being run.

Apache Module mod_env has the functions for this. click MOD_ENV to learn more about this Apache module or visit :

Reference links:
  • suEXEC 
  • What Wiki pedia says about SuEXEC :
  • Environment Variables in Apache :
  • Apache Module mod_env :
  • Common gateway interface (CGI) :
  • Start Apache web server :
  • Stop Apache web server :
  • Restart Apache web server :

What is suExec
The suEXEC feature provides Apache users the ability to run CGI and SSI programs under user IDs different from the user ID of the calling web server. Apache suEXEC is a feature of the Apache Web server. It allows users to run CGI and SSI applications as a different user - normally, all web server processes run as the default web server user (often wwwrun, Apache or nobody). The suEXEC feature consists of a module for the web server and a binary executable which acts as a wrapper. suEXEC was introduced in Apache 1.2 and is often included in the default Apache package provided by most Linux distributions.

Popular posts from this blog

Payback Points - How to redeem - How to merge multiple payback accounts - Block Payback card - Payback customer care

Your SBI Debit card ending with XX0000 is deactivated only for Internet txn.

SBI account holders may have received an SMS with following message, supposed to be from State Bank of India (SBI).

Your SBI Debit card ending with XX0000  is deactivated only for Internet txn. To activate send SMS "SWON ECOM 0000" to 09223966666. No change for ATM/POS usage
** Replace the four Zeros with last 4 digits of your debit card number

Recently many of the SBI account holder has losed their money due to a hi-tech ATM robbery which happened in Thiruvananthapuram, capital city of Kerala.

Joomla and Forum Integration - Integrating Forums to Joomla

Joomla is one of the most popular CMS opensource packages. It is very easier to develop website's using Joomla. You just need to download Joomla package from Joomla's Official website  and install it on your domain and later adding customizations to templates and feature and Your website is ready :). Now a days most websites provides a forum section for it users for discussing various article topics, gathering opinions etc.

Following are some best know forum opensource packages which can be integrated with Joomla and create a new forum experience for users

Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to   Read more »
Search This Blog