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.
Related
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.
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
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
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.
I just recently setup a fresh install of PHP, Mysql and Apache on my Windows 2003 server. Php is working fine and my Navicat MySQL browser can connect to my tables. However no matter what I do. MySQL doesn't show in phpInfo() even though I have the extensions in my ext folder. I installed PHP via the windows binary installer. Any idea what I'm missing? I'm pretty new to PHP is this is the first time I've tried to setup my own server I'm sure I'm missing something simple. Thanks.
--- EDIT ---
So as suggested by Alan Geleynse I added the extension to my php.ini, now Apache crashes every time I try to enable php_mysql.dll any ideas on this one? I may just restart my php from scratch if this is any more trouble.
You probably need to enable the extension in your php.ini
Search through php.ini for extension and you should see a list, some of which will be commented out. If you remove the comment for MySQL, it should load the extension.
If you do not see it, you should be able to add this line to your php.ini. Make sure that the dll listed is the one you want and is located in your extension directory.
extension=mysql.dll
Seems the issue was not only a missing php_mysql.dll but I was also missing libmysql.dll The installer still borked the install of the extension files though. Oh well it happens thanks to everyone for the help.
Probably apache crashes because of missing dll. There is probably a directory 'ext' in your php installation dir. Check whether there is a 'php_mysql.dll' file in it.
Also, check for directive 'extension_dir' in your php.ini, it must point to the location of extensions directory. For example, I have php installed in 'C:\php' and 'C:\php\ext' folder in it. My php.ini contains line:
extension_dir = "C:/php/ext"
I just fixed this problem on my computer by copying libMysql.dll from the MySql server directory to c:/windows/system32/, just a few minutes ago.