Use phpize in linux to dynamically add extensions to PHP. A common problem with using php is: I forgot to add an extension when compiling php. I want to add an extension later. but I didn't want to delete the directory and reinstall it because I installed something like PEAR after installing php, let alone, the common problem with using php is: I forgot to add an extension when compiling php, but later I want to add an extension. However, after installing php, I installed something like PEAR, I don't want to delete the directory and reinstall it. let alone php has such a function.
I did not see it in the manual.
If I want to add bcmath support, this is an extension that supports big integer computing. Windows built-in and built-in. in linux, "this type of function is only available when PHP is compiled and configured -- enable-bcmath" (in the manual quotation marks)
Fortunately, phpize,
The method is to have a php compressed package identical to the existing php. I use php-5.2.6.tar.gz.
Expand and enter the ext/bcmath directory.
Then run/usr/local/php/bin/phpize. this is an executable text file. make sure it is in the system.
Some configure files are added to the current directory,
If no error is reported
Php code
./Configure -- with-php-config =/usr/local/php/bin/php-config
Make sure that/usr/local/php/bin/php-config exists.
If your php installation path is not the default one, change it.
If no error is reported, make, make install again, and then it tells you a directory
Copy the bcmath. so file in this directory to the directory pointed to by extension_dir in your php. ini file,
Modify php. ini and add extension = bcmath. so
Restart apache.
Success ,...