• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

WHMCS built-in module OpenSRS: Fatal error: Undefined constant 'MCRYPT_DEV_URANDOM'

Eric Pretorious

Regular Pleskian
When accepting a domain name order in WHMCS and send the domain name to the registrar (using the WHMCS built-in OpenSRS module) WHMCS complains:

Fatal error: Undefined constant 'MCRYPT_DEV_URANDOM' in /var/www/vhosts/.../httpdocs/whmcs/modules/registrars/opensrs/opensrs.php on line 0

I've checked WHMCS Utilities -> System -> PHP Info and mcrypt is not being loaded even though I've downloaded+installed the third party classes to the /modules/registrars/opensrs/ directory (as detailed in the section "Additional Registrar Module Files Requirement" of the WHMCS doc "OpenSRS").

Code:
[root@www ~]# cd /var/www/vhosts/.../httpdocs/whmcs/modules/registrars/opensrs/
[root@www opensrs]# ll
total 156
-rwxr-xr-x 1 gorocketpowered psacln 10001 Mar 18 04:23 country_codes.php
drwxr-xr-x 2 root            root    4096 Apr  3 02:35 Crypt
-rwxr-xr-x 1 gorocketpowered psacln  3704 Mar 18 04:23 logo.gif
-rwxr-xr-x 1 gorocketpowered psacln 38868 Mar 18 04:23 openSRS_base.php
-rwxr-xr-x 1 gorocketpowered psacln 65279 Mar 18 04:23 opensrs.php
-rwxr-xr-x 1 gorocketpowered psacln 21539 Mar 18 04:23 OPS.php
drwxr-xr-x 5 root            root    4096 Apr  3 02:35 PEAR
Have I overlooked a setting somewhere [in Plesk or in WHMCS]?

WHMCS ver 5.2.2
Plesk ver 11.0.9 (Linux)
 
FTR: The php-mcrypt package is available (for Centos, Scientific Linux, and Oracle Linux administrators) from the RPMforge repository (a.k.a. Dag's repository) and from the EPEL repository. To add the RPMforge repo to your Centos, Scientific Linux, or Oracle Linux system...

Code:
[root@www ~]# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

[root@www ~]# rpm -Uvh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Preparing...                ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]

[root@www ~]# yum repolist
Loaded plugins: downloadonly, fastestmirror, priorities, security
Determining fastest mirrors
 * base: centos.mirror.netriplex.com
 * extras: mirror.nexcess.net
 * rpmforge: mirror.teklinks.com
 * updates: ftp.linux.ncsu.edu
repo id                                                                     repo name                                                                                      status
base                                                                        CentOS-6 - Base                                                                                6,381
extras                                                                      CentOS-6 - Extras                                                                                 12
rpmforge                                                                    RHEL 6 - RPMforge.net - dag                                                                    4,594
updates                                                                     CentOS-6 - Updates                                                                               458
repolist: 11,445

[root@www ~]# yum search php-mcrypt
Loaded plugins: downloadonly, fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
 * base: centos.mirror.netriplex.com
 * extras: mirror.nexcess.net
 * rpmforge: mirror.teklinks.com
 * updates: ftp.linux.ncsu.edu
======================= N/S Matched: php-mcrypt =======================
php-mcrypt.x86_64 : Standard PHP module provides mcrypt library support

Installing the php-mcrypt package does not quite fix the problem, however, because even though the package contains the module Apache does not load the module:

Code:
[root@www ~]# rpm -ql php-mcrypt
[COLOR="#00FF00"]/etc/php.d/mcrypt.ini
/usr/lib64/php/modules/mcrypt.so[/COLOR]

[root@www ~]# cat /etc/php.d/mcrypt.ini 
; Enable mcrypt extension module
[COLOR="#FF0000"]extension=module.so[/COLOR]

[root@www ~]# ls -1 --classify /usr/lib64/php/modules/
curl.so*
dom.so*
fileinfo.so*
gd.so*
imap.so*
ioncube_loader_lin_5.1.so
ioncube_loader_lin_5.2.so
ioncube_loader_lin_5.3.so
json.so*
mbstring.so*
[COLOR="#00FF00"]mcrypt.so*[/COLOR]
mysqli.so*
mysql.so*
pdo_mysql.so*
pdo.so*
pdo_sqlite.so*
phar.so*
sqlite3.so*
sw-engine/
wddx.so*
xmlreader.so*
xmlwriter.so*
xsl.so*
zip.so*

[root@www ~]# apachectl -t -D DUMP_MODULES | grep php
 php5_module (shared)
Syntax OK

[root@www ~]# apachectl -t -D DUMP_MODULES | grep crypt
Syntax OK

In order to force Apache to load the mcrypt.so module, I had to modify the mcrypt.ini file, restart Apache, and check the output of the phpinfo() subroutine:

Code:
[root@www ~]# cat /etc/php.d/mcrypt.ini 
; Enable mcrypt extension module
[COLOR="#FF0000"]extension=module.so[/COLOR]

[root@www ~]# wget -qO- http://rocket-powered.com/info.php | grep -i mcrypt
/etc/php.d/mcrypt.ini,

[root@www ~]# vi /etc/php.d/mcrypt.ini

[root@www ~]# /etc/init.d/httpd restart
Stopping httpd:                                            [  [COLOR="#00FF00"]OK[/COLOR]  ]
Starting httpd:                                            [  [COLOR="#00FF00"]OK[/COLOR]  ]

[root@www ~]# cat /etc/php.d/mcrypt.ini 
; Enable mcrypt extension module
[COLOR="#00FF00"]extension=mcrypt.so[/COLOR]

[root@www ~]# apachectl -t -D DUMP_MODULES | grep crypt
Syntax OK

[root@www ~]# wget -qO- http://rocket-powered.com/info.php | grep -i mcrypt | html2text 
/etc/php.d/mcrypt.ini,
Registered Stream Filters
zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower,
string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*
***** mcrypt *****
mcrypt support
enabled
mcrypt_filter support
enabled
mcrypt.algorithms_dir
no value
no value
mcrypt.modes_dir
no value
no value

For more information about additional CentOS repositories and YUM:


HTH,
 
Back
Top