2

i m trying to use mcrypt_decrypt from commond line but i m getting the folllowing error:-

  Call to undefined function mcrypt_decrypt() in Command line code on line 1

Any idea ? and any other alternative solution because i m using os:cmd() from erlang to achive this.since erlang do have function to achieve this but i m unable to figure out whats worng in that.so thought of doing like this so that i verify the things.

thanx in advanced

1
  • Posting the script and the shell command used to execute might help get better answers :) Commented Jun 4, 2009 at 13:25

4 Answers 4

3

It means that the mcrypt extension isn't being loaded - make sure you're loading the right php.ini from the command line.

Sign up to request clarification or add additional context in comments.

1 Comment

ubuntu separates php modules into binary packages and each package configuration file is in isolated .ini file so just by added suitable loader to php.ini wont help, he's obviously missing the whole module =)
2

And going still abit further, it might be that its not even compiled so enabling it from php.ini doesnt help at all. And how to determinate that depends on the os where you run php-cli.

Addition:

Original poster indicated that he's running on ubuntu. So, how to make it work:

sudo apt-get install php5-mcrypt

And note, there are on ".dll" files in linux, dll refers to "dynamicaly loaded library" its used in windows, linux equivalent is ".so" and im pretty sure that you havent just installed the mcrypt packages.

2 Comments

I'm assuming he's windows. Most (afaik) windows installations load the common extensions - including mcrypt. They just aren't all enabled in the php.ini
thanx rasjani ,the problem that i hadn't install php5-mcrypt but after installing it, its woking fine.
0

Going further on what Greg said, uncomment the correct line by removing the ";" in front of mcrypt.dll

(I think it's mcrypt.dll)

Comments

0

Try specifying the complete path of php binary in command line. For instance:

/Applications/XAMPP/xamppfiles/bin/php someprogram.php

It's works for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.