Netbeans integration with Mac OS X native PHP, PEAR PHPUnit config - php

I am trying to integrate Netbeans 6.9 or 7 into my development environment (Mac OS X 10.6.7 native PHP no stacks) but no matter what I try I am not getting Netbeans to recognize my PHP interpreter (/usr/bin/php) or my PHPUnit script (/usr/local/bin/phpunit).
Anybody got some less than obvious ideas, although I may have missed one of those. I have exhausted search terms on the web trying to find someone who went through the same problems but nothing has come of it.
EDIT
Well for the past day I have been using phpunit --version to verify my phpunit version (3.5.13) and pear list to verify my PEAR 1.9.2 install. Well I just discovered the pear list-all which shows phpunit as 1.3.2. Upon entering pear upgrade phpunit/PHPUnit the response I get is Nothing to upgrade
This may explain the PHPUnit script problem since apparently there are 2 versions of PHPUnit installed and the one I am trying to point to must not be tied into PEAR.
which php /usr/bin/php
which pear /usr/local/bin/pear
which phpunit /usr/local/bin/phpunit
Any ideas? Thanks

Wrong phpunit versions
$ pear list-all
shows the packages from the default channel, which is "pear.php.net" unless you configured it otherwise. You did install phpunit from pear.phpunit.de, which is a different channel.
PHPUnit previously (version 1) was hosted on pear.php.net but moved to its own channel.
Running
$ pear list-all -c pear.phpunit.de
shows phpunit 3.5.13.
$ pear install phpunit/phpunit
is actually the same as
$ pear install pear.phpunit.de/phpunit
because phpunit is the short name/alias for the pear.phpunit.de channel.
Two phpunits installed
You probably do not have two phpunit versions installed. "list-all" lists all available packages on a channel, not only local/installed ones.

Well I finally gave up on netbeans and went over to PhpStorm 2. I am not having any problems there and it does what I need. cweiske I apprecaite the info provided as that was of great help for things I did not realize.

Related

Installing PEAR + PHPUnit under WINGINX

I need PHPUnit and according to their GitHub page I need to use PEAR to install it.
Problem is, PEAR is not installed by default on WINGINX nor does my PHP folder have a go-pear.bat file as mentioned here: http://pear.php.net/manual/en/installation.getting.php.
So, how do I install PEAR / PHPUnit on WINGINX??
Using Apache is not an option since I need to learn to work with NGINX.
There's little to none documentation on this due WINGINX was released only a few months ago.
This tutorial does also not work since WINGINX does NOT support .htaccess
I have found a solution!!
Since no documentation about this exists yet, and other people might come across this issue as well, I'll explain here how to fix this:
Download the go-pear.phar file and place it in the C:\Winginx\php5\ directory
Open up a terminal and navigate to C:\Winginx\php5\
Type: php go-pear.phar and press enter
Follow the instructions on your screen
Restart NGINX
Open a terminal as Administrator
Run these 2 commands:
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
Done! You successfully installed PHPUnit
winginx is pretty new. I am not sure if pear support is inbuilt into it as of now. You might want to check with Alexei Shabalin, the author of winginx.
Meanwhile this forum seems to find Alexei saying that pear support is currently not there.
http://translate.google.com/translate?sl=auto&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fforum.winginx.ru%2Fdiscussion%2F35%2Fpear-i-xml-rpc%2Fp1&act=url

Fatal error with - pear install pear.phpunit.de/PHPUnit

I followed this post but it did not help
I am executing following shell commands on a Remote CI system (Fedora) to install php tools:
wget http://pear.php.net/go-pear.phar
php go-pear.phar
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
On execution of php unit command I encounter following exception -
pear install pear.phpunit.de/PHPUnit
PHP Fatal error: Call to undefined method PEAR::raiseErro() in /usr/share/pear/PEAR/REST.php on line 165
PHP Stack trace:
PHP 1. {main}() /usr/share/pear/pearcmd.php:0
PHP 2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
PHP 3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
PHP 4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661
PHP 5. PEAR_Downloader_Package->initialize() /usr/share/pear/PEAR/Downloader.php:279
PHP 6. PEAR_Downloader_Package->_fromString() /usr/share/pear/PEAR/Downloader/Package.php:190
PHP 7. PEAR_Downloader->_getPackageDownloadUrl() /usr/share/pear/PEAR/Downloader/Package.php:1713
PHP 8. PEAR_REST_13->getDownloadURL() /usr/share/pear/PEAR/Downloader.php:850
PHP 9. PEAR_REST->retrieveData() /usr/share/pear/PEAR/REST/13.php:68
Finished: FAILURE
Are there any more commands I need to add?
You need to update your PEAR. Here is a bug report showing the same error http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619307 and the solution is to get the updated PEAR version.
What the pear installer is trying to tell you is that there was an error when trying to install the package.
It fails because the pear version that is used is buggy :/
Yes you installed the "current/right" pear package from the php site with the commands shown so that leaves three options:
a) Some permission issue with access to /tmp/ or some other pear config-show folder that doesn't get properly reported.
Maybe throwing in a sudo might help if you can do that?
b) You still have another pear version running alongside or you didn't install pear system-wide or something related to that issue.
Try to run pear upgrade pear and see if that helps. pear version should produce 1.9.4.
c) It's failing because it can't connect to the server it wants to pull the files from and it then fails trying to report the error.
Maybe run wget pear.phpunit.de just to see if that works to check or if your firewall blocks that.
Those are the only two options I currently see to solve your issue with pear without more debugging. Should that not suffice you can find help on freenodeIrc in #phpunit or in the stackoverflow php chat.
All php-qa-tools can be run from a git checkout but it is, usually, considerably(!) more hassle to get that to run.

