In linux, how does one add extensions to PHP5.6?

Source: Internet
Author: User
Recently, I started to learn how to use Composer. after installation, I found that PHP needs to enable the php_openssl extension. when I tried the extension, I prompted cannotfindconfig. m4. I also tried Baidu but still couldn't solve it. Baidu gave the answer in most cases: find config0.m4 and try again...

Recently, I started to learn how to use Composer. after installation, I found that PHP needs to enable the php_openssl extension. when I tried the extension, the system prompts "cannot find config. m4". I am also Baidu, but it still cannot be solved.

Baidu gave the answer in most cases: find config0.m4 and rename it to config. m4, but I found that this file still does not exist. I also found the document on the official website and thought my package was incorrect.

Is there any great help to see why.

Reply content:

Recently, I started to learn how to use Composer. after installation, I found that PHP needs to enable the php_openssl extension. when I tried the extension, the system prompts "cannot find config. m4". I am also Baidu, but it still cannot be solved.

Baidu gave the answer in most cases: find config0.m4 and rename it to config. m4, but I found that this file still does not exist. I also found the document on the official website and thought my package was incorrect.

Is there any great help to see why.

The problem has been found when you compile and install your own -- prefix =/usr/local/php to execute the ext folder under the compilation directory, so you have not found the extensions. thank you.

This dependency can be compiled and installed.

sudo wget -O m4-1.4.9.tar.gz http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gzsudo tar zxvf m4-1.4.9.tar.gz cd m4-1.4.9/./configure makesudo make install

First, check whether your extension_dir has this extension. If yes, enable it.

If not, download the php5.6 source code, decompress the source code, and switch to the PHP source code directory.
Follow the steps below to install it. you need to change the path according to your environment

Cd ext/openssl
/Usr/local/php5.6/bin/phpize
./Configure -- with-php-config =/usr/local/php5.6/bin/php-config

Make
Make install

Add the configuration in php. ini.
Extension = openssl. so

Have you installed autoconf?

For New linux users, we always recommend using the system's package management tool to install PHP and various extensions:

The default CentOS source is relatively old, see: https://webtatic.com/packages/php55/
The default Ubuntu source can be directly used.sudo apt-get install php5 You can.

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.