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)
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)
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 ~~~
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 ....
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.