pecl installs to directory other than ext_dir - php

I have been plugging away, trying to install the pecl_http extension (it is a dependency for a library I am going to use). I am having an issue where the extension is being installed in the wrong directory.
I am working on an Apple MacBook Air, with OSX 10.8.5. I have the php that comes with OSX, and I have installed a more recent version (5.4.27) via Homebrew. I have configured my path to include the copy of php I installed via Homebrew.
My pecl configuration, and my php configuration, list the following as the extension_dir (ext_dir):
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20100525
However, the output from the pecl install pecl_install command tells me that the extension has been installed in the following location:
/usr/lib/php/extensions/no-debug-non-zts-20090626
I have included the following output for reference:
Build process completed successfully
Installing '/usr/include/php/ext/http/php_http.h'
Installing '/usr/include/php/ext/http/php_http_api.h'
Installing '/usr/include/php/ext/http/php_http_buffer.h'
Installing '/usr/include/php/ext/http/php_http_client.h'
Installing '/usr/include/php/ext/http/php_http_client_request.h'
Installing '/usr/include/php/ext/http/php_http_client_response.h'
Installing '/usr/include/php/ext/http/php_http_cookie.h'
Installing '/usr/include/php/ext/http/php_http_curl.h'
Installing '/usr/include/php/ext/http/php_http_encoding.h'
Installing '/usr/include/php/ext/http/php_http_env.h'
Installing '/usr/include/php/ext/http/php_http_env_request.h'
Installing '/usr/include/php/ext/http/php_http_env_response.h'
Installing '/usr/include/php/ext/http/php_http_etag.h'
Installing '/usr/include/php/ext/http/php_http_exception.h'
Installing '/usr/include/php/ext/http/php_http_filter.h'
Installing '/usr/include/php/ext/http/php_http_header.h'
Installing '/usr/include/php/ext/http/php_http_header_parser.h'
Installing '/usr/include/php/ext/http/php_http_info.h'
Installing '/usr/include/php/ext/http/php_http_message.h'
Installing '/usr/include/php/ext/http/php_http_message_body.h'
Installing '/usr/include/php/ext/http/php_http_message_parser.h'
Installing '/usr/include/php/ext/http/php_http_misc.h'
Installing '/usr/include/php/ext/http/php_http_negotiate.h'
Installing '/usr/include/php/ext/http/php_http_object.h'
Installing '/usr/include/php/ext/http/php_http_options.h'
Installing '/usr/include/php/ext/http/php_http_params.h'
Installing '/usr/include/php/ext/http/php_http_querystring.h'
Installing '/usr/include/php/ext/http/php_http_strlist.h'
Installing '/usr/include/php/ext/http/php_http_url.h'
Installing '/usr/include/php/ext/http/php_http_version.h'
Installing '/usr/lib/php/extensions/no-debug-non-zts-20090626/http.so'
Additionally, I have configured pecl to use the php.ini file which is associated with the php I installed via Homebrew.
My questions are:
What would cause pecl to install in this directory (which I have not configured it to), and what can I do to solve this problem?

PEAR not using ext_dir is a bug; http://pear.php.net/bugs/bug.php?id=18666

Related

Composer package maatwebsite/excel requires Libzip4, but it's installed

So I'm working on a project solo, and I wanted to export table data into CSV.
So I went with this composer package:
composer require maatwebsite/excel
The terminal outputs this:
phpoffice/phpspreadsheet 1.9.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
So I searched around for answers including here and I tried the following:
I followed the answer provided
here.
I tried installing libzip4, I get this:
libzip4 is already the newest version (1.1.2-1.1pop2).
I tried installing libzip5 for which I got:
libzip5 is already the newest version (1.5.1-0ubuntu1).
So I tried installing php7.3-zip package: for which I get this:
php7.3-zip : Depends: libzip4 (>= 1.3.2) but 1.1.2-1.1pop2 is to be installed
Which is wierd and I'm stuck!
Simply installing doing sudo apt-get install php-zip gives me this error:
php-zip : Depends: php7.3-zip but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
What should I do guys? I have Pop OS and i haven't faced any PHP 7.3 related issues so far.
One of the solutions you can do is delete the composer.lock file and then do a composer install and composer update.

How to install the OpenCensus extension with PECL on PHP

