-
- [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
Two, phpize1, what is phpizephpize to extend the PHP extension module, through phpize can build PHP plug-in module. When you install PHP, you need to use the 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 need to add some modules, and do not want to recompile PHP, at this time can use Phpize to help plug modules. 2, how to use Phpize? When PHP is compiled, the phpize script file will be available in the bin directory of PHP. Before compiling the extension modules to be added, execute the following phpize.
-
- # If you forget to add some modules at compile time, you can use this method to recompile the additions!
- # First, go to the PHP directory (not compiled) 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
- configuring for:
- php Api version:2004122 5
- Zend Module API no:20060613
- Zend Extension API no:220060519
- # Compiling extension libraries
- /confi Gure–with-php-config=/usr/local/php/bin/php-config
- make
- # made successful execution, the resulting extension library file is in the modules subdirectory of the current directory
- # Edit the php.ini document, locate the Extension_dir directory, copy the compiled extension file to the extension
- vim/usr/local/php/etc/php.ini
- # Line No. 491
- # extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
- CP ftp.so/u sr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
- # in the Add Extension library location in php.ini, set the extension library to be added.
- # Add extension=ftp.so at 612
- # Restart WebService
-
------------------------------------------------------181 of PHP source location in/root/software/php-5.3.6 Try installing a Xenforo forum on the above platform, prompting for the following information at the beginning of the installation: The following errors occurred while verifying that your server can run Xenforo: * The Req uired PHP extension mysqli could not be found. Please ask your the host to install the this extension. * The required PHP extension GD could not be found. Please ask your the host to install the this extension. Since PHP is compiled and installed by source code, the above two extensions are not installed, the following is the process of adding these two extensions for PHP: Install GD extension 1. Download the installation of the GD Library extension required source package (click the source package directly download) 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 1 separately), 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 this configure must take 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, recompile the installation of PHP (that is, after the previous compilation of PHP parameters, plus the above installation parameters) CD php-5.3.4 (into the previous PHP source 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– With-jpeg–with-freetype–enable-sockets
The Green Font section is the parameter that was added when you previously installed PHP:
-
- Make
- Make install
So the GD library extension will be installed, restart Apache, view the PHP information test page can see the GD item; Second, install the mysqli extension here to use the Phpize,phpize command is used to prepare the PHP Extension Library compilation environment, generally after the installation of PHP, will be installed in the bin directory of PHP to find this command. If you do not see a hint like autoconf after you execute the phpize command, install the autoconf again and execute again. The directory path of the following instructions, please users according to the actual situation of their system to make corresponding changes. PHP Source Package folder under the Ext folder is the current version of the available extensions, CD in to see what needs? You should see the Mysqli folder.
-
- Cd/opt/software/php-5.3.4/ext/mysqli
Executing phpize in the current directory
-
- [Root@jbxue mysqli]#/opt/php/bin/phpize
- Configuring for:
- 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 expand the directory path, for example:/opt/php/lib/php/extensions/no-debug-zts-20090626 the required mysqli.so will be located in 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 see the mysqli entry. |