How to uninstall PEAR from one installation of PHP and then install it with another existing PHP installation

I have two installations of php on my server. One version of php is 5.2.0 configured with pear, and the other is 5.2.9 configured --without-pear. My server is running Red Hat Enterprise Linux AS release 4 (Nahant Update 9).
I would like to uninstall pear (and also PHPUnit) from php 5.2.0, and then reinstall it as part of the 5.2.9 version of php. The pear installation docs don't really cover this type of a situation, although they do tell Linux users to "consult the documentation for the respective distribution" in the event that they want to install pear with a version of php that was configured --without-pear. I am having trouble finding such documentation, and even if I did, I am not sure how to remove the existing pear installation first.
Here is a partial answer to my own question: After trial and error, I discovered that you can uninstall pear by running this command:
$ sudo pear uninstall pear
I would like to see this added to the official pear docs, since they don't mention uninstalling pear at all.
Use the Command Help
pear help
You'll see the uninstall command listed in the output. :)
Output
Commands:
build Build an Extension From C Source
bundle Unpacks a Pecl Package
channel-add Add a Channel
...
uninstall Un-install Package
...

Need procedure to install PEAR (over old version) with go-pear.phar on redhat, centos with php5.3

I'm on CentOS and
So far I've been reading about go-pear and go-pear.phar since my PEAR seems to have gotten behind enough that it can't be upgraded with command: > pear upgrade PEAR
OK, reviews on go-pear.phar seem good, and maybe working with packages and signatures is a necessity. Running on faith here, and forging ahead, I wonder...
Should I remove all of the previous PEAR packages, and if so what is the best way
( hmmmm 'rm' comes to mind )
I'm actually not trying to be an pioneer here; Looking for someone who has done this ( In a controlled manner, and With a Positive Outcome ) ie: I don't want to botch my Server Box.
What else will I need to know about locations (/usr/share) and php.ini file configuration.
I'm open to PEAR install tips, with .phar and want to learn more about it.
Suggestions and pointers welcome. TIA (thanks in advance)
This problem should be solved with RHEL in order to be solved in CentOS, here is the bug report about that problem:
PHP53 Lacks php53-pear
Install the older php-pear via yum install php-pear and than run the following commands:
pear upgrade --force Console_Getopt
pear upgrade --force pear
pear upgrade-all
(It seems that these commands will solve the issue, it worked for labradort from the linked bug report and it worked for me)

Installing PEAR

phpinfo() function shows that my PHP version (5.1.6) is installed --without-pear in the configure command section.
How do I install pear?
The Getting and installing the PEAR package manager page should help you : it gives informations on how to install the PEAR package manager, on both windows, Linux, and Mac.
Basically, if your Linux distribution comes with a PEAP package, you should install it.
For instance, on Ubuntu1, there is a php-pear package ; so, you'd use :
apt-get install php-pear
Else, if it doesn't, with a version of PHP >= 5.3, you should be able to use this :
$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar
With PHP 5.1, though, this is not going to work, as phar support has been added in PHP 5.3...
As a sidenote : PHP 5.1 is really outdated !
PHP 5.3 is more than one year and a half old ; even PHP 5.2 is not maintained anymore... maybe you should consider upgrading ?
1It seems you are running some kind of Redhat-based distribution, but I don't have one of those, so I cannot say if there is a PEAR package for it -- there is probably one, though.
--without-pear only means that the PEAR bits were not immediately created when PHP was compiled.
This usually happens when an operating system vendor that provides packages and wants to split off bits and pieces into their own individually installable parts.
Given the age of the PHP you're talking about, you're probably on RHEL or a derivative like CentOS. Check the package manager for a php-pear package.

Categories