Php assembly gd Library

Source: Internet
Author: User
Tags zts xenforo
Php install gd Library 1, view php information php-v [root @ TJSJHL242-181achievo] # php-vPHP5.3.6 (cli) (built: Aug19201119: 35: 20) Copyright (c) install the gd Library in php
Install the gd Library in php
1. View php information
Php-v

[Root @ TJSJHL242-181 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,
I. What does phpize do?

Phpize is used to expand the php Extension Module. phpize can be used to establish a php plug-in module.



When should we use phpize?

When installing php:

'. /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 root parameters are the modules we need. However, as we need to add some modules and don't want to re-compile php, we can use phpize.



II. 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 you want to add;

------------------------------------
# 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
------------------------------------------------------
The 181 php source code is located in
/Root/software/php-5.3.6

----------------------------------------
In the past two days, I tried to install a Xenforo forum on the above platform. the following message is displayed at the beginning of the 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 the source code package required for the GD Library extension (you can click the source code package to download it 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/

Zlib-1.2.3.tar.gz

2. Compile and install the source code packages respectively.

Install zlib

Tar zxvf zlib-1.2.3.tar.gz
Cd zlib-1.2.3
./Configure
Make
Make install

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

Install freetype

Tar zxvf freetype-2.4.4.tar.gz
Cd freetype-2.4.4
./Configure
Make
Make install

Install Jpeg

Tar zxvf jpegsrc.v8b.tar.gz
Cd jpeg-8b
./Configure-enable-shared
Make
Make test
Make install
Note: configure must include the-enable-shared parameter. Otherwise, the shared library will not be generated.

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, add the above installation parameters after the PHP parameters previously compiled)

Cd php-5.3.4 (go to 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;

II. install MySQLi extension

Phpize is used here. the phpize command is used to prepare the PHP Extension library compiling environment. after you have installed PHP, you will find this command 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. go to the CD and see what you need? You should see the mysqli folder ~~~

Cd/opt/software/php-5.3.4/ext/mysqli

Run phpize in the current directory

[Root @ localhost mysqli] #/opt/php/bin/phpize

Processing ING:

PHP Api Version: 20090626

Zend Modeule Api No: 20090626

Zend Extension Api No: 220090626

[Root @ localhost mysqli] #. /configure-prefix =/opt/mysqli-with-php-config =/opt/php/bin/php-config-with-mysqli =/opt/mysql/bin/mysql_config

[Root @ localhost mysqli] # make

[Root @ localhost mysqli] # make install

After the installation is complete, a message is displayed, indicating the directory path of the extension, such:

/Opt/php/lib/php/extensions/no-debug-zts-20090626

The required mysqli. so will be under this directory, then modify the php. ini file under/opt/php/etc/and add the mysqli extension, that is, add the following line:

Extension =/opt/php/lib/php/extensions/no-debug-zts-20090626/mysqli. so

Then restart the Apache service and open the PHP information page again to view the MySQLi item.

Other extensions of PHP are also similar to those installed ....


Http://www.heiok.com /? P = 517






Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.