- [Root @ jbxue achievo] # php-v
- PHP 5.3.6 (cli) (built: Aug 19 2011 19:35:20)
- Copyright (c) 1997-2011 The PHP Group
- Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
2. phpize1, what is phpizephpize, which is used to expand the php Extension Module. phpize can be used to establish a php plug-in module. When installing php, you need to use phpize:
- '. /Configure ''-- prefix =/usr/local/php'' -- with-mysql =/usr/local/mysql'' -- with-zlib-dir'' -- with-freetype -dir =/usr'' -- with-jpeg-dir =/usr'' -- with-png-dir =/usr'' -- enable-gd-native-ttf ''-- with-gd ''-- enable-ftp'' -- with-iconv ''-- with-gettext'' -- with-curl ''-- enable-fastcgi'' -- with-openssl'
The following parameters are required modules. sometimes you need to add some modules and do not want to re-compile php. in this case, you can use phpize to help the plug-in module. 2. how to use phpize? After php compilation is complete, the php bin directory contains the phpize script file. Run the following phpize command before compiling the extension module to be added;
- # If you forget to add some modules during compilation, you can use this method to re-compile and add them!
- # First, go to the PHP Directory (uncompiled) extension directory
- Cd/home/soft/php-5.2.14/ext/ftp/
- # Call the phpize program to generate the compilation configuration file
- # Find/-name phpize
- /Usr/local/php/bin/phpize
- Processing ING:
- PHP Api Version: 20041225
- Zend Module Api No: 20060613
- Zend Extension Api No: 220060519
- # Compile the extension Library
- /Configure-with-php-config =/usr/local/php/bin/php-config
- Make
- # After make is successfully executed, the generated extension library file is in the modules subdirectory of the current directory.
- # Edit the php. ini file, locate the extension_dir directory, and copy the compiled extension file to the extension directory.
- Vim/usr/local/php/etc/php. ini
- # 491st rows
- # Extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613 /"
- Cp ftp. so/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
- # Add The Extension Library location in php. ini and set the extension library to be added.
- # Add extension = ftp. so in section 612
- # Restart webservice
-
------------------------------------------------------ 181 php source code location in/root/software/php-5.3.6 Try to install a Xenforo forum on The above platform. The following message is displayed at The beginning of installation: The following errors occurred while verifying that your server can run XenForo: * The required PHP extension MySQLi cocould not be found. please ask your host to install this extension. * The required PHP extension GD cocould not be found. please ask your host to install this extension. Since PHP is compiled and installed by source code, the above two extensions are not installed. the process of adding these two extensions for PHP is as follows: 1. install GD extension 1. download and install GD Library extension source package (can click the source package to download directly) gd-2.0.35.tar.gz http://www.libgd.org/releases/ src.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/ 2. Compile and install the source code packages respectively. 1) install zlib
- Tar zxvf zlib-1.2.3.tar.gz
- Cd zlib-1.2.3
- ./Configure
- Make
- Make install
2) install libpng
- Tar zxvf libpng-1.5.0.tar.tar
- Cd libpng-1.5.0
- Cd scripts
- Mv makefile. linux ../makefile
- Cd ..
- Make
- Make install
3) install freetype
- Tar zxvf freetype-2.4.4.tar.gz
- Cd freetype-2.4.4
- ./Configure
- Make
- Make install
4) install Jpeg
- Tar zxvf jpegsrc.v8b.tar.gz
- Cd jpeg-8b
- ./Configure-enable-shared
- Make
- Make test
- Make install
-
Note that configure must include the-enable-shared parameter. Otherwise, the shared library will not be generated. 5) install the GD Library
- Tar zxvf gd-2.0.33.tar.gz
- Cd gd-2.0.33
- ./Configure-with-png-with-freetype-with-jpeg
- Make install
3, re-compile and install PHP (that is, in the previous PHP compilation parameters followed by the above installation parameters) cd php-5.3.4 (into the previous PHP source code directory)
- . /Configure-prefix =/opt/php-with-mysql =/opt/mysql-with-apxs2 =/opt/apache/bin/apxs-enable-track-vars-enable-force- cgi-redirect-with-config-file-path =/opt/php/etc-with-gd-enable-gd-native-ttf-with-zlib-with-png- -jpeg-with-freetype-enable-sockets
The green font part is the parameter previously added when installing PHP:
- Make
- Make install
In this way, the GD Library extension is installed. restart Apache and check the PHP information test page to view the gd items; 2. install the MySQLi extension. here you need to use phpize. the phpize command is used to prepare the PHP Extension library compiling environment. generally, after installing PHP, the command is found in the bin directory where PHP is installed. If a prompt such as autoconf cannot be found after the phpize command is executed, install autoconf and execute it again. The directory path of the following command, please make changes according to the actual situation of your system. The EXT folder in the PHP source package folder contains the available extensions of the current version. What are the requirements of CD? The mysqli folder is displayed.
- Cd/opt/software/php-5.3.4/ext/mysqli
Run phpize in the current directory
- [Root @ jbxue mysqli] #/opt/php/bin/phpize
- Processing ING:
- PHP Api Version: 20090626
- Zend Modeule Api No: 20090626
- Zend Extension Api No: 220090626
- [Root @ jbxue mysqli] #. /configure-prefix =/opt/mysqli-with-php-config =/opt/php/bin/php-config-with-mysqli =/opt/mysql/bin/mysql_config
- [Root @ jbxue mysqli] # make
- [Root @ jbxue mysqli] # make install
After the installation is complete, you will be prompted to extend the directory path, for example:/opt/php/lib/php/extensions/mysqli. so required by the no-debug-zts-20090626 will be under this directory. Next, modify the php. ini file under/opt/php/etc/and add the mysqli extension:
- Extension =/opt/php/lib/php/extensions/no-debug-zts-20090626/mysqli. so
Restart the Apache service and open the PHP information page again to view the MySQLi item. |