travis CI pear PHP dependency doesn't get installed - php

I've got a Python project at github, which I test on travis-ci.org. There is a small client in PHP that I use for testing it (it should be a cross-language tool).
Recently I changed the username in my github repo, committed it and it triggered the travis build. It failed, because of a PHP/pear error:
The command "sudo pear channel-discover pear.phpunit.de" failed and exited with 1 during .
You can see the build matrix below:
https://travis-ci.org/ducin/pycached/builds/65778230
https://travis-ci.org/ducin/pycached/jobs/65778231
https://travis-ci.org/ducin/pycached/jobs/65778232
The previous commit was submitted and tested on travis last year and everything was ok, the pear channel-discover command worked. I changed nothing but the github username, which is not a problem for sure, so I expect that certain service became unavailable since then.
Please point me out what is wrong with my build and how can I make it work again.

http://pear.phpunit.de has been closed down in favour of using phar files or installing phpunit via composer. You should uninstall the PEAR version of phpunit and install it from another source.
https://thephp.cc/news/2015/01/phpunit-migration-from-pear-to-phar

Related

propel not working in windows

I was testing using Propel for web application development, but bumping into some obstacles in the very installation of Propel.
As exposed in their documentation (http://propelorm.org/documentation/01-installation.html), I don't think any method other than Composer will work in sucessfully installing Propel. I tried with Github, but the result was an error when checking the validity of the installation: Could not open input file: propel
So I focused on Composer, and the same error when following Propel documentation commands $ php composer.phar install Could not open input file: composer.phar
Well, turns out that their documentation don't expose the correct syntax to run Composer with Windows CMD. Also Composer documentation doesn't expose that, neither (or I just couldn't find that).
So I deleted previous propel files, and tried just composer install, with composer.json file set up, of course.
And it worked fine!
Hopes this helps someone struggling with this.

Codeigniter Sparks with 3.0 Sparks_Path Error

I am fairly new to Codeigniter (last 6 months) and just recently started learning about sparks and how to use them. I followed Option 1 for installing Sparks here from getsparks.org and I received the Spark Manager has been installed successfully message. I then went to install my first spark found here and received this message: Spark installed to ./sparks/GoogleAPIClient/0.6.0 - You're on fire!
Upon trying to load my application I first had an error of EXT constant being undefined. After reading some threads it was suggested I add define('EXT', '.php'); to the application/config/constants.php file so I did. Now when I try to access it I get an Error has occurred message with this:
Cannot find spark path at sparks/sparks/0.0.9/
I verified the setup was installed correctly for both the manager and my spark. I read that adding APPPATH . 'sparks/' to the SPARKPATH constant would solve it (it didn't) and then trying '../sparks/' and that didn't. What am I missing?
Using Codeigniter 3.0
Usually with codeigniter4, spark comes along with bundle however you can still try the following commands on terminal (codeigniter4 or older versions still works). I ran these commands on mac osx sierra 10.12 with php 8 and codeigniter3. Go to terminal and try command :
$ php -r "$(curl -fsSL http://getsparks.org/go-sparks)"
it should give below output on terminal-
"Pulling down spark manager from
http://getsparks.org/static/install/spark-manager-0.0.9.zip ...
Pulling down Loader class core extension from
http://getsparks.org/static/install/MY_Loader.php.txt ...
Extracting zip package ...
Cleaning up ...
Spark Manager has been installed successfully!"
you can then use below command to verify if everything works.
php tools/spark help
it should return some text and description and some commands.

How do I use terminal to install plugins and libraries for PHP (MAMP)?

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

Where is PHPUnit?

Resolved!
I uninstalled phpunit from pear and then reinstalled it again. I believe I was using the wrong/old/not enough sources before installing. Works like a charm!
So I'm trying to set up PEAR & PHPUnit. I was following http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard but after I installed pear I had a different directory structure in /usr/local. Regardless, I was able run the phpunit install. But now I'm lost and asking for help before I make a bigger mess :)
pear config-show says:
PEAR directory php_dir /usr/local/share/pear
And my php.ini file (and confirmed in phpinfo() says:
include_path=".:/usr/local/share/pear"
So that's good, right? But now what? I get
Failed opening required 'PHPUnit/Framework.php' (include_path='.:/usr/local/share/pear')
If I try to include it in the php. And I have no idea where the binary might be to run it from the command line.
Inside /usr/local/share/pear/PHPUnit there are two directories "Extensions" and "Framework"
It sometimes happen that the install fails on PHPUnit specifically, but succeeds on the dependencies, so it only looks like the install was succesfull.
Try this when installing
pear install --force --alldeps phpunit/PHPUnit
The --force option will force the install of PHPUnit, even if all the dependencies can't be met. In my case there was a missing dependency for the dom PHP extension which blocked the installation even though the PHP_Invoker package could be used instead.
The --alldeps option makes sure that all of the dependencies got installed.
Check for a bin directory in the pear install, something along the lines of /usr/local/share/pear/bin/ - your install is different than mine..
You could also try searching for the binary -
find /usr/local/share/pear -name 'phpunit'

PEAR/Digg2: PHP/Linux Installation Issue

I have a VPS running a VPS optimized Debian distro.
I am very new to utilizing a VPS and have next to zero Linux background.
A little background to help:
I went through and apt-get install pear which went through fine.
I attempted to install the dependent services for the Digg api as such:
pear install HTTP_Request2
This provided an error, I had to install it with:
pear install HTTP_Request2-alpha
Then I attempted:
pear install HTTP_OAuth
This provided the same error as above, I installed it eventually with:
pear install HTTP_OAuth-alpha
So I then successfully installed Digg2 with pear install Services_Digg2
Okay, background over. My issue is that it will not initiate the class as it says the file is not there. The PHP is as simple as this:
require_once 'Services/Digg2.php';
$api = new Services_Digg2;
I checked my include path as per the error in PHP:
Fatal error: require_once() [function.require]:
Failed opening required 'Services/Digg2.php' (include_path='/usr/share/php')
in /var/www/redacted1/data/www/redacted2/index.php on line 3
So I verified that the file was there in Terminal:
http://snapplr.com/tk9r
And I verified that the include path was proper via PHP_Info():
http://snapplr.com/dwk7 (sorry I can only post one hyperlink as I'm new)
The error remains.
Hopefully my lengthy intro isn't a hassle and actually helps.
Any incite?
Thanks
Jeff
To install a PEAR/PECL package that is in a state other than "stable", you have to specify the full spec for the package:
pear install Services_Digg2-alpha #alpha state
pecl install ssh2-0.11.2 #beta state
PEAR also takes care of dependencies (usually, but I can confirm in that specific case that it does). You don't have to manually install them.
Now that you have it installed, it should work like you did:
include_once 'Services/Digg2.php'
However, I'm a little concerned that your code shows include_once while the error message you have shows you are using require_once. This leads me to believe that the code you posted is not the actual code.

Categories