Home Backend Development PHP7 What to do if PHP7 fails to enable OpenSSL extension

What to do if PHP7 fails to enable OpenSSL extension

May 17, 2021 am 09:25 AM

This article will introduce to you the solution to the failure to open the OpenSSL extension in PHP7. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

What to do if PHP7 fails to enable OpenSSL extension

Recently I learned the Laravel framework and needed to enable the OpenSSL extension of PHP. I tried many methods on the Internet but failed. Finally, after a long time, I finally succeeded. Now I will write down my experience. To summarize.

The following is my failure experience:

First use the most popular method on the Internet:

1. First check whether extension=php_openssl.dll exists in php.ini. , if it exists, remove the preceding comment character ";", if this line does not exist, add extension=php_openssl.dll;

2. Change the file in the PHP directory: php_openssl.dll (this file is in the ext file folder), ssleay32.dll, libeay32.dll 3 files are copied to the windows\system32\ folder;

3. Restart apache;

At this point, the openssl function is turned on.

Obviously, I didn’t succeed, so I continued to look for ways.

Then I saw someone on Zhihu encountering the same problem, and later solved it, and also told me the method, so I tried it too. After a while, the method is as follows:

The questioner said it is only for win7, mine is win10, but I still tried it, what if it succeeds

Obviously, there was still no success, so I continued to look for a way.

After that, I tried a few more methods, but still no success. Then I thought about using someone else’s computer to try, so I used a friend’s computer to try. Once, I removed the comment in front of extension=php_openssl.dll in php.ini. The three files were not copied. I restarted Apache and opened phpinfo. It was successful. It was a success. At this time, my heart was broken. Why was mine not working? I had no choice but to continue. Finally, I combined the SSL-related parts of the PHP configuration file php.ini of the two computers and the Apache configuration file http.conf. By comparison, I hope I can find the problem. Finally, I found a little difference. I found that LoadModule ssl_module modules/mod_ssl.so was commented out in my http.conf, while his was not commented out. Immediately remove the comment, restart Apache, open phpinfo, search for OpenSSL, and find three more search records, but it is still not enabled. At this point, I had no choice but to continue searching. The hard work paid off and I finally succeeded.

The following is the final successful method:

I saw an article about some issues that need to be paid attention to when upgrading php5 to php7, including this one:

When restarting Apache, it is reported that curl and openssl extension libraries failed to load (apache log will report an error)

You can copy and replace the libeay32.dll and ssleay32.dll files to the apache\bin directory, and start Apache again

I tried it again and it was successful, so my successful method should be to remove the comments about the openssl extension in php.ini, move the above two files, and restart Apache.

Note: When copying two files to the apache\bin directory, it is best to back up the two files in the original directory in advance. If an overwriting error occurs, just close Apache.

Everyone’s environment may be slightly different, the above content is for reference only.

Recommended learning: php video tutorial

The above is the detailed content of What to do if PHP7 fails to enable OpenSSL extension. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)