Php compilation steps of the openssl module-php Tutorial

Source: Internet
Author: User
Php compilation steps of the openssl module Php Compile Openssl Steps of the module

Recently, we intend to use composer in the php framework to manage dependencies. However, when executing the composer installation command (as shown below), we found that the system prompts that the openssl extension class library was not installed.

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 youshocould enable it or recompile php with -- with-openssl



This exception should be caused by the absence of the-with-openssl option during php compilation. However, when searching for related questions on the Internet, we found that we do not need to re-compile the php environment. we can use phpize to compile only the openssl. so file and add the file to the php. ini file.

1.Environment

1) Operating system:

Linuxubuntu 3.20.- 24-generic # 46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014x86_64 x86_64 x86_64 GNU/Linux

2) php source code directory:

/Home/wuguowei/software/php-5.5.14_source

3) php compiled Directory:

/Home/wuguowei/software/php5.5

2.Procedure

#Copy from source directoryOpensslDirectory 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

#EnterPhpIn the compiled target file

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

#Execute the following code in sequence:

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

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

Make & make install

#FindPhp. iniFile (usually in/Etc/php. in) In"DynamicExtensions", Add"Extension = openssl. so"

#RestartPhpServer

#View the compiledOpensslMethod

Php-I | grep 'openssl'

The correct result is 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



#ViewPhpWhere is the command?

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.