Cannot get LDAP extension enabled on new PHP IIS server - php

I have a new server at work, installed PHP 5.4.21 on it yesterday, got SQLSRV working this morning but now I'm stuck getting LDAP enabled. It's not showing in phpinfo(). This is my php.ini file that is in C:\PHP which is where phpinfo() says is the correct directory: http://pastebin.com/yWv9gRNT
I have uncommented extension=php_ldap.dll (near the bottom), I have the dll in the ext folder that is linked in the php.ini file, I have restarted IIS numerous times, I have even copied all DLLs to Windows\System32 folder as recommended on some forums (including libsasl.dll libeay32.dll & ssleay32.dll) & restarted server. Server is Windows 2008 R2 running IIS 7.5.

Add two other dll libeay32.dll and ssleay32.dll and compile with --with-ldap
Step by step:
1 Add extension = php_ldap.dll in php.ini
2 Make sure that you're editing the right php.ini by checking the output of phpinfo()
3Check the php.ini file for the location of your extensions directory
4Check that php_ldap.dll is located in that directory
5 Find the files libeay32.dll and ssleay32.dll and add their directory to the Windows PATH
6 Reboot server. If LDAP is enabled there will be a section about it in the output of phpinfo()

OK, I have resolved this, been away for a week, came back to look at it again...
Turns out at the very first time (before posting on here) it wasn't working (the dll files weren't in the system32 folder) I followed a few posts on here where people suggest downloading the latest version of PHP and taking the ext folder and copying over the ones we have installed. Today I downloaded the zip that matches my version exactly, overwrote all the newer dlls and it now works perfectly, thank you to all those that helped and offered their expertise and time.

Related

Curl not enable wamp [duplicate]

I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying
to get cURL working, so in my php.ini file, I have this line:
extension_dir ="F:\PHP\ext"
And later, I have:
extension=php_curl.dll
The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP
script, I get this in the error log:
PHP Warning: PHP Startup: Unable to load dynamic library 'F:\PHP\ext
\php_curl.dll' - The specified module could not be found.
in Unknown on line 0
Problem solved!
Although the error message said The specified module could not be found, this is a little misleading -- it's not that it couldn't find php_curl.dll, but rather it couldn't find a module that php_curl.dll required. The 2 DLLs it requires are libeay32.dll and SSLeay32.dll.
So, you have to put those 2 DLLs somewhere in your PATH (e.g., C:\Windows\system32). That's all there is to it.
However, even that did not work for me initially. So I downloaded the Windows zip of the latest version of PHP, which includes all the necessary DLLs. I didn't reinstall PHP, I just copied all of the DLLs in the "ext" folder to my PHP extensions folder (as specified in the extension_dir variable in php.ini), and I copied the versions of libeay32.dll and SSLeay32.dll from the PHP download into my System32 directory.
I also did an iisreset, but I don't know if that was necessary.
libeay32.dll and ssleay32.dll have to be path-accessible for php_curl.dll to work correctly.
In Control Panel -> Search -> Advanced System Settings and use the button Environment Variables.
Under System Variables find Path add the c:/php folder (or whatever path) and restart Apache.
A tip is to use the WAMP-installer. Everything just works. It's not IIS though - so if it is important - you should ignore my advice. ;)
EDIT: I saw that you found the solution so I voted it up. +1
I keep having same problem although i did the suggestion above and many others suggested on the internet i get
Sorry, but this plugin requires libcurl to be activated on your
server.
When i try to activate my plugin.
Edited: I was using php 5.3.13 had win64 windows 7 and none of the soln was working for me.
1.I had tried to copy the libeay32.dll SSLeay32.dll in windows\system32 folder did not work
2. Edited and uncommented both php.ini files did not work
3. Activated php_curl in php extensions did not work
4. Copied and replaced several times the www.anindya.com version of php_curl.dll but seems i was downloading the wrong version of this. The version that worked for me was in Fixed curl extensions section the second file php_curl-5.3.13-VC9-x64
Hope this will help anyone else
Faced this problem when I upgraded the php in UwAmp to 7.2.*. The only solution that worked for me was to download the latest version of apache at the time (Apache/2.4.37 (Win32)) and replace the one that came with UwAmp. That also involved editing the sample httpd.conf to produce an httpd_uwamp.conf file. UwAmp needs this template to then generate the actual httpd.conf when it starts up. All other suggestions above didn't resolve it for me unfortunately. Also note that as of OpenSSL 1.1, libeay32.dll and ssleay32.dll are no longer required (see http://php.net/manual/en/curl.installation.php)
In your case just add "F:\PHP\ext" to Environment Variable "path".

