Home >Backend Development >PHP Tutorial >How to install gd library and phpize in php
二,phpize 1. What is phpize phpize is used to extend php extension modules, and php plug-in modules can be created through phpize. When installing php, you need to use phpize:
The following parameters are the required modules. Sometimes you need to add some modules without recompiling PHP. In this case, you can use phpize to help plug-in modules. 2. How to use phpize? When php is compiled, there will be a phpize script file in the bin directory of php. Before compiling the extension module to be added, just execute the following phpize;
-------------------------- ---------------------------- The php source code location of 181 is at /root/software/php-5.3.6 Try to install a Xenforo forum on the above platform. When the installation starts, the following message is prompted: The following errors occurred while verifying that your server can run XenForo: * The required PHP extension MySQLi could not be found. Please ask your host to install this extension. * The required PHP extension GD could not be found. Please ask your host to install this extension. Since PHP is compiled and installed from source code, the above two extensions are not installed. The following is the process of adding these two extensions to PHP: 1. Install GD extension 1. Download and install the source code package required for the GD library extension (you can click the source code package to download directly) gd-2.0.35.tar.gz http://www.libgd.org/releases/ jpegsrc.v8b.tar.gz http://www.ijg.org/ libpng-1.5.0.tar.gz http://sourceforge.net/projects/libpng/ freetype-2.4.4.tar.gz http://sourceforge.net/projects/freetype/ zlib-1.2.3.tar.gz 2. Compile and install each source code package separately 1), install zlib
2), install libpng
3), install freetype
4), install Jpeg
5), install GD library
3. Recompile and install PHP (that is, add the parameters related to the above installation after the parameters of the previous compilation of PHP) cd php-5.3.4 (enter the previous PHP source code directory)
The green font part is the parameters added when installing PHP before:
In this way, the GD library extension is installed. Restart Apache and check the PHP information test page to see the gd item; 2. Install MySQLi extension phpize is used here. The phpize command is used to prepare the PHP extension library compilation environment. Generally, after installing PHP, you will find this command in the bin directory where PHP is installed. If a prompt such as autoconf cannot be found appears after executing the phpize command, please install autoconf and execute it again. Netizens are asked to modify the directory path of the following instructions according to the actual situation of their own system. The EXT folder under the PHP source code package folder contains the available extensions of the current version. CD into it to see what you need? You should see the mysqli folder.
Execute phpize in the current directory
After the installation is complete, you will be prompted for the directory path where the extension is located, for example: /opt/php/lib/php/extensions/no-debug-zts-20090626 The required mysqli.so will be in this directory. Next, modify the php.ini file under /opt/php/etc/ and add the mysqli extension:
Restart the Apache service and open the PHP information page again. See the MySQLi entry. |