PHP5.6 How do I add extensions in a Linux environment?

Source: Internet
Author: User

Recently began to learn to use composer, installation is to find PHP need to open php_openssl this extension, when I try to expand the prompt cannot find config.m4, I also Baidu a bit but still can't solve.

Baidu for a moment most of the answer is to find CONFIG0.M4 and then renamed to CONFIG.M4 but I looked for a while still do not have this file, but also on the official web-site to find the following file for my own package is not right.

Is there a great God to help see what the reason is.

Reply content:

Recently began to learn to use composer, installation is to find PHP need to open php_openssl this extension, when I try to expand the prompt cannot find config.m4, I also Baidu a bit but still can't solve.

Baidu for a moment most of the answer is to find CONFIG0.M4 and then renamed to CONFIG.M4 but I looked for a while still do not have this file, but also on the official web-site to find the following file for my own package is not right.

Is there a great God to help see what the reason is.

The problem has been found itself when compiling the installation--prefix=/usr/local/php the Ext folder under the compiled directory did not move over, so I have not found those extensions, thank you.

You can compile and install the dependency

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 look at your extension_dir there is no this extension, some words open on the line

Download php5.6 source code, unzip the source code, switch to the PHP source directory
Follow the steps below to install, 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

And then add the configuration to the php.ini.
Extension=openssl.so

Did you install the autoconf?

For Linux novices, it is always recommended to install PHP and various extensions using the system's package management tools:

CentOS default source is older, please refer to: https://webtatic.com/packages/php55/
Ubuntu default source can be used directly, directly sudo apt-get install php5

  • 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.