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