Add extension libraries for PHP and extension libraries for linuxphp in Linux

Source: Internet
Author: User

Add extension libraries for PHP and extension libraries for linuxphp in Linux

Example: add an mbstring extension Library

1. Go to the PHP source code directory (if there is no source code, run the command: # php-v to view the version number, and then download the source code from the PHP official website)

2. Go to the FTP extension library directory under PHPi source code:

# Cd [Your PHP Source Folder]/ext/mbstring

3. Use the phpize command to generate the configuration file:

# Phpize

4. Execute configure:

#./Configure -- with-php-config =/usr/local/php/bin/php-config (the following path corresponds to the php-config directory on the local machine)

5. If no error is reported, run make:

# Make

6. After make is successful, the generated extension library file is in the modules subdirectory of the current directory. In this exampleMbstring. so, Copy this file to "/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/" (corresponding to the PHP Directory of the local machine)

7. Modify/etc/php. ini, add a line under [mbstring]: extension = mbstring. so, and save

8. Restart the apache or nginx server (if it is useful to the amh panel, you need to use the command to make it take effect: # amh php stop [Your Host] And # amh php start [Your Host])


In linux, add mbstring extension for php to help

1. confirm that the php. ini You modified is the current configuration. You can use the phpinfo () function to find out.
2. Go to the directory indicated by extension_dir to see if there is any mbstring. so file.
3. restart the server (/etc/init. d/httpd restart can be used for apache ).

In linux, how does one install the php extension of oci8?

Install the PHP Oracle client extension (OCI8) in Linux
Because the recent project needs to access the oracle database using php, You have to install the oci8 extension for php in linux. Php can also use pdo to access the oracle database, but you still need to install the client. I have encountered many problems by referring to this article of Dr. Zhang's blog. I tried it multiple times and it was enough to install it successfully. First, go to the oracle official website to download the relevant files. Be sure to connect to the database server version. Otherwise, the installation will fail, at the same time, we need to distinguish between 32-bit and 64-bit servers. For example, if the database server I want to connect to is oracle10.2.0.4 and 64-bit, I want to download the following three files: oracle-instantclient-basic-10.2.0.4-1.x86_64.rpmoracle-instantclient-devel-10.2.0.4-1.x86_64.rpmoracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm install rpm-ivh oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm with the following command re-install OCI8 PHP extension yum install libaio
Wget pecl.php.net/get/oci8-1.3.5.tgz
Tar zxvf oci8-1.3.5.tgz
Cd oci8-1.3.5/
/Home/renjun/php/bin/phpize CFLAGS = "-I/usr/include/oracle/10.2.0.4/client64/" CXXFLAGS = "-I/usr/include/oracle/10.2.0.4 /client64 /"
. /Configure -- with-php-config =/home/renjun/php/bin/php-config -- with-oci8 =/usr/lib/oracle/10.2.0.4/client64/the orange representation above php installation path, red indicates the oracle path. The oracle path varies with the folder names of different versions. Go to the corresponding directory and check whether the path is correct. Then execute make. If an error is reported, execute. /configure -- with-php-config =/home/renjun/php/bin/php-config -- with-oci8 = instantclient, /usr/lib/oracle/10.2.0.4/client64/lib/after successful execution, you will be prompted to execute make test. Then execute it. A bunch of fail may appear, but it doesn't matter. Continue to make install. Repair ...... remaining full text>

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.