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