How to use Pear with xampp? - xampp

How do i include Pear's QuickForm into a php file if Pear is already installed in xampp?

I ran go-pear.bat from the command line, and it ran a setup program to configure my system for PEAR.
When it was finished I was left with some new folders and a pear.bat file. I tested it with "pear install -f Text_CAPTCHA" and everything seemed to work.

Related

Cannot install PEAR mail package XAMPP on Windows

From the cmd line:
C:\Users\Lemur>pear install --onlyreqdeps Mail
Did not download optional dependencies: pear/Net_SMTP, use --alldeps to download automatically
pear/Mail can optionally use package "pear/Net_SMTP" (version >= 1.4.1)
downloading Mail-1.3.0.tgz ...
Starting to download Mail-1.3.0.tgz (23,110 bytes)
........done: 23,110 bytes
ERROR: failed to mkdir C:\php\pear\tests\Mail\tests
I see a newly created Mail folder in xampp\php\pear\Mail, which is correct, but the folder has no contents.
Also, the Error shows that install is attempting to put something at C:\php\pear\tests\Mail\tests. There is no such directory C:\php\pear...
What is wrong? Include_path in php.ini is correct (C:\xampp\php\pear).
Thanks in advance.
Found the answer here: http://davehiren.blogspot.com/2011/04/how-to-install-or-uninstall-pear.html. I'm using XAMPP and didn't realize all the path variables that needed to be changed. Once I altered all the path variables, the Mail package installed just fine.
For working with PEAR using XAMPP in Windows, it's important to avoid the command line in Windows and instead use the XAMPP Shell. Simply open the XAMPP Control Panel and click on XAMPP Shell on the right:
In the XAMPP Shell, you can enter your PEAR package installation command as you normally would and the packages will get installed in their proper place within XAMPP's PHP directory:
pear install --onlyreqdeps Mail

Building XDebug For Use by MAMP?

I'm using MAMP on Mac OSX Mavericks. I'd like to install the latest XDebug, v2.2.4. Per the XDebug Wizard, I downloaded the XDebug 2.2.4 source. I have many versions of phpize installed on my system - one that is in /usr/bin/, and many others that come with MAMP. MAMP supplies the required phpize for each version of PHP it includes.
Seeking to use the correct phpize, per the XDebug Wizard instructions - http://xdebug.org/docs/faq#custom-phpize - I ran the phpize for PHP 5.5.3 via:
/Applications/MAMP/bin/php/php5.5.3/bin/phpize
..and got this output:
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.5.3/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Just in case this was not an error (since it appeared that I was following XDebug Wizard directions), I then ran configure via:
./configure --with-php-config=/Applications/MAMP/bin/php/php5.5.3/bin/php-config
...and I ran:
make
...but got this error:
fatal error: 'php.h' file not found
What is the correct way to build XDebug on OSX for use by MAMP?
Thanks very much in advance to all for any thoughts or info.
I had a similar issue and it was resolved after installing XCode and the Command Line Tools for XCode. I already had XCode installed, but I recently moved over to a new machine so I had to open it back up and it updated some things. Then I opened Terminal and ran the command...
xcode-select --install
That popped up a prompt to install the command line tools which I did and it resolved my issue.
Incase anyone else stumbles across this from Google...
My issue was the wrong phpize binary was found on the path.
I was able to resolve this using the Xdebug FAQ, specifically this section: https://xdebug.org/docs/faq#custom-phpize
When Xdebug wizard asks you to run phpize, instead find and run phpize in your MAMP directory. For me, this was:
/Applications/MAMP/bin/php/php7.1.19/bin/phpize
After this, you should see an output similar to your tailored installation instructions.
Then find and run php-config in your MAMP directory (Note: this command must be run from where you have Xdebug stored on your machine). For me, this was:
./configure --with-php-config=/Applications/MAMP/bin/php/php7.1.19/bin/php-config
You'll see a bunch of output... Followed by a, "Build complete." message.
Now you can return to your tailored installation instructions (be sure to skip the next step, Run: ./configure).
Try installing autoconf using brew : brew install autoconf

Installing PHP_codesniffer with Pear and MAMP Pro on OSX

