-1

Ok so i am geting this error

Fatal error: Call to undefined function mcrypt_create_iv() in ..... on line 8

Now ive done some reading and found out that i need to install or update my php, problem is im not using my university server and cant update it, well at least i don't think i can.

Is there a simple way around this.

Hash.php

    <?php
class Hash {
    public static function make($string, $salt = '') {
        return hash('sha256', $string . $salt);
    }

    public static function salt($length) {
        return mcrypt_create_iv($length);
    }

    public static function unique() {
        return self::make(uniqid());
    }
}
Beep
  • 2,737
  • 7
  • 36
  • 85
  • This requires the `mcrypt` extension. If you can't install that, then you can't use `mcrypt_create_iv`. http://www.php.net/manual/en/mcrypt.setup.php – gen_Eric Jan 09 '14 at 21:10
  • Ok, hmm il try work around this. thank you for the infomation – Beep Jan 09 '14 at 22:12

1 Answers1

0

You need to install mcrypt. If using a Debian-based Linux system, you can run the following commands:

sudo apt-get install php5-mcrypt
sudo /etc/init.d/apache2 restart
knutz
  • 1