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
Related
I'm trying to open the index_dev.php file for a site on my Wampserver and I'm getting this error:
Internal Server Error - PHP Warning - Configure the "curl.cainfo", "openssl.cafile" or "openssl.capath" php.ini setting to enable the CurlHttpClient
I tried to do some research on how to enable curl on WAMP, but all of the info I was seeing was for PHP 5.x
As far as configuring, I don't have a clue what I should do to the "curl.cainfo", "openssl.cafile" or "openssl.capath" settings in my php.ini files.
Thanks in advance for your help!
Go to https://curl.se/docs/caextract.html and download the latest .pem file.
Copy the .pem file to ..... well I put mine in C:\wamp64\bin\php called cacert.pem
This contains a whole bunch of certificates and because the file is created by Mozilla we sort of trust it.
Now using the WAMPManager, edit your current php.ini file by
left click wampmanager -> PHP -> php.ini
Find this parameter, it will be commented out with a ;
;openssl.cafile=
Change it to
openssl.cafile="c:/wamp64/bin/php/cacert.pem"
Save the edit, and then restart Apache to activate the change
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.
I have a php file that i want to pars something from wiki.
The code is:
file_get_contents("https://en.wikipedia.org/w/api.php?format=json&action=parse");
I constantly get the error:
file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?
By searchin google I finde a lot of commets telling "you have to activate or uncoment openssl_extension in wamp."
This is clearly activated:
SEE Screenshot that proofs this is activated
Can someone help me to get rid of this error?
Create a file called phpinfo.php and put this in it:
<?php phpinfo(); ?>
and then browse to that file. You'll see a big list of all your php settings and installed modules. Look for the openssl module and check that it's enabled. If it's not, you need to keep tweaking your WAMP environment until you can see that the module is appearing. Normally when changing Apache/php settings you need to restart Apache for the changes to be taken into account, so you may need restart your WAMP server.
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.
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.