I have problems with pecl (ubuntu 20 / xampp 8.0.1), when trying to install something I get the following message:
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading apcu-5.1.19.tgz ...
Starting to download apcu-5.1.19.tgz (96,583 bytes)
.....................done: 96,583 bytes
ERROR: failed to mkdir /opt/lampp/lib/php/test/apcu/tests
When i try the suggested channel update command I get:
could not create lock file
When trying to do pecl upgrade-all I get
pear.php.net is using a unsupported protocol - This should never happen.
Unfortunately I couldn't find anything helpful yet. I'd really appreciate any suggestions how to solve this problem.
You do not have the permissions: You must run a command like this:
sudo pecl channel-update pecl.php.net
Related
I have an issue with connecting php(valet) and MongoDB. I tried to install MongoDB with pecl and command sudo pecl install mongodb and brew install mongodb and all time I get some errors during the install process:
In file included from /private/tmp/pear/temp/mongodb/src/MongoDB/Cursor.c:18: /opt/homebrew/Cellar/php#8.0/8.0.17/include/php/ext/spl/spl_iterators.h:151:4: error: unknown type name 'pcre_cache_entry' pcre_cache_entry *pce; ^ 1 error generated. make: *** [src/MongoDB/Cursor.lo] Error 1 ERROR: make' failed`.
But when I run mongo --version I get:
and I install MongoDB Compass and as you can see, I can connect to the database and write into it:
But when I try out to install laravel package jenssegers/mongodb I get these errors: I tried with --ignore-platform-req=ext-mongodb flag but then it install package but it didn't work, I get this error: Error: Class "MongoDB\Driver\Manager" not found.
Finally, I find out a great package that helps me in this! This repo saves me a ton of time and debugging! Thank you shivammathur!
Hey I also had the same problem. A good alternative is to also follow with this article if you want to stick with pecl https://freek.dev/2151-fixing-the-dreaded-pcre2h-file-not-found-error-when-installing-imagick
I have a Dockerfile that when used with my docker-compose commands works fine, I'd like to have this docker container built however as GRPC takes 15 mins to install every time I want to run tests in GitHub Actions
This is what my Dockerfile currently looks like:
FROM xxx-base:6
RUN pecl install grpc \
&& docker-php-ext-enable grpc \
WORKDIR /application
And I get the following error output:
#5 580.4 g++: fatal error: Killed signal terminated program cc1plus
#5 580.4 compilation terminated.
#5 580.4 make: *** [Makefile:248: src/core/ext/filters/client_channel/lb_policy/xds/cds.lo] Error 1
#5 580.5 ERROR: `make' failed
------
executor failed running [/bin/sh -c sudo pecl install grpc && docker-php-ext-enable grpc WORKDIR /application]: exit code: 1
It's worth mentioning in the base container used here I used pecl to install imagik so I know that command at least partially works. This is a base PHP 7.4 container.
Any suggestions, I've seen some other posts referring to the memory limit on the docker build, but I'm not sure what to change
Pastebin full stacktrace: pastebin.com/g7iZ2uRn
Installing GRPC in a pipeline takes a long time.
I recommend using the cache of the provider used (bitbucket, github etc ..) or using a base image which is used as the starting point of the Dockerfile
FROM baseimage:latest
I have implemented an image based on alpine and php 7.4 with extension grpc installed, check it on github gits click here
In case gcc –version says anything less than 4.9 ...this might be the cause.
This answer also seems to be related to your scenario... in case PECL fails.
I'm trying to install PhpDocumentor 2, and after following the steps for the installation through PEAR, I get the following message:
PEAR_Config::writeConfigFile fopen('C:\Windows\pear.ini','w') failed
(fopen(C:\Windows\pear.ini): failed to open stream: Permission denied)
So I checked the pear configuarion: $ pear config-show and see that things are all over the place. Any idea on how to correct this?
Also, the pear.ini file is nowhere to be found.
You cannot fix the pear.ini-in-c:\windows problem unfortunately.
A solution is to run the terminal as administrator, and run the pear install command in it.
If you want to modify the locations, use pear config-set key value.
I tried to install zend framework 2 on Ubuntu 12.04.1 64 bit but have run into difficulties.
# sudo pyrus install zf2/Zend_Framework-beta#Standard
failed mid transaction with no other previous errors that I can recall other than warnings about timezone not being set. ( Unfortuantely my terminal history has lost the original output)
Pyrus\Installer\Exception: Installation failed
Pyrus\AtomicFileTransaction\MultiException: ERROR: commit failed
Pyrus\IOException: CRITICAL - unable to complete transaction, rename of actual to backup path failed
Pyrus\AtomicFileTransaction\RuntimeException: Cannot rollback - not in a transaction
Now when I try to rerun
# sudo pyrus install -f zf2/Zend_Framework-beta#Standard
it fails with
Pyrus\Registry\Exception: Cannot retrieve package file object for package packages.zendframework.com/zend_framework, it is not installed
Uninstall just tells me that it's not installed.
I restored /usr/share/.old-php to /usr/share/php however I still get the same error.
Please help.
You can just try to download and unzip Zend Framework 2 archive into your project's library folder.
It looks like it's a problem with the metapackage according the Matthew. I'm having the same problem.
Error Installing full framework with Pyrus
So if I installed pyrus here: "/usr/share/pear/pyrus" , then should I create a directory "/usr/share/pear/pyrus/zf2" and download and unzip the full Zend Framework in zf2 and it should work?
thanks
Can you walk me through the installation of a library for php, specifically what each terminal command does?
I have been learning web development for 6 months and it is time I need the console / terminal. I can't find any beginner walkthrough of using the terminal to add libraries and plugins to PHP. There are a lot of tutorials for specific steps or errors, but none start to finish.
If you want specifics to make your example concrete, here is what I am trying to install:
The library I am installing: http://code.google.com/p/phpquery/.
My directory for PHP on MAMP: /Applications/MAMP/bin/php/php5.3.6/bin
Thanks!
Don
edit:
I figured out my specific issue, but I don't think I really understand what I did, so I can't repeat it by myself in any other situation. This thread can help a lot of new terminal users including myself. The type of response I am looking for would go like this:
Step 1: Open your terminal. (This is an alternative way to navigate and execute commands on files on your computer).
Step 2: Find out where MAMP is installed however you like. Then go to your terminal, and type in cd followed by the path. cd stands for current directory and tells your terminal where it should execute its commands. The command you use will be very similar to this cd /Applications/MAMP. This will make your current directory MAMP.
Step 3: You are adding a library to PHP. So you need to go to the PHP folder in MAMP.... (please help us from this part!)
I just checked and it is available in pear channels.
# this is from their site
pear channel-discover phpquery-pear.appspot.com
pear install phpquery/phpQuery
Of course, for Mac using MAMP, you would use commands like this:
/Applications/MAMP/bin/php5/bin/pear install [package]
So for PHPQuery, try this:
/Applications/MAMP/bin/php5/bin/pear channel-discover phpquery-pear.appspot.com
/Applications/MAMP/bin/php5/bin/pear install phpquery/phpQuery
Same method should apply to pecl extensions as well.
EDIT
I personally just installed it on mine to test, here were my results:
$ /Applications/MAMP/bin/php5/bin/pear channel-discover phpquery-pear.appspot.com
Adding Channel "phpquery-pear.appspot.com" succeeded
Discovery of channel "phpquery-pear.appspot.com" succeeded
$ /Applications/MAMP/bin/php5/bin/pear install phpquery/phpQuery
downloading phpQuery-0.9.5.386-pear.tgz ...
Starting to download phpQuery-0.9.5.386-pear.tgz (100,990 bytes)
......................done: 100,990 bytes
install ok: channel://phpquery-pear.appspot.com/phpQuery-0.9.5.386
This should work with any PEAR or PECL extension. Check out this page for a list of PEAR packages.
EDIT 2
Make sure /Applications/MAMP/bin/php5/lib/php is in your include path! That is where phpQuery.php will be located once you've downloaded the PEAR packages properly with MAMP.
EDIT 3
Per cshu's comment, he mentioned that these packages are no longer maintained and that you should use this instead:
$ /Applications/MAMP/bin/php5/bin/pear channel-discover pear.querypath.org
$ /Applications/MAMP/bin/php5/bin/pear install querypath/QueryPath