how to enable process control extension (PCNTL) in PHP MAMP? -



have mamp , need enable -pcntl on current mamp installation. how can so?

thanks help.

there way of compiling pcntl extension , linking in existing php build, it's bit in-depth.

i'm doing following on mac osx snow leopard (64bit), mamp , php version 5.3.6. remember change php version numbers in following lines if yours different!

please note make required, isn't installed default on mac osx. need install via mac developer tools, http://developer.apple.com/unix/

first, download tar of php source code matches version using in mamp (e.g. mine 5.3.6), can @ http://www.php.net/releases/. untar , cd php-[version]/ext/pcntl, e.g.:

$ wget http://museum.php.net/php5/php-5.3.6.tar.gz $ tar xvf php-5.3.6.tar.gz $ cd php-5.3.6/ext/pcntl 

you need run phpize in pcntl directory, binary file comes mamp:

pcntl$ /applications/mamp/bin/php/php5.3.6/bin/phpize 

this creates bunch of files needed preparing extension compiling.

we need add flags tell compile library dual 32bit , 64bit architecture, mamp php has been built way. if don't this, compiled shared objects won't work.

pcntl$ macosx_deployment_target=10.6 pcntl$ cflags="-arch i386 -arch x86_64 -g -os -pipe -no-cpp-precomp" pcntl$ ccflags="-arch i386 -arch x86_64 -g -os -pipe" pcntl$ cxxflags="-arch i386 -arch x86_64 -g -os -pipe" pcntl$ ldflags="-arch i386 -arch x86_64 -bind_at_load" pcntl$ export cflags cxxflags ldflags ccflags macosx_deployment_target 

we can run ./configure , make build our shared object:

pcntl$ ./configure pcntl$ make 

this puts file called pcntl.so in modules directory. copy file mamp's php extensions directory:

pcntl$ cp modules/pcntl.so /applications/mamp/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/ 

finally, edit php ini file include extension:

$ echo "extension=pcntl.so" >> /applications/mamp/bin/php/php5.3.6/conf/php.ini 

pcntl should enabled. check see whether has been added, run:

$ /applications/mamp/bin/php/php5.3.6/bin/php --ri pcntl  pcntl  pcntl support => enabled 

if see that, it's worked! if has gone wrong can remove pcntl.so file mamp php extensions directory , remove ini setting, , try again.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -