Steps for PHP to compile the OpenSSL module

Source: Internet
Author: User
PHP compiling OpenSSL steps of the module

recently we intend to use composer to manage dependencies in the PHP framework, but when executing the composer installation command (below), it was discovered that the OpenSSL Extension class library was not installed.

To install the composer command:

Sudocurl-s Https://getcomposer.org/installer | sudo php

Exceptions are as follows:

Some settings Onyour machine make Composer unable to work properly.

Make sure thatyou fix the issues listed below and run this script again:

The opensslextension is missing, which means that secure HTTPS transfers areimpossible.

If possible youshould enable it or recompile PHP with--with-openssl



See this exception, should be my PHP in the process of compiling without adding the-WITH-OPENSSL option caused. However, when searching for related problems on the Internet, we found that we do not need to recompile the PHP environment, we can use phpize to compile the openssl.so file only, and add the file to the php.ini file.

1. Environment

1) Operating system:

Linuxubuntu 3.13.0-24-generic #46-ubuntu SMP Thu Apr 19:11:08 UTC 2014x86_64 x86_64 x86_64 gnu/linux

2) PHP Source directory:

/home/wuguowei/software/php-5.5.14_source

3) PHP post-compilation directory:

/home/wuguowei/software/php5.5

2. Steps

# Copy from source directory OpenSSL directory into the compiled directory file

sudocp-r/home/wuguowei/software/php-5.5.14_source/ext/openssl/home/wuguowei/software/php5.5/include/ Php/ext

# Enter PHP in the compiled target file

Cd/home/wuguowei/software/php5.5/include/php/ext

# execute the following code in turn

/home/wuguowei/software/php5.5/bin/phpize

./configure--with-openssl?with-php-config=/home/wuguowei/software/php5.5/bin/php-config

make&& make Install

# Find php.ini files (usually in /etc/php.in ) in the " dynamicextensions " the content, added at the end of the " extension= openssl.so "

# Restart PHP Server can

# View the compiled OpenSSL the method

Php-i |grep ' OpenSSL '

The correct results are as follows:

Root@ubuntu:/home/wuguowei/software/composer#php-i |grep OpenSSL

Openssl

Oldpwd=>/home/wuguowei/software/php5.5/include/php/ext/openssl

_server["Oldpwd"]=>/home/wuguowei/software/php5.5/include/php/ext/openssl



# View PHP Command where the command is

Whereis PHP

which PHP

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