Following the instructions (here: https://github.com/census-instrumentation/opencensus-php) I am unable to install the OpenCensus extension for PHP using PECL.
I have tried installing other PECL extensions, which worked fine.
I have also tried doing this from a VPN.
The install steps I tried are:
Install the opencensus/opencensus package using composer:
$ composer require opencensus/opencensus:~0.2
IMPORTANT: Please ensure your version is >= 0.2.0. There is a potential security vulnerability in < 0.2.0.
Install the opencensus extension from PECL:
$ pecl install opencensus-alpha
The error I get is:
No releases available for package "pecl.php.net/opencensus" install failed"
See also: https://prnt.sc/nnt5er

How to install FFMPEG to Ubuntu 14.04 from Github using Composer?

Recently i installed composer and Ratchet. Everything worked fine but now i need to install FFMPEG through Github. Json and Lock files were already been created and i just upgraded it. I have FFMPEG in .lock file and in JSON file (as it was told). So now, when i'm running
./composer.phar install
it is not installing and telling me
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
What is wrong with this installer?

Why don't I see my installed PEAR package in pear list?

I've installed PHP 5.6 on my El Capitan OSX with brew install php56 --with-pear. This installs PHP in /usr/local/Cellar/php56/5.6.18
with a symlink from /usr/local/opt/php56 to there. Seems to work fine.
OK, I need to install the Cache_Lite package, so I do pear install Cache_Lite. PEAR goes through its installation steps without complaint:
downloading Cache_Lite-1.7.16.tgz ...
Starting to download Cache_Lite-1.7.16.tgz (33,236 bytes)
.........done: 33,236 bytes
install ok: channel://pear.php.net/Cache_Lite-1.7.16
But when I do pear list Cache_Lite is nowhere to be seen:
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.4.0 stable
Console_Getopt 1.4.1 stable
PEAR 1.10.1 stable
Structures_Graph 1.1.1 stable
XML_Util 1.3.0 stable
When I check the php56 folder in Finder, I see there is a Cache folder there with the Cache_Lite files. And when I add the folder to my PHP pages with ini_set("include_path", '/usr/local/opt/php56/lib/php:' . ini_get("include_path") ); my PHP page in the browser stops complaining it can't find Cache_Lite.
PEAR, Why don't you list Cache_Lite when you've installed Cache_Lite? Am I misunderstanding pear list?

Getting strange error while installing AWS SDK via PEAR

I am getting this error while installing AWS SDK via PEAR. I never got this before.
$ sudo pear channel-discover pear.amazonwebservices.com
Adding Channel "pear.amazonwebservices.com" succeeded
Discovery of channel "pear.amazonwebservices.com" succeeded
$ sudo pear install aws/sdk
Unknown remote channel: guzzlephp.org/pear
aws/sdk requires package "channel://guzzlephp.org/pear/Guzzle" (version >= 3.0.2)
No valid packages found
install failed
Can somebody give me a hand.
Taken from here:
https://github.com/aws/aws-sdk-php/blob/master/README.md#installing-via-pear
Installing via PEAR
PEAR, which stands for PHP Extension and Application Repository, is a framework and distribution system for reusable PHP components. It is the PHP equivalent of other package management solutions like Yum that install packages system-wide.
PEAR packages are easy to install, and are available in your PHP environment path so that they are accessible to any PHP project. PEAR packages are not specific to your project, but rather to the machine they're installed on.
From the command-line, you can install the SDK with PEAR as follows. Note: You may need to use sudo for the following command.
pear -D auto_discover=1 install pear.amazonwebservices.com/sdk
Once the SDK has been installed via PEAR, you can load the phar into your project with:
require 'AWSSDKforPHP/aws.phar';
Had the same problem, but this fixed it:
Install the old package first
sudo pear -D auto_discover=1 install pear.amazonwebservices.com/sdk-1.6.0
Then update it
sudo pear install pear.amazonwebservices.com/sdk
To check:
ubuntu#ip-xx-xx-xx:~$ sudo pear install aws/sdk
aws/sdk is already installed and is the same as the released version 2.4.0
Try this before installing the SDK:
sudo pear install --alldeps --force guzzle/guzzle
well I ended up installing the old package (I didn't need the new stuff such as glacier etc)
pear install aws/sdk-1.5.17.1

Categories