How to enable OpenSSL in the lemp environment compiled and installed in the source code package

Source: Internet
Author: User

How to enable OpenSSL in the lemp environment compiled and installed in the source code package

Hello, everyone! I'm an evil gentleman!

Today, I would like to share with you the process of enabling the OpenSSL feature in the LEMP environment for compiling and installing source code packages. A few days ago, when accessing the page, an error suddenly occurred, requiring openssl to be enabled. What should I do? The first thing I think of is yum installation, but it is still not solved after installation, because the LEMP environment is compiled and installed by the source code package, so openssl needs to be compiled and installed.

After unremitting efforts, I finally found a solution and succeeded. Let's share it with you!

First, make sure that the LEMP environment is compiled and installed by the source code package and that the installation directory of PHP is clear.

Second, you can use the yum source method or the source code package to compile and install OpenSSL and OpenSSL-devel packages.

Then, go to the directory decompressed by PHP. My directory here is a PHP-5.4.24. Under the PHP Directory, there will be an ext extension directory, go to it, find and enter the openssl directory. At this time, our directory is:/root/php-5.4.24/ext/openssl

The directory contains the following files, as shown in the figure:

 

Then run the/usr/local/php5/bin/phpize command (make sure that the m4 and autoconf tools are installed before execution; otherwise, an error is reported ).

Note: Here is my phpize path, which can be executed based on your own installation path. If it cannot be found, use whereis phpize to find it. If the config. m4 file cannot be found when an error is reported, rename config0.m4 in the directory, because config0.m4 is the template of config. m4.

If the command is successfully executed, a configure file is automatically added to the directory. In this case, you only need to compile and install the file. The process is as follows:

  1. #./Configure -- with-openssl -- with-php-config =/usr/local/php5/bin/php-config
  2. # Make & make install

Wait patiently. After the installation is complete, an openssl. so file will be added under the current modules directory. Then, add the following line at the end of the php. ini configuration file:

  1. Extension = openssl. so

Restart the nginx service and php-fpm!

Now, openssl has been enabled in the LNMP environment for source code compilation and installation!

If you encounter any problems during the operation, you can leave a message to share and learn and make progress together!

Provides FTP + SSL/TLS authentication through OpenSSL and implements secure data transmission.

Use OpenSSL to sign multi-domain certificates

OpenSSL details: click here
OpenSSL: click here

Personal Home Page: http://linux.cn/space/16475

This article permanently updates the link address:

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.