tags:

views:

185

answers:

4
+1  Q: 

php command line

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

+2  A: 

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

Greg
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 =)
rasjani
A: 

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

(I think it's mcrypt.dll)

JasonV
+1  A: 

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.

rasjani
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
JasonV
thanx rasjani ,the problem that i hadn't install php5-mcrypt but after installing it, its woking fine.
Abhimanyu
A: 

hi all, thanx for you response where i can locate mcrypt.dll since i m working on ubuntu os...

Abhimanyu