4

I am a newbie to php, and during an installation of a server I have to add the extension extension=mcrypt.so in php.ini file where I stuck with the following issues 1) I donno where exactly the above mentioned line should be added in the php.ini file.

Brieuc
  • 3,994
  • 9
  • 37
  • 70
Shekhar Reddy
  • 153
  • 1
  • 3
  • 12
  • 1
    Possible duplicate of [Unable to find the "extensions" portion of my php.ini file, in apache 2.0, where is it?](http://stackoverflow.com/questions/5939149/unable-to-find-the-extensions-portion-of-my-php-ini-file-in-apache-2-0-where) – CherryDT May 12 '16 at 11:43
  • Ubuntu 14.04: `sudo gedit /etc/php5/apache2/php.ini` – Muhammad Shahzad May 12 '16 at 11:58
  • It is best not to use mcrypt, it is abandonware, has not been updated in years and does not support standard PKCS#7 (née PKCS#5) padding, only non-standard null padding that can't even be used with binary data. Instead consider using [defuse](https://github.com/defuse/php-encryption), it is being maintained and is correct. – zaph May 12 '16 at 13:10

2 Answers2

4

You will see a group of Dynamic Extensions. like this:

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;extension=modulename.extension

add your extension below this without ;

Meathanjay
  • 2,023
  • 1
  • 18
  • 24
1

Add this line to all other extensions:

;extension=some.so
extension=thing.so
extension=mcrypt.so

Also, don't forget to reboot web server after that to make it work.

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279