osx - How to install mcrypt on OS X's natively installed PHP? -


i trying install mcrypt php extension on os x mountain lion 10.8 operating system. os comes shipped apache , php installed. mcrypt extension not come shipped php. want install mcrypt version of php came shipped machine.

i not want use homebrew, macports, or similar package manager, , not want install version of php in addition 1 have. want plug mcrypt php came bunded os. feel makes sense, instead of having multiple versions of same program installed, yet every tutorial come across seems use homebrew/macports, , few don't teach how install new php instead of using 1 have.

i started following directions laid out on page: http://www.coolestguyplanettech.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/.

  1. i downloaded libmcrypt-2.5.8.tar.gz sourceforge.
  2. i extracted contents following command: tar -zxvf libmcrypt-2.5.8.tar.gz.
  3. i entered libmcrypt-2.5.8 directory created , issued following commands: ./configure, make, , sudo make install.

now tutorial says go directory created new, non-native version of php tutorial tells install, not native version came shipped os x. tutorial says go following directory: cd ../php-5.3.13/ext/mcrypt/ (which directory don't have), , run phpize command. can't go directory because i'm using native php came os x, instead go libmcrypt-2.5.8 directory, when try run phpize command error says: cannot find config.m4. make sure run '/usr/bin/phpize' in top level source directory of module. have files acinclude.m4 , aclocal.m4 in directory. not sure if related config.m4 phpize looking for.

i not sure how proceed. maybe should cut losses , install php using macports or homebrew, i'd prefer use native php came bundled os x. can me figure out how this? me lot, , me understand better how php , extensions work. thank you!

"i'd prefer use native php came bundled os x. can me figure out how this? me lot, , me understand better how php , extensions work."

the php came bundled osx isn't more "native" other version install.

you don't have directory because, iirc, osx doesn't ship php source, compiled binary , apache module.

you can run phpize on php extension, can in php source download (including mcrypt extension). downloaded c library (which may need install) php extension reference (you don't need worry how happens).

if want install extension:

  1. download it

  2. extract , cd into

  3. sudo phpize

  4. sudo ./configure && sudo make && sudo make install

  5. add extension=mcrypt.so (or whatever generated) php config / php.ini , restart apache

this sounds me opportunity learn more how computer works. documentation wrote myself few years ago on how this:

http://www.calvinfroedge.com/common-php-compile-configuration-options/ (note formatting in blog might not work if paste terminal, example –with-mysql should --with-mysql)

besides, don't need rid of php installation came osx. can download php source brand new directory, compile it, backup old binary, , either symlink result of 'which php' new installation or add binaries generated after compile source.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -