Wamp, WordPress LDAP - php

Hi I am trying to use active directory for my WordPress site (intranet). I have tried a few plugins and none of them have worked so far. I want to stick with Active Directory Integration V1.1.5 as it is one of the most feature rich for my needs.
The issue I am having is that I have My WAMP server installed (Windows User). When I check my
Apache modules says ldap_module is enabled
PhP extensions says php_ldap is enabled
But it does not work. The plugin I am using has a testing tool and the result returned is as follows.
AD Integration Logon Test - openLDAP not installed
Looking at my settings it all seems to be installed correctly. Some other things I have tried:
Went to \\manmd01\c$\wamp\bin\apache\apache2.4.9\modules and made sure that mod_ldap.so exists.
I've gone into \\manmd01\c$\wamp\bin\apache\apache2.4.9\conf\httpd.conf and made sure that this line is not commented out: LoadModule ldap_module modules/mod_ldap.so
I've gone into \\manmd01\c$\wamp\bin\php\php5.5.12\php.ini and made sure this line is not commented out: extension=php_ldap.dll
I have looked at other posts (on stack overflow) and tried to replicate the fixes but so far nothing appears to have worked for me this is why i am asking the question again.

The ini file that is used by Apache is not the \wamp\bin\php\php5.5.12\php.ini.
If you use the wampmanager menus ( they are there for a reason )
wampmanager -> PHP -> php.ini
It will edit the correct file, which for reference is \wamp\bin\php\php5.5.12\phpForApache.ini.
If you uncomment the ldap extension in there you will have more luck.
Alternatively, you can use the wampmanager menus ( they are there for a reason ) to turn on the ldap extension.
wampmanager -> PHP -> Extensions -> php_ldap
If this menu item does not have a tick beside it, then click it, it will automaticalyy amend the CORRECT ini file and then restart Apache so that the change is activated.
NOTE: The php.ini file in \wamp\bin\php\php5.5.12\php.ini is only used by the PHP CLI (Command Line Interpreter)
Also the php_ldap extension requires 3 other dll's to be available in order to run. These are :-
libsasl.dll
libeay32.dll
ssleay32.dll
The old way, WAMPServer 2.4 and before was to copy these to the \wamp\bin\apache\apache{version}\bin but there is a better way as of 2.5.
On WAMPServer 2.5 these are located in the \wamp\bin\php{version}\php` folder. There should be SYMLINKS created inside the \wamp\bin\apache\apache{version}\bin folder by the install. If these SYMLINKS do not exist, then to recreate all the required SYMLNKS the easiest way is to use the wampmanager menus to recreate them. You do this by :-
wampmanager -> Apache -> Version -> 2.4.9 (i.e. click on the version number)

Go to Control Panel and open the System icon (Start → Control Panel)
Go to the Advanced tab
Click on the 'Environment Variables' button
Look into the 'System Variables' pane
Find the Path entry (you may need to scroll to find it)
Double click on the Path entry
Enter your PHP directory at the end, including ';' before (e.g. ;C:\wamp\bin\php\php5.5.12)
Press OK
Restrart Wamp

Related

PHP gives fatal error for curl extension in windows. curl_init undefined

i have tried everything to load curl extension but it is not displayed in the loaded extension list.
In WAMPServer activating and deactivation extension for the WebServer (Apache) is simple
Use the WAMPServer menus, on the icon in the system tray (it may need to be takes out of the extension area to make sure it sits on the taskbar all the time.
left click wampmanager -> PHP -> PHP Extensions
You should see a menu popout like this
Notice, the extension names all listed, if they have a Green Tick then they are activated, if not, they are not. To activate or deactivate the extension click the extensions name. Wait 10 second while WAMPServer restarts Apache automatically for you and there you go, Job Done.
If you want to use PHP CLI
The PHP CLI is controlled differently, there are actually 2 php.ini files. The one in the wamp64\bin\php\php{version} controls the PHP CLI.
You have to edit this one yourself, so edit wamp64\bin\php\php7.4.16\php.ini and make sure that
extension=curl
does not have a # comment in front of it
Its a little odd that it is not already activated as WAMPServer comes, out of the box, with the curl extension pre-activated
as I was using multiple versions of PHP so after deselecting the current version, selecting another version and then again selecting back the current version and then restarting the server made it work.

Wamp Server 2.2 not working after enabling a PHP Extension

I've been working on Wamp Server 2.2 . Everything is ok but when I tried to enable a PHP Extension from the icon tray then Apache won't work anymore. Unless I re-install it then it will work. But I need to enable some PHP Extensions like curl and postgre pdo for my project.
I also tried manually editing the php.ini to enable php extensions, still wamp server apache won't work. Any ideas?
Just enabling a php extension from wamp does not work sometimes because if there is no extension for that module in the php's extension folder then wamp will either stop working or might give out some windows pop up error message when you start wamp.
So please check if those modules exists in the extension directory of your php's root folder.
I hope this helps you.
WAMPServer has more than one php.ini file and it is easy for beginners to get confused.
The safest way to edit the Correct php.ini file is to use the wampmanager.exe menu links
left click wampmanager -> PHP -> php.ini
This will edit the \wamp\bin\apache\apache{version}\bin\php.ini file, which is the correct one for effecting php changes for the PHP used on your web site.
The menu links should also work to activate/deactivate PHP extensions as follows :-
wampmanager -> PHP -> PHP Extensions -> click an extension
If the extension has a TICK then it is activated, if not then it is not activated. Each time you click on an extensions name, it will restart Apache to action the activation or deactivation of that extension, so give it a few seconds to complete this restart before checking it worked.
There is also a php.ini file in the \wamp\bin\php\php{version} folder, however this file is only used by the PHP CLI ( Command Line Interface ) so if you chnage this it will have no effect on the php used by Apache.

PHP- cURL enabled but sill not working

I am using joomla and using WAMP as my server and I am trying to add a twitter feed to my website but I get this error message
*"Your PHP doesn't have cURL extension enabled. Please contact your host and ask them to enable it."
I then go to my PHP extensions and enable curl and i still get the same message. I even went into the php.ini file and edited it in there but still no change. Any advice on this issue would be really appreciated. Thank you
WAMPServer has more than one php.ini file. One for the configuration to use with Apache and one to use with the configuration of PHP CLI ( Command line Interface )
You could use the easy method :
Use the wampmanager menus ( thats the icon that sits in the system tray ).
ledt click wampmanager icon -> PHP -> PHP Extensions
This will give you a menu containing all the extensions, make sure that php_curl has a tick mark beside it. If it does not then click that line in the menu and it will activate that extension. Give it a few seconds to process as it autonatically restarts Apache because that is necessary to activate a new extension.
Really could not be simpler.
Or you could edit the php.ini manually again using the wampmanager menus;
left click wampmanager -> PHP -> php.ini
This will launch notepad on the correct php.ini which is actually C:\wamp\bin\apache\apachex.y.z\bin\php.ini.
Maually remove the ; (semi colon) beside the php_curl extension, save the file, and then restart Apache.
Warning: this can introduce security issues that SSL is designed to protect against.
But a really simple fix that worked for me was to call:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
before calling:
curl_exec():
in the php file.
I believe that this disables all verification of SSL certificates.
Answer by #Chris Dutrow

MySQL and PHP not working together

I am actually ridicously stumped by this. I have downloaded php, MySQL and apache. Apache and php are working together, and it is wonderful. However whatever I do I cannot get php to work with MySQL. I'm using Windows 7 and PHP version 5.2.17 and Apache 2.2
I have gone into php.ini and uncommented out the lines extension=php_mysql.dll, extension=php_mysqli.dll and set the extention in Windows to this extension=msql.dll. I even changed the session path in php.ini to see if it would change anything. Spoiler Alert it didn't. I keep checking phpinfo() but the only information about MySQL and SQL that shows up is sql.safe_mode: off.
I cannot find any answers anywhere, well I have but all it tells me to do is uninstall and reinstall everything. Which I am trying to avoid at all costs. But if that is my only option, can you give suggestions about using WAMP and whether its easier than installing everything individually? Because I did not use WAMP and it took me forever to get this far.
Annabelle,
Are you editing the php.ini file directly or using the wampmanager menus to edit php.ini.
There are actually 2 php.ini files:
the one in c:\wamp\bin\php\php5.2.17 which is used for the PHP CLI environment ( Command Line Interface )
and the one in c:\wamp\bin\apache\apache2.2.x\bin\php.ini ( the one used by apache )
The reason for having 2 is a little complicated but if you ALWAYS use the wampmanager menu links to edit php.ini it will ensure ou always edit the one used by apache.
left click wampmanager icon in the system tray -> PHP -> php.ini
To check that the mysql and mysqli module are loaded go to localhost and from the wamp home page click on the phpinfo link. If the modules are loaded you should see them mentioned in the list of loaded modules in the CONFIGURATION section.

Configure PHP to work with MySQL and phpMyAdmin

My purpose is to setup a forum in php just locally on my Windows 7 machine to test how it works.
I have installed Apache HTTP Server and PHP v5 successfully. Then I downloaded and extracted the phpbb-forum software and put it in my root folder. Then I realized that I needed some kind of database so I downloaded and installed MySQL. To configure my database I also downloaded and extracted phpMyAdmin but I can't get it to work. When I open my browser and navigate to my phpMyAdmin-folder I simply get this:
Screenshot: http://img836.imageshack.us/img836/5139/captureqb.png
I use my Apache server to preview my website where I'm using some php include functions so I know that I've a "working" PHP installation. The MySQL service is also running on my computer.
However, do you need to configure PHP and/or Apache in order to get phpMyAdmin to work properly? I'm a complete noob on this so I suppose it may be multiple shortcomings.
Thank you.. //Realiserad
The simpler way is to install WAMP server : it bundle Apache, PHP, MySQL and PHPMyAdmin preconficurated for work together.
You need to enable the MySQL extension to use MySQL from PHP.
The MySQL extension may or may not be bundled with your PHP distribution. (look for php_mysql.dll in the ext folder)
Assuming it's installed you can enable it by adding or uncommenting this line in your php.ini:
extension=php_mysql.dll
As other people have said it may be simpler to install WAMP Server
Have a look at: http://www.ricocheting.com/how-to-install-on-windows/mysql - Specifically, the 3rd step. It involves downloading the mySQL PHP Extention (which is a dll), and un-commenting a line of php.ini so that PHP Load's the extension.
While is may be simpler to install XAMPP or WAMP, I think that it's good to know how to fix your own problems - Scientia potentia est :D
not very familiar with windows, but it seems like you miss the php-mysql extension, which you can download from here (i think):
http://mysql2.mirrors-r-us.net/downloads/connector/php/index.html
would be alot easier for you to use a preconfigured wamp install like this one (available for win/mac/etc). google "xampp", i'm not allowed to post more than one link due to stackoverflows spam protection.
Configure PHP to Access MySQL
Open the c:\php\php.ini file with your favorite text editor.
Uncomment the following lines by removing the semicolon:
extension=php_mysqli.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
save and exit editor
After extracting the archive into phpmyadmin folder, you will have to configure phpmyadmin before you can connect to sql server.
you should create a configuration file. This file can be created manually (simply use a text editor),
During your first session you will see an error message.
To solve this problem you should create folder (C:\project\wwwroot\phpmyadmin\config). After that give full rights for IIS_IUSRS group and IUSR user.granting permission/image
Return to the config window. Visit localhost/phpmyadmin/setup/
To configure the connection settings click on the “New Server” button.
Enter the verbose name of the SQL server, and then the server hostname. If necessary, you can specify other settings.[setting up/image][2]
Save the settings and then the server will redirect us to the previous page. Choose:
the default language – English
the default server – 127.0.0.1
end of the line – Windows (\ r \ n)
Click Save, and then download. The received file (config.inc.php) you should save to the root directory (C:\project\wwwroot\phpmyadmin).
Open the authorization window (//localhost/phpmyadmin/) and login under root account. If you see a starting phpMyAdmin window, you can delete config folder.
For the correct work phpMyAdmin requires a database with the information. The script for creating database is already installed.

Categories