Install PEAR on project local? - php

How to install pear on project local?
Only install system global (and copy manually to project local) ?

The Answers #greg0ire provided (+1) should work out.
If you are using PHP 5.3 you can also look into "the next version of the pear installer" pyrus.
It can make it easier mainting different configurations

See this page of the manual : Installation of a local PEAR copy on a shared host

Related

System or local when installing PEAR for PHPUnit

I am using XAMPP 1.8.1.
I need to write code with PHPUnit.
When I try to install PEAR using command prompt, I get the message below:
Are you installing a system-wide PEAR or a local copy?
Could some one suggest which option I should use?
Thanks in advance.
PEAR is usually installed system-wide. The benefit of this is that the various packages can be reused between different projects.
One reason why you might install a local copy of PEAR is that the administrator[s] of the server you are installing on might be reluctant to install additional packages or upgrade existing ones.
By performing a local install of PEAR you can choose the location of where the PEAR installer places the packages/PEAR code that you install.
So, another reason for installing local, even multiple, copies of PEAR is to have separate installs for each project you might be working on, though using Composer in this scenario is much more common place.
Naturally if you do install a local copy of PEAR then you will need to adjust your include-path accordingly.

Cannot Install PEAR folder inside PHP version 5.3

I have an IIS7 server installed as Remote where I have installed php, everything is working fine but inside my php folder PEAR folder is not present, because of that I cannot receive a mail through smtp, Also after doing lot of googling which said to install pear i require gp-pear.php file which is not available inside my php folder, now how can I install Pear in my IIS7 server?
Follow the installation instructions as they are listed in the PEAR manual:
http://pear.php.net/manual/en/installation.getting.php

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

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.

Installing PEAR on PHP 5?

I want to install PEAR on PHP 5, so I can use Spreadsheet_Excel_Writer.
I don`t know how to install it on my ISP nor my personal MacBook.
Thoughts for both?
The PEAR Manual has a quite extensive list of instructions on how to install the PEAR manager on Windows, *NIX and Mac OS X. The manual also has a section on installing PEAR remotely, for example using FTP. Following those instructions, you should be able to install PEAR (nearly) anywhere. :)
From the command line, do this:
pear install Spreadsheet_Excel_Writer
You can also download the package directly here without using PEAR: http://download.pear.php.net/package/Spreadsheet_Excel_Writer-0.9.1.tgz. It's pretty easy to use if you have the script located anywhere within your include path.
For your personal computer, using the "pear" script that ships with most PHP distributions is a good idea.
For shared hosting, you can
Track your dependencies manually, and copy all the appropriate files to the server yourself
With pear installed, do "pear install -R/my/root_dir -a Spreadsheet_Excel_Writer". This will install the package and all dependencies to the specified root directory. Copy this installation to your webhost.
You should also have a look at "pear help" and "pear help install".
You can't install pear to your isp's core. But you can install the individual files from pear's site and upload them to your host:
http://pear.php.net/package/Spreadsheet_Excel_Writer/download

Categories