Home  >  Article  >  Backend Development  >  What should I do if php 5.4 curl cannot be loaded?

What should I do if php 5.4 curl cannot be loaded?

藏色散人
藏色散人Original
2021-09-20 09:45:411948browse

php5.4 Solution to curl unable to load: 1. Find the php.ini configuration file in the php installation directory; 2. Remove the semicolon in front of "extension=php_curl"; 3. Assign the path to ext to "extension_dir".

What should I do if php 5.4 curl cannot be loaded?

The operating environment of this article: Windows 7 system, PHP5.4, Dell G3 computer.

What should I do if php 5.4 curl cannot be loaded?

About the solution to the problem that php_curl cannot be loaded

In order to test a As an example of simulating login to 163 mailbox, a big problem was encountered in the process: the undefined curl_init function. Then I searched all over the Internet and found a lot of solutions. I tried them one by one, but still couldn't solve my problem. My problem was completely solved until I saw a link to the blog "PHP Newbie's Notes - How to Solve the Problem of Unable to Load the Dynamic Link Library". So I wanted to record it.

About the undefined curl_init function is caused by the failure to load the php_curl module. The general solution is:

(1) Find the php.ini configuration file in the PHP installation directory, remove the ; (comment symbol) in front of extension=php_curl, find extension_dir, remove the previous comment symbol, and put The path of ext (this folder in the PHP installation directory) is assigned to extension_dir.

(2) Since the operation of php_curl.dll (in the previous ext folder) depends on the libeay32.dll and ssleay32.dll libraries (in the php installation directory), it needs to be configured in the Apache configuration file httpd Load these two libraries in .conf:

LoadFile "D:/PHP/PHP/libeay32.dll"
LoadFile "D:/PHP/PHP/ssleay32.dll"

(3) Add the PHP installation directory to the environment variable.

Complete the above three steps, if you still have problems. So here’s what I’m going to talk about next:

Most people on the Internet say that the php_curl library depends on the libeay32.dll and ssleay32.dll libraries. In fact, if you use a tool to view library dependencies, you will find that it also depends on the library. Depends on zlib.dll library. So this is why the problem still exists after you complete the above three steps. The next step is to go to the next zlib.dll library => http://www.zlib.net/. Of course, the name after downloading should be changed to zlib.dll, and then placed in your PHP installation directory.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What should I do if php 5.4 curl cannot be loaded?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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