Enabling CURL with PHP 5.6 on Windows 8

I have Apache 2.4.12 and php 5.6.9 on my Windows 8 computer and I'm trying to enable the curl extension for php however, I haven't had much success. After searching the internet for this issue it appears that other's have had the same trouble. Here are the suggestions I've found:
Uncomment ;extension=php_curl.dll in php.ini
Uncomment ;extension_dir = "ext" in php.ini
Download and replace the php_curl.dll file in the ext directory of php with one from this website
Add to the PATH environment variable where php is installed
Copy libeay32.dll and ssleay32.dll from where php is installed to C:\Windows\System32
I've tried every single suggestion with no success except the third item in the list because it doesn't have a .dll file for curl with php 5.6, in fact the highest version avaible is one for php 5.4. There has to be way to enable this extension without having to downgrade my php version to 5.4 and using a .dll file from that website. I've tried searching the internet for a .dll file like the one on the linked website for php 5.6 opposed to a version of php that's outdated but I've had no luck in finding one so I'd like help with this issue.
How can I enable curl for php 5.6 on my Windows 8 machine?
Locate your php folder and follow these instructions:
Move to Windows\system32 folder:
libssh2.dll, php_curl.dll, ssleay32.dll, libeay32.dll
Move to Apache24\bin folder
libssh2.dll
Uncomment extension=php_curl.dll
Note: Don't overwrite when prompted.
Source
I give you an example of a set up that just worked perfectly for me :
downloaded the VC11 x86 Thread Safe version of PHP,
unzipped it within a directory C:\php,
edited the php.ini-development, uncommenting 2 lines :
extension=php_curl.dll
extension_dir = "ext"
saved this file under php.ini.
I just tested it via the CLI (windows CMD here) on a PHP a file (i.e. C:\php\php myFile.php) and cURL worked.
If you have Apache installed and prefer to test it in a browser, you obviously have to adapt this installation with your own files structure and to do not forget to restart Apache.
Running apache service with a specific user other than local system solved the problem for me. You can test this easily by stopping the apache service and running manually <apache dir>\bin\httpd.exe.
I fixed this problem by adding C:\php and C:\php\ext to PATH system variables.
Press window + pause to bring up the System Properties page.
Click Advanced System Settings
Click Environment Variables
You'll see the Path variable in the System Variables box in the bottom.
Append your PHP path to that variable. Now the system will be able to load the extensions.
In addition to uncommenting the line
;extension_dir = "ext"
Try also setting it to the absolute path of the PHP installation's ext folder and then restarting apache.
e.g.:
extension_dir = "C:\PHP 5.6.19\ext"

MBstring not loading, phpMyAdmin fatal error etc etc on WINDOWS 7 PRO local server

