composer: You must enable the openssl extension to download files via https - php

I know this question has been answered in other threads, but having the same problem and not finding the solution for my case in the given answers, I found a different solution for my case and that took me a while to find out, and since I can't reply to those other questions because I have only 1 reputation point, I post it as a new question.
The problem in my case was, that the "extension_dir" setting in my php.ini was wrong, because originally I had installed PHP in a different directory and then moved it manually.
So, if you checked your php.ini and found openssl enabled and still got that error, you may want to also check extension_dir in php.ini, if it points to where you expect it, and if the directory actually contains the openssl module.

check extension_dir in php.ini, can become incorrect after moving a PHP installation to a different folder.

Did you installed your php from source?
If so, did you configured it with
./configure --with-config-file-path=/etc/php5/cli --with-openssl
Note about --with-openssl
Once done, it should work.
PS: Do not forget to make && make install

Related

Editing php.ini is not causing any effect

I tried everything, but I can't make it work. I recently installed MAMP. The PRO version came with an option to add OAuth via a checkbox, but now that the PRO version expired I need to install it by hand.
When I check phpinfo() on my browser it says that the path to my php.ini file is:
/Applications/MAMP/bin/php/php7.1.0/conf/php.ini
Also, there is (none) under additional ini files. So I am pretty sure that is the correct php.ini file
The problem is that after adding the OAuth extension to the ini file, and restarting MAMP, PHP still can't find OAuth.
Also strange is that I don't see any of the other enabled extensions (like mcrypt) in the phpinfo() output.
Any tip in the right direction will be appreciated,
Thanks!
After much debugging, this is what I did in order to figure out the problem and solve it.
As suggested in the comments of my question, once I checked the http logs I found out that PHP was not finding the extensions.
I checked php.ini for extension_dir and it was pointing to a different path than the one that pecl was installing packages on.
If you need to find that path, simply use:
pear config-get php_dir
After correcting that everything works fine.

Extensions shown in phpinfo() don't match with those enabled in loaded php.ini

I use EnterpriseDB ApachePHP on Windows XP (32 bit). I tried to enable some extensions in php.ini in the directory with ApachePHP, but nothing changed. Then I found that phpinfo() not just doesn't show the extensions I uncommented in php.ini, but it also shows others that I didn't uncomment. I have several other php.ini files on my computer, but phpinfo() shows the correct path to the php.ini file as "Loaded Configuration File" (D:\Programy\EDB_Apache\php\php.ini - that the path to the php.ini file I use; plus it shows its copy in C:\WINDOWS in "Configuration File (php.ini) Path").
The configuration must be overriden by something in ApachePHP - pgsql and pdo_pgsql are among the commented but shown libraries, while all my other php.ini instances have only MySQL and SQLite enabled. On the other hand, even the extensions contained in D:\Programy\EDB_Apache\php\Sdk\include\ext (D:\Programy\EDB_Apache is ApachePHP root) don't match those shown in phpinfo(), so it might be even more difficult.
So how to find and edit the configuration that is shown in my phpinfo(), or how to solve the bug causing it not to correspond to the loaded php.ini file? Please don't tell me to restart Apache or my computer (I configure localhost), I did this many times, even just before asking this question.
EDIT: Once again, I'm absolutely sure the path shown in phpinfo() as "Loaded Configuration File" matches to the path of the php.ini file I use. Even if the path shown there was not correct (which would be a matter of a question - how is it possible, and how to correct it?), no one of php.ini files on my computer matches the configuration shown by phpinfo. I have searched for any instance of php.ini, so I'm sure I didn't miss any of them, even if it was a hidden/system file.
EDIT2: reinstall of EDB ApachePHP didn't help. I changed the paths slightly during the reinstall, so I updated paths here. "Loaded Configuration File" path still matches the right configuration file, and I keep restarting Apache after every change.
I looked closer to phpinfo(), especially to "Configure Command":
cscript /nologo configure.js "--enable-cli" "--enable-cgi"
"--with-openssl" "--enable-pdo"
"--with-extra-includes=C:\pgBuild32\include;D:\pginstaller_2.auto-repo\output\include;D:\pginstaller_2.auto-repo\apache.staging\include"
"--with-extra-libs=C:\pgBuild32\lib;D:\pginstaller_2.auto-repo\output\lib;D:\pginstaller_2.auto-repo\apache.staging\lib" "--enable-apache2filter" "--enable-apache2-2filter"
"--enable-apache2handler" "--enable-apache2-4handler"
"--with-apache-hooks" "--with-pgsql" "--with-pdo-pgsql"
"--with-prefix=D:\pginstaller_2.auto-repo\php.staging"
"--enable-one-shot" "--enable-cli-win32" "--enable-embed"
"--enable-isapi" "--enable-ftp" "--without-mysqlnd"
"--with-xsl=SHARED" "--enable-mbstring" "--enable-mbregex"
"--enable-shmop" "--enable-exif" "--enable-soap" "--enable-sockets"
"--with-gd=SHARED" "--without-mysql" "--without-mysqli"
"--without-sqlite3" "--without-pdo-mysql" "--without-pdo-sqlite"
Paths listed there (C:\\pgBuild32\include, D:\\pginstaller_2.auto-repo\output\lib etc.) don't exist on my computer. Their existence seems to confirm my assumption that parts of the setting are overwritten by some EnterpriseDB default (or that configuration in php.ini somehow doesn't work, so the defaults are applied). I don't know where are these settings saved - that's the point of this question, if I knew, I would change them and celebrate.
There is another possible cause of the problem: lack of dll's. Most php distributions have them in ./ext. In EnterpriseDB "php" directory has only one subdirectory, and it is named "Sdk"; the extensions are (or should be; there are no dll files in that dir) in D:\Programy\EDB_Apache\php\Sdk\include\ext directory. This directory contains only .h files (in directories named after the extensions), no dll. If this is not the ordinary architecture for EnterpriseDB bundle, please tell me; I might have a bad installer file.
So I first copied the dll's from another php installation (I didn't manage to get exactly those for PHP 5.4.23, but they are 5.4 too) into the extension folder, but nothing changed. Then I even copied whole ext folder to php directory in the ApachePHP bundle location and changed the extension path to it - again, no change.
For testing reasons, I tried to run php.exe. It returned a warning:
PHP Warning: PHP Startup: gd: Unable to initialize module
Module compiled with build ID=API2010025,TS,VC9
PHP compiled with build ID=API2010025,TS,VC10
These options need to match
in Unknown on line 0
So if I want to substitute dll's, I need to find either VC9 ApachePHP (will it still support PostgreSQL 9.3? My main reason for all this is to be able to created forms for my database), or VC10 PHP 5.4. I didn't find any .msi installer for PHP 5.4 (even less VC10 one) and after some bad experiences with software installation through command line on Windows I don't want to try non-msi version without being sure that this is the only choice.
Any advice now?

Loading PHP Extensions using Plesk

I am trying to load the php_memcache.dll extension using the Plesk Additional Directives section under the PHP Settings for a domain, subscription or subdomain. No matter what I do, I cannot get Plesk to load the extension!
The only way I can load the extension into PHP is by manually editing the php.ini, which is a dirty fix as I will need to edit this each time the server is updated as the php.ini gets overwritten each time!
The php_memcache.dll is definitely in the extensions directory referenced in the phpinfo(), this is proven by the fact that I can load the extension successfully by entering it into the php.ini manually.
I am pretty confident this is a bug, but just wanted to see if anybody else has had any similar issues?
The bug seems to be the description implying that it is possible when it really is not.
In this page: http://download1.parallels.com/Plesk/PP11/11.5/Doc/en-US/online/plesk-administrator-guide/index.htm?fileName=69696.htm it says that additional directives can take any setting that is listed as PHP_INI_USER and PHP_INI_ALL in this page: http://php.net/manual/en/ini.list.php.
In that page extension is listed as php.ini only, so it will not work from the additional directives option.

Weird ungrammatical PHP error msg when trying to set upload folder

I've been getting this error, verbatim:
// PHP setup Edit php.ini (try /usr/local/php5/lib/php.ini search for "tmp" and make sure file uploads are, and that you have a tmp director of that name, with permissions set. To load the new php.ini, restart apache: apachectl restart
What's weird about this, besides the grammatical flaws, is that I get it no matter what I set upload_tmp_dir to in php.ini...or even if I remove php.ini entirely.
I do an apachectl restart after each change. I've also tried rebooting.
I believe I'm editing the right php.ini, because it's the one listed when I do a phpinfo(): /usr/local/php5/lib/php.ini. It lists whatever upload directory I edit into it.
This happens under Mac Lion with both Chrome and Firefox
phpinfo tells me I'm running PHP Version 5.4.6
I am the opposite of an expert.
Thanks for whatever help you can give me. I am preparing to D'oh slap myself.
It was indeed a comment in a buried file. Aaarrrggghh! Thanks to do those who offered suggestions. I am equally grateful and embarrassed.

XAMPP and cURL not working, after uncommenting php.ini

Someone else with the same problem still didn't get a decent answer/fix for my problem:
Before you comment or criticize, please make sure you read my proceedures below so as not to repeat what I've seen 100x already in Google and Stack Overflow...
XAMPP (Lite) installed on Windows 7 in C:\xampplite (newest version, only one php.ini file in C:\xampplite\php)
XAMPP and PHP scripts run correctly in http://localhost/
libcurl installed (by XAMPP default) in C:\xampplite\php\ext\php_curl.dll
php.ini edited and saved for removal of ; at beginning of line extension=php_curl.dll
php.ini default for extension_dir = "C:\xampplite\php\ext" correct and left alone
Apache service restarted in Windows Services
Computer restarted
Apache service (manually) restarted again
phpinfo(); still does not display anything with the word "curl" in it
Still no success
Thanks in advance.
I had the exact same problem but could not find the solution online.
Every site I saw said to uncomment "extension=php_curl.dll" which didn't fix the problem.
I finally solved it by adding the path to curl.dll to the variable.
That is, I changed: extension=php_curl.dll
to:
extension="F:/WebServer/PHP/ext/php_curl.dll"
Hope this helps you or somebody else.
I had a similar problem except for error reporting. Searched all over the internet and all I found was "modify the php.ini file". I modified all the php.ini files but I was still getting the same error. Turns out WAMP has visual settings which I believe overwrite the php.ini. So to turn on curl, you'd left click on XAMPP icon in your start start menu -> PHP -> PHP Settings -> php_curl (make sure it is checked).
Maybe this is your problem.
Hope it helps.
-c0d3
Try executing curl
xampp/apache/bin/curl.exe
with admin privileges.
Restarting the PHP server will do.

Categories