I've tried all kinds of fixes to get php_codesniffer working with OSX and Pear and am having no luck. The installation works, the scripts are there, but when I run, for example, phpcs -h, nothing happens.
I am doing the following to install and try to run:
chris#DEATHSTAR:~$ pear clear-cache
reading directory /var/folders/r5/3s2lsmc10zj07nw56xbx1k1m0000gn/T//pear/cache
14 cache entries cleared
chris#DEATHSTAR:~$ pear install php_codesniffer
Unknown remote channel: pear.phpunit.de
Did not download optional dependencies: channel://pear.phpunit.de/PHP_Timer, use --alldeps to download automatically
pear/PHP_CodeSniffer can optionally use package "channel://pear.phpunit.de/PHP_Timer"
downloading PHP_CodeSniffer-1.4.6.tgz ...
Starting to download PHP_CodeSniffer-1.4.6.tgz (402,882 bytes)
.................................................................................done: 402,882 bytes
install ok: channel://pear.php.net/PHP_CodeSniffer-1.4.6
chris#DEATHSTAR:~$ which phpcs
/Applications/MAMP/bin/php/php5.4.10/bin/phpcs
chris#DEATHSTAR:~$ phpcs -h
chris#DEATHSTAR:~$
The PHP directory is correct in Pear config:
chris#DEATHSTAR:~/.vim$ pear config-show | grep php_bin
PHP CLI/CGI binary php_bin /Applications/MAMP/bin/php/php5.4.10/bin/php
Not sure what else I can do to troubleshoot?
Possible related note: PHP Mass Detector does essentially the same thing...it installs correctly, but running it seemingly does nothing as well!
I think the phpcs binary file is not inside your $PATH. Use the follow steps to figure out if this is true:
Call the codesniffer on your command line with entering the full path:
$ /Applications/MAMP/bin/php/php5.4.10/bin/phpcs -h
If you get the help output then proceed with step 2. If not something else is broken in your setup.
Export this path to $PATH:
$ export PATH=$PATH:/Applications/MAMP/bin/php/php5.4.10/bin/phpcs
Call the CodeSniffer like you try before:
$ phpcs -h
To make this change permanent you need to insert the command from 2. into you .profile/.bashrc/.zshrc or whatever you use as a shell

guard-laravel reports "phpunit is not installed on your machine"

I'm using Jeffrey Way's wonderful Laravel-Guard on a Laravel 4 project I'm building, and for the most part, it seems to be working as intended, except for when I try to get the phpunit part working.
Upon running guard, and editing a file, I get this in the console:
19:49:53 - ERROR - phpunit is not installed on your machine.
I've tried two things to make this work, first I tried installing phpunit via composer, then I tried installing it via PEAR - neither worked.
I'm running Debian 7.
Can anyone help? Thank you.
What error message do you get?
See this question on installing php-unit via composer. Notice the path to phpunit. You may want to alias that to phpunit command works anywhere.
Alternatively, you may need/want to install it globally. I've had luck installing it via a package manager. edit: You may have already tried this method :/
$ sudo apt-get install php-pear # The same on Debian ??
$ sudo pear upgrade PEAR
$ sudo pear config-set auto_discover 1
$ sudo pear install pear.phpunit.de/PHPUnit
Note: May need PEAR dependencies, see here: http://www.giocc.com/installing-phpunit-on-ubuntu-11-04-natty-narwhal.html
I don't know about Laravel-Guard specifically, but I found the easiest way to install phpunit without needing to do anything with PEAR was to do a stand-alone composer-based install.
I created a directory /opt/phpunit (because I couldn't think of anywhere better to put it), and then created the file /opt/phpunit/composer.json:
{
"require": {
"phpunit/phpunit": "3.7.*"
},
"config": {
"bin-dir": "/usr/local/bin/"
}
}
You may need to adjust the bin-dir setting to match somewhere on your path. This is critical - otherwise anything looking for phpunit will not be able to find it.
Then you can just run composer install - it will download phpunit for you and put a symlink to the launch script in /usr/local/bin,
dev1:~$ which phpunit
/usr/local/bin/phpunit
Where (on my machine) /usr/local/bin/phpunit becomes a symlink to /opt/phpunit/vendor/phpunit/phpunit/composer/bin/phpunit
... and it just works. Of course, you will need to manually update occasionally using composer update to get the latest phpunit code.
I got these instructions from here: Chapter 3. Installing PHPUnit

PEAR included with MAMP: how to access via Terminal?

I'm trying to run a command that downloads a bit of software using PEAR installed with MAMP.
Here's the command I run in Terminal:
pear channel-discover pear.phpdoc.org
The Terminal responds with:
-bash: pear: command not found
Could someone please advise how to access PEAR that comes pre-installed with MAMP?
Path to MAMP on my Mac is /Applications/MAMP/
I do not use mamp but i think you can find the pear here:
/Applications/MAMP/bin/php5.3/bin/pear
you can simply add some alias to make it shorter, something like
alias mamppear="/Applications/MAMP/bin/php5.3/bin/pear"

Resources