Installing PEAR + PHPUnit under WINGINX - php

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

Related

How do I uninstall PHP CodeSniffer on Mac OSX (10.11.6)?

I used Pear to install PHP CodeSniffer, and something went terribly wrong. It seems like most of the files weren't copied over. Perhaps I should have installed it with root privileges. It doesn't work, it's a mess, and I want to uninstall it and reinstall it, but I don't know how to uninstall it and I can't find any information about this. The Pear script is long and complicated. I tried:
pear uninstall PHP_CodeSniffer-3.2.3
It says that it's not installed.
But when I try to reinstall over the existing installation, it says I can't because it's already installed.
I found the answer. I'm posting it despite the -1 score I got for my question - up from -2. I'm sure I'm not the only one who had this problem, and it took hours of searching to find the solution. I'm not a pear expert. I only just installed it to use PHP_CodeSniffer.
The pear uninstall command didn't work because the cache needed to be cleared. These commands worked, when logged in as root. I then reinstalled as root.
pear clear-cache
pear uninstall PHP_CodeSniffer

How do I solve this PHP-PEAR error / install PEAR on Fedora?

I'm trying to save an old, failing web-server setup consisting of Fedora, PHP, PEAR, and Oracle.
With some difficulty (I'm very new to all four), I've been able to set up something similar on a newer system. I used Fedora 19, PHP 5.5.4 (with Apache 2.4.6), and Oracle 11g.
That just leaves PEAR.
Now, from what I understand, PEAR is some PHP code, like a library, which PHP Web Applications can use to save time from having to code them again - database connection, for example.
But I don't know what to do with it, or even how to get it. Copy paste from my old system? Download using the CLI using yum? Are there packages I need to be aware of, or is it just a one download-one install thing?
For instance, a basic PHP webpage with the following code:
<?php
phpinfo();
?>
works fine on the new server setup, so I'm assured that everything else is working. But when I try to load the PHP files from the other server, it returns an Internal Server Error. I checked the error_log files under /etc/httpd/logs, and most of the errors appear as below:
PHP Fatal error: require_once(): Failed opening required 'MDB2.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/hrweb/includes/functions.php on line 4
EDIT:
According to the PEAR Website, PEAR is included upon the installation of PHP, though not all modules / packages are there. Typing in the command pear in the CLI does confirm it is installed, though it does not help the issue.
I got the MDB2 package via pear install MDB2, though apparently, MDB2_Driver_oci8 is required. Whenever I try to download that, I get the following:
"MDB2_Driver_oci8" version "1.4.1" does not have REST XML available
In addition to this, I also tried to download OLE, which gets me the following:
No releases available for package "pear.php.net/OLE"
This was also previously the error of trying to download MDB2_Driver_oci8.
Thanks.
You have to install the (surprise!) MDB2 package to get MDB2.php:
$ pear install mdb2
and the adapter of your choice:
$ pear install mdb2_driver_mysql-beta
Then make sure the PEAR php directory is in your include path - see the PEAR manual.
"MDB2_Driver_oci8" version "1.4.1" does not have REST XML available
try to install the beta version:
$ pear install mdb2_driver_oci8-beta
No releases available for package "pear.php.net/OLE"
You're trying to install the stable version, but OLE does not have any stable version (yet): http://pear.php.net/package/OLE/download
Append either -alpha or -beta after OLE:
$ pear install OLE-beta

how to set develop environment for zend framework 1.11.11 in netbeans 7.1.1 using wamp?

hey guys I need your help for setting environment for zendframe work ? I have installed my netbeans in D: drive under D:/program files/netbeans. and the zend framework is under D: drive. and my wamp package is installed under c:/wamp. now what i need is to configure these all for my development?
I searched google, stackoverflow and every blog i could for the whole day. but all that I got is a error given below.
'"php.exe"' is not recognized as an internal or external command,
operable program or batch file.
tell me how can I solve this ? what should I do ? Do I need to set all these under one roof or I need to upgrade my PHP version ???
Yes My config is written below.
WAMP Server 2.0c with PHP 5.2.6, MySQL 5.0.51b, Apache 2.2.8.
Netbeans 7.1.1 and Zend framework 1.11.11
Add php.exe to your environment variable PATH. If you add the directory where php.exe is installed to your PATH environment variable (you may need to log out for it to take effect), it should work.
See this tutorial
You may actually specify the path to PHP interpreter within Netbeans, in Options - PHP - General tab.
Perhaps you should set up the include_path as well to make Zend modules (at least autoloading one) recognizable.
Update to a more up-to-date version of PHP first.
Then, ensure that PHP is on your environment PATH variable. You can look up on google how to do that.
You'll have to install phpunit too after you get that setup. WAMP might come with it but I doubt it. Usually this is easy if you have pear. You can get the pear commands from the phpunit site.
If you don't have pear you'll have to install that. Download a 'go-pear.phar' file that is appropriate to you. You usually install it by running php go-pear.phar' and then you can use pear it install phpunit.
You can then call it a day OR you can continue setting up Netbeans to automatically use phpunit.
If you don't setup netbeans then you'll have to just use phpunit on the command line.
After the pear phpunit install just run phpunit on the command line and you should get some sort of 'help' output.
Edit : Step by step details.
I'm going to assume you have xdebug, php, netbeans installed from your comments. It seems like your only issue is installing phpunit.
Here goes.
Open up a command prompt
Open a browser window.
In your browser go to http://pear.php.net/go-pear
Save the text file that comes up into the directory php is installed in.
Go to the php directory php is installed in via the cd command on the terminal.
Type in the command php go-pear.phar
Follow the installation instructions for pear and pick the options that make the most sense. I just install everything in the php directory so php and pear live in the same place.
After pear is installed type in the following commands ( from the phpunit install website : http://www.phpunit.de/manual/current/en/installation.html ) You might have to use sudo here, if you're on windows maybe not.
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
9 Run phpunit -h on the command line and you should get some help message. If you're on windows you might have to open up a new command line prompt before you try this.

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)

Pear SOAP and XAMPP on Ubuntu

All,
I have installed xampp for linux on ubuntu 9.10. The installation directory is /opt/lampp. The xampp website says PEAR comes with the installation.. I am relatively new to PEAR and want to know the answers for following:
Is PEAR installed with xampp or need to be installed separately using synaptic package manager? I browse to /opt/lampp/bin directory and see "pear" there, but when i type it in the command line, it says
"The program 'pear' is currently not installed. You can install it by typing:
sudo apt-get install php-pear
pear: command not found
"
I want to use PEAR:SOAP package in my PHP code. How to use that? Do I need to set any paths to the pear in my php.ini?
Thanks
I figured it out.. xampp comes with pear... So, what I did was..
cd /opt/lampp/bin
sudo ./pear install soap
In PHP code, "require_once("SOAP/Client.php");
That's all !! :)
from what I was able to ascertain from my coleagues, you would need to populate pear to be able to use it.
It does come with the installation, but requires the population to be used.
source for code
First, go to your xampp installation
directory/folder and navigate to the
php directory. For me it’s
x:\xamplite\php
x:
cd \xampplite\php
pear install <package-name>
once this is done pear should be available to be used. And as for the second question. XAMPP should have taken care of any settings that were needed. You should not require any additions into the .ini for it to work.
However remember that there are no secuiritis when programming in this fashion, as stated by the XAMPP website.
EDIT**
also you have Pear Ubuntu install guide link that may help.
The error message you got back should be enough. Apparently the pear program isn't in your path. How did you install XAMPP? Did you use the package manager, or did you install it yourself?
If you used the package manager, then this is the correct next step:
sudo apt-get install php-pear
As you were given in the command help. Ubuntu doesn't install a lot of things by default, but it does install a database of stuff you might type, and what package you need to install to get that command to work.
If you installed it yourself, then you need to figure out how to get PEAR to register as being installed.

Categories