Steps for compiling OpenSSL modules in PHP

Source: Internet
Author: User
Tags openssl php framework

PHP compiling OpenSSL steps for a module

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

To install the composer command:

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

The exception is 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-WITH-OPENSSL option caused. But on the Internet search related issues, found that we do not need to recompile the PHP environment, you can use Phpize to compile only openssl.so files, and add the file to the php.ini file.

1. Environmental

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 Compiled directory:

/home/wuguowei/software/php5.5

2. Steps

# Copy from source directory OpenSSL directory to 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 destination file

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

# execute the following code sequentially

/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, add at the end of the extension= openssl.so "

# reboot 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 Where's the order?

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.