Trying to install a local server for testing on a WINDOWS SEVEN PRO (Windows 7 pro). This is not the first time I installed local servers, but I never worked with phpMyAdmin so that aspect is new for me.
Installed Apache 2.4.10 64 bit and and PHP 5.6.3 (x64) on my PC as local server for testing a forum set-up. Installed Apache and configured: works ok with my websites. Installed PHP, localhost:info.php gives the entire php info sheet so PHP works also.
However, the mbstring module does not show up in the php info sheet.
Copied phpMyAdmin to the htdocs folder of Apache. Installing gives the error message
"fatal error: Call to undefined function mb_detect_encoding() in C:\Apache24\htdocs\phpmyadmin\libraries\php-gettext\gettext.inc on line 177"; also showing that the mbstring is not functional
I spent over a day browsing through internet, finding similar threads but none with an answer that works for me.
php.ini
I started with uncommenting the extension=php_mbstring.dll, then I added an absolute directory path and now the php.ini is as follows
Directory path
extension_dir = "C:\php\ext\"
The following lines are uncommented
extension=php_gd2.dll
extension=php_intl.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll
The php.ini file originally was in the php directory. I then moved it to the apache root directory (c:\apache24\htdocs and now the php.ini file is in three identical copies (everytime carefully copied and refreshed) in the c:\windows folder, the C:\php folder and the c:\apache24\htdocs folder.
The php_mbstring.dll file (1.4 mb in size) is in the php\ext folder and the php.ini file has an absolute path to that directory.
both apache and PHP are under their own folders on c: level, so short paths and no spaces in paths like with the "program folder"
Apache monitor has been stopped and started, restarted and the whole PC switched off and restarted.
I even downloaded a one-month newer version of PHP and still no dice.
Summarizing: the mbstring is uncommented and present but not showing up on the php info-sheet and phpMyAdmin also has problems locating it?
Our nrw forum will be multiple language and I have to make this work somehow.
Again, we are talking W7 with individually installed Apache, php, and phpMyAdmin

How to get CURL to work with PHP on Windows? (WAMP)

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.

PHP / cURL on Windows install: "The specified module could not be found."

I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying
to get cURL working, so in my php.ini file, I have this line:
extension_dir ="F:\PHP\ext"
And later, I have:
extension=php_curl.dll
The file F:\PHP\ext\php_curl.dll exists, but when I try to run any PHP
script, I get this in the error log:
PHP Warning: PHP Startup: Unable to load dynamic library 'F:\PHP\ext
\php_curl.dll' - The specified module could not be found.
in Unknown on line 0
Problem solved!
Although the error message said The specified module could not be found, this is a little misleading -- it's not that it couldn't find php_curl.dll, but rather it couldn't find a module that php_curl.dll required. The 2 DLLs it requires are libeay32.dll and SSLeay32.dll.
So, you have to put those 2 DLLs somewhere in your PATH (e.g., C:\Windows\system32). That's all there is to it.
However, even that did not work for me initially. So I downloaded the Windows zip of the latest version of PHP, which includes all the necessary DLLs. I didn't reinstall PHP, I just copied all of the DLLs in the "ext" folder to my PHP extensions folder (as specified in the extension_dir variable in php.ini), and I copied the versions of libeay32.dll and SSLeay32.dll from the PHP download into my System32 directory.
I also did an iisreset, but I don't know if that was necessary.
libeay32.dll and ssleay32.dll have to be path-accessible for php_curl.dll to work correctly.
In Control Panel -> Search -> Advanced System Settings and use the button Environment Variables.
Under System Variables find Path add the c:/php folder (or whatever path) and restart Apache.
A tip is to use the WAMP-installer. Everything just works. It's not IIS though - so if it is important - you should ignore my advice. ;)
EDIT: I saw that you found the solution so I voted it up. +1
I keep having same problem although i did the suggestion above and many others suggested on the internet i get
Sorry, but this plugin requires libcurl to be activated on your
server.
When i try to activate my plugin.
Edited: I was using php 5.3.13 had win64 windows 7 and none of the soln was working for me.
1.I had tried to copy the libeay32.dll SSLeay32.dll in windows\system32 folder did not work
2. Edited and uncommented both php.ini files did not work
3. Activated php_curl in php extensions did not work
4. Copied and replaced several times the www.anindya.com version of php_curl.dll but seems i was downloading the wrong version of this. The version that worked for me was in Fixed curl extensions section the second file php_curl-5.3.13-VC9-x64
Hope this will help anyone else
Faced this problem when I upgraded the php in UwAmp to 7.2.*. The only solution that worked for me was to download the latest version of apache at the time (Apache/2.4.37 (Win32)) and replace the one that came with UwAmp. That also involved editing the sample httpd.conf to produce an httpd_uwamp.conf file. UwAmp needs this template to then generate the actual httpd.conf when it starts up. All other suggestions above didn't resolve it for me unfortunately. Also note that as of OpenSSL 1.1, libeay32.dll and ssleay32.dll are no longer required (see http://php.net/manual/en/curl.installation.php)
In your case just add "F:\PHP\ext" to Environment Variable "path".

Categories