Jump to content

Fatal error: Undefined constant 'MCRYPT_DEV_URANDOM'


Recommended Posts

When accepting a domain name order and sending 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 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").

 

[root@www ~]# cd /var/www/vhosts/example.com/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)

Apache module information

Link to comment
Share on other sites

Under utilities->system, look for php info. Find "mcrypt" towards the middle of that page. Is it enabled?

 

Just realized you included a link to phpinfo (nearly invisible links on this forum). Mcrypt is not in there, so it's not enabled on your system. That's the fix.

Link to comment
Share on other sites

Under utilities->system, look for php info. Find "mcrypt" towards the middle of that page. Is it enabled?

 

mcrypt is not listed on the page. :|

 

Just realized you included a link to phpinfo (nearly invisible links on this forum). Mcrypt is not in there, so it's not enabled on your system. That's the fix.

 

I'm completely stumped! 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").

 

[root@www ~]# cd /var/www/vhosts/example.com/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]?

 

Ideas? Suggestions?

Link to comment
Share on other sites

see http://networkedblogs.com/BCFQY for a quick guide

 

Thanks, eilko! That answered the question perfectly!

 

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

 

[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:

 

[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:

 

[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,

Edited by epretorious
Added the changes required to /etc/php.d/mcrypt.ini to force Apache to load /usr/lib64/php/modules/mcrypt.so
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated