Unable to find the socket transport "ssl" pecl packages are unreachable - php

I'm trying to use pecl, but everytime I got this error message. I don't have xampp. I don't have any apache, I'm using only the built in php server. So I don't have xampp directory, it's only C:\php for me. Now I edited the php.ini file, I removed the semicolon from the extension openssl, but it's still erroring. Do I have to download any OpenSSL directory? I tried, but it's only a git repository, what needs a lot of other applications to run... I don't know if I really need to download Embarcadero C++, and MinGV? That seems too complicated to me... I wanted to use some packages, like php memcache, and oci, but for that I had to install pear (it was NOT included in php), then install pecl, then I have to install these C++ apps, and MinGV to run OpenSSL to be able to download pecl packages? No way...
Windows 10 64x
PHP 8.0.12

Have you tried to install OpenSSL windows client?
Please install OpenSSL and set php.ini by
OPENSSL_CONF=LOCATION_OF_SSL_INSTALL\bin\openssl.cfg

Related

Install PHP 7.0 Internationalization extension (Intl) on XAMPP on Mac

I followed the instructions outlined here:
Install PHP Internationalization extension (Intl) on XAMPP on Mac
Ran sudo pecl install intl
selected the correct files from the Cellar
then this error happened:
/private/tmp/pear/temp/intl/intl_error.h:24:10: fatal error:
'ext/standard/php_smart_str.h' file not found
include
^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed
No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart_string.h
So given my scant knowledge of C++ I copied smart_string.h to smart_str.h and renamed all the headers from STRING to string.....
re-ran pecl -no luck....more errors......without knowing where the .c files are and remaking php (not really interested in going that far) since anyway I'm using XAMPP so that ended that option.
I have php 5.5 on my mac, deep in the usr/local/bin folder
so next step was to get pecl to use those files and generate an intl.so file....
Did that....I have the intl.so file so put it in the 'extensions' folder in XAMPP (for reference: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012)
Ran php and came up with this error:
Warning: PHP Startup: Unable to load dynamic library
'/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so'
- dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so,
9): Symbol not found: _zval_used_for_init Referenced from:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
Expected in: flat namespace in
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so
in Unknown on line 0
I imagine it has to do with different versions?
In any case I can't get pecl to install intl without a make error in PHP 7.0.8 on XAMPP. There is no documentation on this and you'd think that if you deprecate a header.h file you'd update all extensions?
Install intl.so in PHP 7 seems impossible?
After a lot of research I was finally able to resolve this. Detailed steps here:
before you begin, check which php path is set. it should be /Applications/XAMPP/xamppfiles/bin/php. If not you can change it by PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}". more detail here
Overall idea is to build the intl-extension from PHP source code on your own. Before you begin make sure you have installed Xcode. Also, install the latest version of autoconf. this might help:
brew install autoconf
Next download the version of PHP you use in XAMPP from php.net. I am using 7.1.18. This version worked for me: php-7.1.31, I’m guessing if you follow the steps it might work for 7.0 or 7.2 as well. Do let me know if it does or doesnt, I’ll update this post. Do not use PHP 7.3 for Magento 2.3.0, it is not supported.
Extract the tar.gz file using (I extracted it inside ~/Downloads/ folder )
tar -xzvf php-7.1.31.tar.gz
cd into the extracted folder
cd php-7.1.31
change to subfolder ext/intl
cd ext/intl/
Run these commands to build the extension
/Applications/XAMPP/bin/phpize
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/
make
sudo make install
you can now delete all files you downloaded and also the extracted folders.
Open /Applications/XAMPP/xamppfiles/etc/php.ini , and add extension=intl.so
Restart your Apache using XAMPP GUI and it should work.
So far, it seems that extension intl.so for php is bundled with php
and should be compiled with php (intl --enabled). XAMPP does not support this (as of Oct 2016), MAMP does. I do not know about other distros. However, if you're willing to recompile PHP 7, it's worth it just to do that and enable it during compiling.
So....I ran with MAMP. Then I decided that I would simply install apache 2.4 and php 7 and Mysql without the stack and the junk that comes with MAMP or XAMPP and everything works like a charm... so if you need to use CakePHP or intl support etc... just drop XAMPP/MAMP and go with a standard install. I used homebrew (MacOS) and everything is working fine.
Update: As regards Windows, XAMPP does not default it, but you can add the module (dll) in php.ini and works like a charm
The error means that XAMPP doesn't have PHP compiled with intl. You may try:
pecl install intl
but probably it won't work as well.
See: PHP Bug #72879 Pecl install intl make error with PHP 7.0.8.
As for the workaround, try installing memcached extension instead of memcache, e.g.
pecl install memcached
Note: It also requires libmemcached package/library to be installed beforehand. For macOS, install via: brew install libmemcached.
If you wanna try without homebrew, with native apache and php, look at my aswer here: https://stackoverflow.com/a/55131868/3692846

Couldnt find class memcached

I have been trying to install memcached on an ubuntu server and I followed a lot of tutorials over the internet. I am using 32-bit ubuntu 12.04, php version 5.4.7, xampp server 1.8.1 which are all 32-bit versions. In the end, I followed the tutorial in the below link and I installed all the things listed with no error.
http://stevelove.org/2009/09/30/how-to-install-php-memcached-on-an-ubuntu-server/
The only problem I have is that when I installed memcached using "sudo pecl install memcached" command, the extension couldn't be added to php.ini file. Then I used phpinfo() to learn which php.ini file I am using and added extension=memcached.so to the ini file. When I restarted xampp server, php.ini file doesn't work and it tries to download the pages. In the php error log, I get this error.
[30-May-2013 16:42:48 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcache.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
Since I couldn't enable the extension, even though memcached is listed as installed with php -m command, I get Class memcached not found error when I try to execute my php code.
Can someone please help me with this issue?
Maybe because you installed the server but not the extension, try
sudo apt-get install php5-memcached
ps: memcache != memcached
Firstly, thank you for your answer Mohammad. I know that memcache is not memcached and as I said, when I list modules, memcached seems installed (not memcache) but when I use phpinfo(), memcached is not listed.
It turns out that even though I installed memcached, problem was xampp installation. I removed lampp and php5 installed in ubuntu and purged everything I installed. Then I installed xampp with development packages and re-installed libmemcached etc. It works fine now.
If there is anybody having similar problem, I can explain in detail.

Memcache PHP Extension on Windows

I have found plenty of tutorials covering how to install memcache in Windows and install the PHP extension. My situation though is slightly unusual:
I'm using iis, not apache.
I don't need to install memcache on the server (it has its own dedicated server already setup). I ONLY need to install the extension.
I thought I simply needed to add the PHP_memcache.dll extension to the PHP extension folder and add it to PHP.ini
This causes an error loading the PHP module (unable to load dynamic library).
Is this error likely to be caused because memcache isn't installed on the server and what can I do to solve it?
Errors while loading extensions in Windows are not as helpful as they are in Linux, so you need a tool like dependency walker to fish out the problem.
http://www.dependencywalker.com/
If you are using XAMPP on Windows you probably have installed the 32bit-XAMPP version.
So make sure you are using the 32bit (x86) DLL of Memcache.
The DLL download List for windows can be found here: http://pecl.php.net/package/memcache/3.0.8/windows

PECL install failed

after upgrading from PHP5.2.6 to php 5.3. it seams, I also have to reinstall the PHP memcache-module.
So I downloaded the newest version of memcache (3.0.6) and followed this documentation:
http://www.php.net/manual/en/install.pecl.pear.php
pecl install memcache
Which results in the following error-message:
No releases available for package "pecl.php.net/memcache"
install failed
what's going on here? By the way: the server is not connected to the Internet, but that shouldn't be a problem, right?!
To answer my own question an for rising the intellectual horizon of #OZ_ and #martswite
an offline-installation of an pecl extension works like the following way:
1.) download the extension from http://pecl.php.net/packages.php
2.) there you get an .tgz file
3.) install the file:
pear install memcache-3.0.6.tgz
PECL modules are (by default, and most of the time) downloaded from a non-local repository.
Therefore you will need some form of internet connection to download it.
Alternatively you can upload the pecl package from your machine to a location on the servers local file system and install it from there, or compile from source.
To me this error was caused due to php without support for ssl.
Enable openssl or recompile with openssl built int.
Check php support in a Linux host run
php -i | grep openssl
Should print a line with openssl if support enabled.

OAuth PHP for Windows?

I'm running XAMPP on windows and trying to install Oauth into PHP. I already tried running "pecl install oauth" but it gave me error. i don't have a compiler to compile the OAuth 1.10 into .dll, and really don't have the time to learn how to compile it.
the link for the pecl package is here: http://pecl.php.net/package/oauth/1.1.0
EDIT after running 'pecl install oauth' the error i get is this:
WARNING: php_bin C:\XAMPP\xampp\php\php.exe appears to have a suffix \php.exe,
but config variable php_suffix does not match.
ERROR: The DSP oauth.dsp does not exist.
thanks!
This is usually do to incompatibility between the oAuth version and PHP. You can get the latest oAuth library precompiled from the windows.php.net site:
http://windows.php.net/downloads/pecl/releases/oauth/
Also don't forget to add the extension to your php.ini and restart Apache afterwards.
Install APC on Windows:
PECL is used for downloading and
compiling extensions, but Windows
machines generally don't have what is
required to compile these, instead try
looking for and downloading a
pre-compiled .dll.

Categories