Solve Apache 2.4+PHP5.6 does not support CURL

Running a demo, I suddenly found that the most common combination of Apache 2.4+PHP5.6 on the server does not support curl, and reports that there is no curl_init function; and php_curl.dll has been opened in php.ini, and the output of php -i is normal , indicating that curl is executable.

 

After tossing and thinking for a long time, I finally upgraded php5.6, apache2.4 and the corresponding svn_mod to the latest, and found that it was still not easy to use, but the error.log reported an error:

PHP Warning:  PHP Startup: Unable to load dynamic library 'D:/services/web/php56/ext/php_curl.dll' - \xef\xbf\xbd\xd2\xb2\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xd6\xb8\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xc4\xb3\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\r\n in Unknown on line 0

Convert it to byte[] according to the old rules , and then the output string is found to be garbled... All kinds of codes are useless, and they can't be converted. I'm so tired.

I googled it later and found

http://stackoverflow.com/questions/16424117/php-unable-to-load-php-curl-dll-extension

It's more reliable what it says:

wrote
Make sure to have your apache SSH dlls loading correctly. On a fresh install I had to download and load into my apache bin directory the following dll "libssh2.dll"

After ssl dll was loaded cURL was able to load with no issues.

You can download it from the link below:

http://windows.php.net/downloads/pecl/releases/ssh2/0.12/

 After downloading php_ssh2-0.12-5.5-ts-vc11-x64.zip, I tried this libssh2.dll and put it under the lib of the php directory, and then started apache curl and it worked fine!

 

In other words, the mode of nginx+fastcgi is still the preferred mode for running PHP in the production environment. Without the interdependence between programs, it will be much less and easier to solve.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326518320&siteId=291194637