Home  >  Article  >  Backend Development  >  Introduction to phpize_PHP Tutorial

Introduction to phpize_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:50:312857browse

phpize is something that belongs to php-devel. It is mainly used to set some settings of php plug-in modules

For example, your php does not support mysql, mbstring, etc.

Example application:
Environment php5.2.6, does not support mysql extension
If the source code package of php is in /usr/local/src/php-5.2.6
The php installation directory is /usr/local/php

# cd /usr/local/src/php-5.2.6
# cd ./ext/mysql
# /usr/local/php/bin/phpize

# ./configure –with-php-config=/usr/local/php/bin/php-config
# make
# make install
At this time you will see that mysql.so is copied to a certain directory, copy mysql.so to the path pointed by your extension_dir, and add extension=mysql.so
in php.ini Restart the web server, take a look at phpinfo, mysql should be supported, done!

Note: Some errors may be prompted when executing /usr/local/php/bin/phpize, such as: Cannot find autoconf, then install the relevant software according to the error prompts. For the RHEL series, use yum -y install Just autoconf
For other errors, please leave a message to me!

So after installing php-devel related packages, phpize will be available (the file is stored in /usr/bin/phpize by default)
The phpize command is used to prepare the compilation environment for PHP plug-in modules. In the following example, the source program of the plug-in module is located in the extname directory:
# cd extname
#phpize
# ./configure (Note 1)
# make
# make install
A successful installation will create extname.so and place it in the PHP plug-in module directory (by default it is stored in /usr/lib/php/modules/).
You need to adjust php.ini and add the extension=extname.so line before you can use this plug-in module.


Excerpted from miyae

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478278.htmlTechArticlephpize is something in php-devel. It mainly sets some settings of php plug-in modules, such as yours PHP does not support mysql, mbstring and other example applications: environment php5.2.6, does not support mysql extension...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn