| A little bit of phpize knowledge, both chinese and english. if you need it, take a look. Compiling shared PECL extensions with phpize A little bit of phpize knowledge, both chinese and english. if you need it, take a look. Compiling shared PECL extensions with phpize Sometimes, using the pecl installer is not an option. this cocould be because you're behind a firewall, or it cocould be because the extension you want to install is not available as a PECL compatible package, such as unreleased extensions from SVN. if you need to build such an extension, you can use the lower-level build tools to perform the build manually. The phpize command is used to prepare the build environment for a PHP extension. In the following sample, the sources for an extension are in a directory named extname: $ Cd extname: Enter the extension directory $ phpize in the source code package to run phpize. The path is not necessarily in the current directory. search for phpize to run. A configure file $./configure is generated later. If a database-based extension is generated, you need to add the parameter run: 1, -- with-php-config. 2, "-- with-specific database parameters ". for example, -- with-pgsql and -- with-mysql $ make # make install generate an extname. so extension, put to PHP extensions directory A successful install will have created extname. so and put it into the PHP extensions directory. you'll need to and adjust php. ini and add an extension = extname. so line before you can use the extension. If the system is missing the phpize command, and precompiled packages (like RPM's) are used, be sure to also install the appropriate devel version of the PHP package as they often include the phpize command along with the appropriate header files to build PHP and its extensions. Execute phpize -- help to display additional usage information. The role of phpize can be understood as follows: establish a configure file by detecting the environment (the phpize tool is in the php installation directory, so it is necessary to generate the corresponding configure file based on the php configuration. You must run phpize in a directory. Then phpize will know which Directory your environment is, and the configure file is created under this directory. Summary: I. cd/usr/src/php source package directory/ext/extension directory/ II./usr/local/php5314/bin/phpize III../configure -- with-php-config =/usr/local/php5314/bin/php-config 4. make & make install 5. configure php. ini. If multiple php versions are installed on your server, you need to tell phpize which version of the extension is to be created based on. Use -- with-php-config = to specify the php version you are using. For example: -- with-php-config =/usr/local/php524/bin/php-config about the php-config file: it is generated after php compilation (installed ), A file in the installation directory. Q: phpize is a file in the php installation directory. For example, if I have installed two php5.2 and php5.3, you must use the phpize of the corresponding version to use phpize. what is the role of using -- with-php-config at this time? Where is phpize generally used? After php is compiled, the script file phpize will be generated in the bin directory under the php installation directory. Therefore, you need to go to the installed php installation directory first. |