I cannot install PHP-CURL on IIS. I think I have tried everything.
My phpinfo() output does not list cURL as available.
I have C:\PHP in my path and working correctly.
I have edited the registry to read from C:\PHP\php.ini. phpinfo() output shows the correct .ini path loaded.
I have uncommented 'extension=php_curl.dll'
I have ssleay32.dll and libeay32.dll availble in C:\PHP
Windows Server 2003
IIS 6
PHP 5.2.4
Try running:
php-cgi.exe -v
and see if any errors come up.
Also make sure the php is correctly in your path by going to the command line and typing:
echo %PATH%
As well make sure the php_curl.dll is in the correct directory and that ssleay32.dll and libeay32.dll are the same versions.
If all else fails try reinstalling PHP as I remember there being some issues a while back with the Curl Module not working on 5.1.4.
As well someone else mentioned installing the thread safe PHP package versus the non-thread package resolving a similar issue.
Did you definitely put php_curl.dll in the directory that PHP reads extensions from? Are the file permissions on it ok? And the big question: where did you get the php_curl.dll from? If you got a precompiled one it might be compiled for a different version of PHP than you are running. Check your webserver logs and see what comes up from PHP when you restart the server/container/whatever.
Related
I'm having huge problems installing memcached extension for php.
Currently using:
OS: Windows 10 x64
PHP: 7.0.1 via XAMPP
Apache: 2.4.18 (Win32)
I have successfully installed memcached in C:/memcached the service is running.
But the problem starts when trying to add the memcache php extension. I've tried numerous versions of php_memcache.dll and non seem to be working. I did include the extension in php.ini extension=php_memcache.dll
When i run php -m memcache is not listed and at the top i recieve the error:
PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_memcache.dll' - The specified module could not be found.
And when I try running a test.php for memcache initialization i recive the Class not found exception
This is a huge problem, because I need it for running selenium tests.
The memcached service doesn't actually install the PHP memcached extension for you. It only installs the memcached server used to store your cache.
You'll need to download the Windows DLL from the PECL repository first (click on the blue Windows DLL link). Then you must add the extension=php_memcache.dll line to the correct php.ini file for your SAPI. Also, note the extension DLL file needs to be placed in the correct path for your XAMPP installation.
For Apache, simply create a script in your document root with the line <?php phpinfo(); and try loading that in your web browser. You should see a line at the top labeled Loaded configuration (php.ini) which gives you the full path to your loaded php.ini file. On Windows the path may actually appear different than what is stated in phpinfo() if you installed PHP through something like XAMPP. So you may need to rely on XAMPP to locate the correct php.ini file.
For the CLI SAPI, you can use php.exe --ini to do the same. Again, you may need to rely on the XAMPP package if it has modified your configuration path (since this is a compile time directive).
After making your changes to php.ini you will need to restart PHP for the changes to take effect.
Since you're using PHP 7 on Windows it's probably also important to note that the compiled DLL from PECL may not actually work under apache for Windows, because you're more than likely using a theaded SAPI. So make sure you are downloading the correct version. As far as I can tell that version is only compiled to work with up to PHP 5.6. The github alternative, for PHP 7, available at https://github.com/nono303/PHP7-memcahe-dll as mentioned in the comments is tested under non-thread safe. So you may only be able to get this working for your CLI scripts on Windows.
I wanted to install composer on my other computer. I have encountered this question before but none of the answers seem to work for me.
I tried enabling the openssl package in php.ini but it is already enabled. i tried changing the include path in my php.ini file. I reinstalled mamp . But none of the above fix the problem.
i'm using php 5.6.8
I fixed the problem by putting the php.ini file in the c:\windows file, it's a messy solution but it works. I can't use MAMP PRO anymore for some reason it keeps crashing, but it works on MAMP and i installed composer.
I suggest to take the following steps to make sure that the openssl extension gets loaded:
determine where your PHP is: open a command prompt, then php --ini.
find under "Loaded Configuration File" the path to the active php.ini
make sure this php.ini has extension=php_openssl.dll
I think you either have multiple PHP version installed and the Composer installer picks the one, where you didn't modify the php.ini or starts php without an php.ini.
(There are server stacks for windows with composer support out of the box, like wpn-xm. Sorry, shameless plug.)
I can't get cURL to work from inside Apache by any means. It's actually fairly strange too provided that:
I can execute my PHP pages from the CLI and it POSTs my requests perfectly fine
When I look at my error logs, I get "PHP Fatal error: Call to undefined function curl_init()" as if the extension isn't installed at all. Similarly, a quick `phpinfo()` also yields such as if the extension isn't installed.
Additionally, when I built PHP, I opted the "--enable-curl" flag.
You are probably not loading the extension in the appropriate php.ini. The file should include something like:
[PHP_CURL]
extension=php_curl.dll
Also, --enable-curl is not a PHP configure option. --with-curl=[DIR] is the one you'd want. Check out the cURL installation instructions.
php_curl.dll should be inside PHP's ext directory when configured correctly.
I had same problem after installing php5-curl. I rebooted apache and that fixed it.
sudo /etc/init.d/apache2 restart for ubuntu 12.04
I had similar problem - worked from cli, silently failed from Apache 2.4
I've tried:
1) copying ssleay32.dll and libeay32.dll from php folder into apache\bin folder - didn't work
2) deleting ssleay32.dll and libeay32.dll from apache\bin folder completely - WORKED.
You should restart apache server each time you make change to make it work.
Also you should install both x86 and x64 versions of C++ Resistributable Visual Studio from Microsoft.
Update: The problem appears to have been corrupt DLLs somewhere in my PHP installation, or possibly a bug in PHP 5.2.9 on Win2k. I downloaded the windows (binaries-only) distribution of PHP 5.2.10 from php.net and extracted that to my c:\PHP directory. After doing that, everything worked fine.
Update2: I undid everything that I tried earlier (everything from the bulleted list below), except that I left "extension=php_curl.dll" uncommented in my php.ini file. It turns out that is all you should have to do in a proper installation.
I'm trying to get CURL to work on a Windows installation of PHP (version 5.2.9-2), and I am at wit's end. I have found the PHP CURL installation page, this SO question which references this page, and this SO question. I've tried most of the suggestions in all of those pages but I still get an error. Here is my very simple test page:
<?php
$ch = curl_init();
?>
<b>Success!</b>
This gives me:
Fatal error: Call to undefined function curl_init() in C:\ApacheRoot\curltest.php on line 2
In my Apache error log I get this each time the server starts:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\PHP\\ext\\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0
I have done the following:
Uncommented the following line in php.ini: extension=php_curl.dll
Copied ssleay32.dll and libeay32.dll from C:\PHP to C:\WINNT\System32
Downloaded cURL for Win32 from curl.haxx.se and extracted the .zip file to C:\cURL
Added C:\cURL to my system PATH environment variable.
Verified that:
php.ini includes extension_dir="C:\PHP\ext"
The directory C:\PHP\ext contains php_curl.dll
The only php.ini file on my system is in C:\PHP (i.e. especially that there is no C:\WINNT\php.ini)
The Apache httpd.conf file includes the line PHPIniDir "C:/PHP/"
I have also rebooted the machine (several times, in fact...).
You don't have to reboot the computer, just restart the apache and the php module will read the new ini.
Did you change the correct php.ini? In case of doubt
<?php echo 'php.ini: ', get_cfg_var('cfg_file_path'); ?>
can tell you.
Is there something in the error.log of the apache that indicates that something went wrong while loading php and the php_curl.dll?
Did you start the apache as a win32 service? If you did try to start it as a console application. Error messages will show up on the console then. Or start it as a service and take a look at the error.log file and the windows event log (start, run, eventvwr.msc /s).
edit:
"The specified procedure could not be found"
You need a dll that is compatible with your php version and build. Exactly what did you install and where did you get it from?
Try this:
Stop WAMP completely.
Find your WAMP folder: C:\Path\To\WAMP\bin\Apache\ApacheVersion\bin\
Edit that php.ini and uncomment extension=php_curl.dll
Restart WAMP.
That should hopefully solve it.
*EDIT: Do the same thing # C:\Path\To\WAMP\bin\php\PHPVersion\
This is what worked for me
Answered by Soren from another SO thread - CURL for WAMP
"There seems to be a bug somewhere. If you are experiencing this on Win 7 64 bit then try installing apache addon version 2.2.9 and php addon version 5.3.1 and switching to those in WAMP and then activating the CURL extension. That worked for me."
This fixed it for me:
Go to here:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
Download 'php_curl-5.3.13-VC9-x64.zip'
Stop WAMP Server from Running
Extract the file 'php_curl.dll'.
On your local machine, browse to (or where your WAMP installation is found) c:\wamp\bin\php\php5.3.13\ext
Rename php_curl.dll to php_curl.dll.old (or whatever you choose) and then copy the new file into the above directory.
Restart WAMP Server
All should be working ok now.
I had the same problem with php-5.5.26-Win32-VC11-x64 (on Windows) and I tried everything listed here with no luck. Finally I got it working by adding PHP installation directory to windows Path.
With PHP 5.6.9 on Windows Server Core 2012 x64 cURL was not working, not showing up in phpinfo despite uncommenting php_curl.dll extension in my php.ini and restarting the Apache 2.4 service. Added the php path and the php\ext path to my $evn:path. No joy.
Fix: I didn’t need to download any other php_curl.dll file and couldn’t find one for PHP 5.6 anyway. What finally worked was to copy these three files into the Apache24\bin folder then restart Apache:
libeay32.dll
libssh2.dll
ssleay32.dll
Copying these to System or System32 was not needed.
If the problem persists after you uncomment the module from both php.ini files (that people are already talking about and which are located on apache folder and php folder) and even after you check that you got the php_curl.dll ** at
C:\WAMP\bin\php\php5.3.13\ext
YOU SHOULD TRY TO REPLACE THE ORIGINAL DLL THAT COMES WITH WAMPSERVER with one from this website:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
My problem was there!
Hope it helps.
I am running a tweaked webmail application. However, for some reason the openssl extension isn't loading. I have enabled it in the php.ini, but when I run my application and check for loaded extensions using get_loaded_extensions, the openssl is not in the array of loaded extensions. What is wrong here? The php_openssl.dll is physically there - I am running a wampserver and it looks ok. But on the execution end it is not working.
Depending on how php_openssl.dll was built/linked it depends on libeay32.dll and/or ssleay32.dll. Windows must be able to (also) load those two .dlls into the process running php in order to make the php_openssl.dll available/functional.
Since windows searches for .dlls (amongst other places) in the directory of the executable try placing libeay32.dll and ssleay32.dll in the apache/bin directory (where the httpd.exe resides) and restart the webserver.
see also: Dynamic-Link Library Search Order
and How to use Dependency Walker
Have you tried restarting your apache server?
And is the DLL in the right place?
This may help you. Copy dll files in windows and windows/system32 folders and then restart Apache server.