PHP5 do not recompile, how do I install a self-installed extension, such as a SOAP extension?

Source: Internet
Author: User
Tags soap zts zend

Follow the tutorials below:

Lamp One-click installation package-centos 5/6 automatically compile and install Apache, MySQL, PHP

In the virtual machine's CentOS5.5, the PHP runtime environment was installed with one click, but no SOAP extension was found, and the recent project needed to use WebService.

The above one-button installation (lamp0.4), is actually the source code compiled installation, PHP configuration file path is /etc/php.ini , after installation, the legacy file directory is "/home/jianbao/2/lamp0.4 ", the list of files inside is:

[[email protected] lamp0.4]# ll total 59296-rw-r--r--1 root root 982243 2012-05-23 apr-1.4.6.tar.gz-rw-r--r--1  Root root 774770 2012-05-23 apr-util-1.4.1.tar.gzdrwxrwxr-x 2 jianbao jianbao 4096 2012-05-29 conf-rw-r--r--1 Root root 5616185 2012-05-23 httpd-2.4.2.tar.gz-rwxrwxr-x 1 jianbao jianbao 25116 2012-06-28 lamp.sh-rw-r--r-- 1 root root 4984397 2012-01-21 libiconv-1.14.tar.gz-rw-r--r--1 root root 1335178 2012-03-26 libmcrypt-2.5.8 . tar.gz-rw-r--r--1 root root 471915 2012-03-26 mcrypt-2.6.8.tar.gz-rw-r--r--1 root root 931437 2012-03-2 6 mhash-0.9.9.9.tar.gz-rw-r--r--1 root root 24518874 2012-05-10 mysql-5.5.24.tar.gz-rw-r--r--1 root root 149 13792 2012-05-10 php-5.3.13.tar.gz-rw-r--r--1 root root 5944741 2012-05-10 phpmyadmin-3.5.1-all-languages.tar.gz-r Wxrwxr-x 1 Jianbao Jianbao 1792 2012-05-29 pureftpd.shdrwxr-xr-x 2 root root 4096 06-09 21:36 untar-rwxrwxr-     X 1 Jianbao Jianbao1563 2012-02-14 xcache.sh-rwxrwxr-x 1 jianbao jianbao 2720 2012-06-15 zend.sh 

The PHP version I chose for the above php-5.3.13.tar.gz, now the thing to do is:

1, the "php-5.3.13.tar.gz" source compression package copy of another directory, such as "/HOME/JIANBAO/1", and unzip

2. Switch to the extracted soap source directory:

CD  /home/jianbao/1/php-5.3.13/ext/soap

3. Run the phpize command:

[[email protected] soap]$/usr/local/php/bin/phpizeconfiguring for:php API Version:         20090626Zend Module API no:< C11/>20090626zend Extension Api No:   220090626

At this point, files such as Configure are generated in the current directory.

4. Running Configure command:

[Email protected] soap]$./configure--with-php-config=/usr/local/php/bin/php-config--enable-soapchecking for Egrep ... grep-echecking for a sed, does not truncate output .../bin/sedchecking for cc ...  ccchecking for C compiler default output file name ... a.outchecking whether the C compiler works ... yeschecking whether we Is cross compiling ... nochecking for suffix of executables...checking for suffix of object files ... o.........checking i F Libtool supports shared libraries ... yeschecking whether to build shared libraries ... yeschecking whether to build Stati C Libraries nocreating libtoolappending configuration Tag "CXX" to libtoolconfigure:creating. Config.statusconfig.status:creating config.h

5. Run the make command:

[Email protected] soap]$ make/bin/sh/home/jianbao/1/php-5.3.13/ext/soap/libtool--mode=compile cc  -I.-i/home/ Jianbao/1/php-5.3.13/ext/soap-dphp_atom_inc ...

6. Run the Make install command:

Note that there will be a permissions issue, temporarily switch to the root user.

[[email protected] soap]$ su Password: [[email protected] soap]# make installinstalling shared extensions:     /usr/local/php/ Lib/php/extensions/no-debug-non-zts-20090626/[[email protected] soap]# ll/usr/local/php/lib/php/extensions/ no-debug-non-zts-20090626/Total 832-rwxr-xr-x 1 root root 840501 06-10 01:09 soap.so[[email protected] soap]#

After installation, you will be prompted to save the path to the soap.so file

7. Modify the /etc/php.ini file:

Find extension_dir= "./", which is commented out by default,

Modified to extension_dir= "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/" ,

and add the following configuration after this line:

Extension=soap.so

and then save.

8. Restart Apache:

[[email protected] jianbao]#/etc/init.d/httpd restart stop httpd:                                               [OK] start httpd:                                               [OK]

9. See if the extension is loaded

[Email protected] jianbao]#/usr/local/php/bin/php-m[php Modules] Corectypecurldatedomeregfileinfofilterftpgdhashiconvjsonlibxmlmbstringmcryptmysqlopensslpcrepdopdo_ sqlitepharposixreflectionsessionsimplexmlsoapsplsqlitesqlite3standardtokenizerxmlxmlreaderxmlwriterzipzlib[ Zend Modules]

The soap is already inside, the installation is successful!!!

In the future, the same can be done to install additional extensions.

/usr/local/php/bin/phpize

#安装 The Configure command for the SOAP extension :

./configure--with-php-config=/usr/local/php/bin/php-config--enable-soap

#安装 The Configure command for the socket extension :

./configure--with-php-config=/usr/local/php/bin/php-config--enable-sockets

the pdo_mysql extended Configure command #安装:

./configure--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql=/usr/local/mysql

the mysqli extended Configure command #安装:

./configure--with-php-config=/usr/local/php/bin/php-config-with-mysqli=/usr/local/mysql/bin/mysql_config

#另外, don't forget to add the appropriate extension configuration to php.ini:

Extension=soap.soextension=sockets.soextension=pdo_mysql.soextension=mysqli.so

PHP extensions are simple to enable under Windows Server, Official extension description: http://www.php.net/manual/zh/install.windows.extensions.php

Linux extensions: Http://pecl.php.net/package/PDO_MYSQL (pdo_mysql)

Extended reading:

centos6.x Compile and install lamp (1): Ready to work

centos6.x Compile and install lamp (2): Compile and install Apache2.2.22

centos6.x Compile and install lamp (2): Compile and install Apache2.4.6

centos6.x Compile and install lamp (3): Compile and install MySQL5.5.25

centos6.x Compile and install lamp (4): Compile and install PHP5.2.17

centos6.x Compile and install lamp (4): Compile and install PHP5.3.27

PHP5 do not recompile, how do I install a self-installed extension, such as a soap extension?

Linux, how to install Pdo_mysql extensions to PHP

centos6.x Compile and install memcached PHP client Memcache

PHP5 do not recompile, how do I install a self-installed extension, such as a SOAP extension?

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.