I'm attempting to install the Propel ORM on CentOS which has a dependency for phing. I've run the following which was succesful:
pear channel-discover pear.phing.info
pear install phing/phing
pear install Log
However when I run ./propel-gen as is described on the Propel documentation it fails with the error:
./propel-gen: line 69: phing: command not found
However if I check to see if phing is installed it doesn't appear in the package list, yet if I try to install it again it fails:
$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.8 stable
Console_Getopt 1.3.1 stable
Log 1.12.7 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
$ pear install phing/phing
phing/phing is already installed and is the same as the released version 2.4.7.1 install failed
I need to be able to run ./propel-gen to test that Propel has been installed successfully, so I'm a little stuck at this point. I've also double checked that Pear is in the PHP include_path by running the following which exits bool(true):
<?php
require_once 'System.php';
var_dump(class_exists('System', false));
?>
Any help in debugging & fixing this is greatly appreciated! :)
You need to have pear's bin (executable) directory in your $PATH variable.
Find the path with
$ pear config-get bin_dir
Add this to your path that way:
$ export PATH=$PATH:/usr/share/php/bin
Related
I installed pear and found that I have the Structures_Graph directory inside pear directory -
/home/ec2-user/pear/tests
But, I cannot find the Structures/Graph.php and Structures/Graph/Node.php as mentioned in https://pear.php.net/package/Structures_Graph/docs/latest/li_Structures_Graph.html
I was following this article http://www.codediesel.com/algorithms/building-a-graph-data-structure-in-php/, following which installation of Structures_Graph has to be done with this -
pear install Structures_Graph
I get -
pear/Structures_Graph is already installed and is the same as the released version 1.1.1
install failed
I doubt that /home/ec2-user/pear/tests is your pear directory; you probably have a system-wide pear installation.
Get its location with
$ pear config-get php_dir
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?
I am trying to create a Pear package from my project on github that I have on my local repository, but I'm having alot of trouble getting pfm to work, here is the error I keep getting when I try to install:
Luciens-Macbook-Pro:quisbee-rails admin$ pear install PEAR_PackageFileManager_Cli
No releases available for package "pear.php.net/PEAR_PackageFileManager_Cli"
install failed
I am running on PHP 5.5.15 and pear 1.9.5.
If you look at your pear config settings you'll probably see that the preferred state of packages to download is "stable"
$ pear config-show | grep preferred_state
Or, to be more efficient:
$ pear config-get preferred_state
So to download and install a package that is not marked stable, your best option is to include the version number when you attempt to install it:
$ sudo pear install PEAR_PackageFileManager_Cli-0.4.0
This should work ok for you - assuming you already have all dependencies installed. If not, this is easy to do with the following by including the --alldeps option:
$ sudo pear install --alldeps PEAR_PackageFileManager_Cli-0.4.0
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
I'm trying to install PHPUnit. I'm getting an error message that I need to update the version of Pear, but then when I try to do it, it says Nothing to update.
Any ideas what's happening here?
UPDATE - this is the output on `pear list`
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Auth 1.6.4 stable
Auth_RADIUS 1.0.7 stable
Auth_SASL 1.0.4 stable
Benchmark 1.2.8 stable
Cache_Lite 1.7.9 stable
Console_CommandLine 1.1.3 stable
Console_Getopt 1.3.1 stable
Crypt_CHAP 1.5.0 stable
DB 1.7.13 stable
File_Passwd 1.1.7 stable
File_SMBPasswd 1.0.3 stable
HTML_Common 1.2.5 stable
HTML_QuickForm 3.2.12 stable
HTTP_Client 1.2.1 stable
HTTP_Request 1.4.4 stable
Log 1.12.6 stable
MDB 1.3.0 stable
MDB2 2.4.1 stable
Mail 1.2.0 stable
Mail_Mime 1.8.1 stable
Net_DIME 1.0.2 stable
Net_POP3 1.3.8 stable
Net_SMTP 1.5.2 stable
Net_Socket 1.0.10 stable
Net_URL 1.0.15 stable
Net_Vpopmaild 0.3.2 beta
PEAR 1.9.2 stable
Payment_DTA 1.4.1 stable
SOAP 0.12.0 beta
Structures_Graph 1.0.4 stable
XML_Parser 1.3.4 stable
XML_RPC2 1.0.8 stable
XML_Util 1.2.1 stable
I had the same problem and in my case it was because phpunit has a dependency of the pear.symfony.com channel. The following worked for me:
pear uninstall phpunit
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony.com
pear install phpunit/phpunit
Without the symfony channel, pear did only install in version 3.5.15. After adding the channel, i got 3.7.7.
First, clear the cache. Stale package information may be in there.
$ pear clear-cache
$ pear upgrade pear
Then, verify you get the correct remote package information - it should show 1.9.2:
$ pear remote-info pear
Latest 1.9.2
Installed 1.9.1
...
If the latest is not 1.9.2, you've got strange network problems. If the "installed" is listed as 1.9.2., your installation is strange :)
Verify that the PEAR version you are using is the same you are trying to upgrade:
$ which pear
/usr/bin/pear
$ pear list pear|grep bin
script /usr/bin/pear
script /usr/bin/peardev
script /usr/bin/pecl
If they do not match, fix your include path to include the correct pear version, or the pear configuration by using
$ pear config-show
$ pear config-get bin_dir
$ pear config-set bin_dir /path/to/my/bin
and force-upgrade to install the files to the correct locations:
$ pear upgrade -f pear