PEAR location on install? - php

I'm trying to install PEAR, but I'm confused by the locations suggested.
I'm using Wampserver to run my PHP scripts, and I wanted to do unit tests. So I found PEAR.
I tried installing via the go-pear.bat file, but that didn't work.
I found out more about this here: http://blog.pear.php.net/2009/07/01/php-53-windows-and-pear/
So I downloaded the php file. The comments in the file suggest I
Put go-pear.php on your webserver,
where you would put your website
I find this a little strange. Still, I put it in the folder along with the other php files. Here's what I was presented with:
Maybe it is because I'm not very experienced with this, but I would initially believe I should put PEAR in a central location, using 1 pear install for all possible future projects.
Or is this the prefered configuration? And why?

Using a central location is the standard approach - it sometimes makes sense to have individual installs though, particularly if a speficic project requires older versions of some pear packages and would break if newer versions were installed.

Here's a pretty straightforward tutorial on how to set up PEAR on Wamp.
http://trac.symfony-project.org/wiki/HowToInstallPearOnWindowsWithWamp
You may have missed a few steps like adding PEAR to the PATH for Windows.
Also if you have a lot of problems with WAMPServer (I used to) there are alternatives like Zend Server Community Edition. http://www.zend.com/en/products/server-ce/index

Related

Defeated trying to install mongodb PHP extension on MAMP

I've done all the things suggested by other answers to this question (or at least I think I have), but I'm still completely stuck.
The specific problem going on at the moment is that the compiler can't find zend_config.h. I have PHP 5.5.10, which came with my out-of-the-box MAMP install. My first attempts were failing because the compiler couldn't find php.h. It seems that I need the PHP source code in order to build the mongo driver. A surprise to me (perhaps I'm too much of a n00b), but ok.
Unfortunately, I could not find the source for 5.5.10, only 5.5.14. Who knows whether that's what I really need. Out of desperation, I copied the main and Zend folders from 5.5.14 to my 5.5.10 folder. So I have php.h, but now no zend_config.h. There are zend_config.w32.h and zend_config.nw under the Zend folder. I guess I could take a desperate measure again and try renaming one of these files to see whether the extension will build, but I'd rather hear from someone who knows what they're doing.
Other answers to this kind of question say that you need the XCode command-line tools. I'm running Mavericks, so I got the command-line tools for Mavericks. I have XCode 5.1.1; I realize that it's up to V6 now, but do I really need the latest version of XCode for this? The installation of MongoDB itself using homebrew was beautifully uneventful. I got the mongo extension source from github and I'm following the very brief instructions from that repo.
I'm amazed that installing a simple extension would be this hard. I sure hope mongodb is enough of a performance improvement to justify this much headache. Can anyone give me an idea of how to get this going?
I had this same issue. It might be the fact that MAMP uses it's own .ini file and seems to ignore the .ini file in it's own PHP conf folder.
Once i updated MAMP's own .ini file (stored in /Applications/MAMP etc...).
Check your phpInfo page and look for the following:
Loaded Configuration File: /Library/Application Support/appsolute/MAMP PRO/conf/php.ini

Installing html_quickform2 with EasyPHP

I am using the most recent version of EasyPHP (a PHP 5.5 installation) as of this writing and it does not have Pear installed. That wasn't a problem until I read about html_quickform2 which seemed like a useful utility but I couldn't figure out how to add it to my project. It's installable via Pear but that's not included with EasyPHP anymore and I'm not sure how to set it up.
Does anyone know how to do this? Otherwise, is there a simple PHP library that allows me to just drop a couple of PHP files into my application instead?
See the installation instructions on the PEAR website.

How to install Zend Framework through PEAR using WAMPSERVER2.2 (64-bit)?

As the title states, I am having considerable problems in installing the Zend Framework through PEAR. After spending most of the day on this I'm quite surprised and frustrated with the lack of documentation, so as a result I was hoping the community would help me out.
Today I decided to change from XAMPP to WAMPSERVER2.2 for my development environment. After configuring the environment correctly and attempted to install Zend, I was dismayed to find that it does not come with the PEAR manager by default (that raises the question, why the hell not???). As a result I had to go download go-pear.phar and run the install under the command prompt >php go-pear.phar. All seems to run quite well... however, after adding the Zend channel zend.googlecode.com/svn trying to install the package via pear install zend/zend I run into problems, i.e. No releases available for package "zend.googlecode.com/svn/zend" install failed.
Tearing my hair out over this... could it be that pear was installed incorrectly? Why after adding the channel would the install fail? Any advice would be much appreciated.
You're getting upset about the wrong things. I hope I can give you a few clarifications.
PEAR installer and the WAMP (Windows Apache MySQL PHP) stack of your choice are not connected in any way and it is good, if such packages let you handle your own PEAR environment independently from it.
The time of XAMPP and WAMPSERVER are over, use Zend Server Community Edition, it's so much better, more stable, easier to set up, easier to configure.
Zend Framework is just a library, it doesn't need any installation. Why don't you just download it, place it wherever you like and put it on your PHP include path?
The installation over PEAR as you describe it, works for me, maybe you don't have the latest PEAR manager. Find out which PEAR version you have installed with pear list.
The most important point is. You only need to learn about the PHP include path and you can solve this problem in no time in any environment independently of any W/L AMP stack or PEAR installation.
I know its a bit late, but in case someone else runs into the same problem, this may help:
http://code.google.com/p/zend/issues/detail?id=25
It's basically a problem with pear and cache.

Best PHP download to keep all my options open?

In the past, I used WAMPserver on windows to parse PHP for me. This is a pre-configured package, focussed on working with MySQL.
When I tried to run PostgreSQL, I got error messages that said that my version of PHP wasn't compiled to work with PostgreSQL.
So, I've recently uninstalled WAMP and every associated with it. I've downloaded Apache 2.2.11 with openSSL, installed as admin(you know, run the command prompt as administrator, cd to the directory where the download was done and have it executed, so the install was done as admin).
That's that. I now have Apache installed, "it works" shows up, so I'm that far.
Now I'm wondering, do I download the exe and install, or the zip, or something else.
What is the best thing to do to make sure that the PHP on my system can handle everything I can ever throw at it?
Also, PHP first, or MySQL/Postgre first.
And lastly, what about PEAR? I need PEAR installed, which isn't standard on Windows. I'm guessing the pear.bat file in the PHP downloads will do that for me?
EDIT: I see one close vote, yet no comment as to why. It makes me wonder how people who are so lazy and rude got to have somany points.
I would recommend downloading the zip package, as configuring php is not really that difficult, and it allows you to add features as needed.
As for whether first to install php or MySQL/PostgreSQL, - it does not really matter. You can install them in any order.
Your guess regarding PEAR is quite correct
i haven't used wamp before, so i can't comment on that
i do however use xampp which sounds very similar
in xampp if i want to enable postgres support i edit the php.ini file and uncomment the postgres section of the ini file, same with any of the extensions that i need
perhaps this might be an alternative you can try if you get stuck
There are many ways to setup a HTTP server/PHP/database machine. Sometimes the behaviour of your development setup will differ from the live server's.
I would recommend finding out the setup your web host is using, then getting a vmware appliance image that fits that as close as possible and get any additional software using it's package manager (which is easier that installing stuff on Windows).
Setup a file sharing link between the VM and the host, make sure you can view the VM's port 80 in a browser running in your host OS and you're set.

Is the Validate PEAR package ready for production?

There appears to be a Validate package in Pear that I'm interested in useing in production. Our site has about 20M uniques across 10 languages, so as part of due diligence, thought I'd asked around here.
Does anyone have any experience with this PEAR package?
Is it ready for production?
Here's the Validate package in question:
http://pear.php.net/package/Validate
Intro:
http://pear.php.net/manual/en/package.validate.validate.php
Bugs (only 78 ever filed...)
http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Validate&status=All
I'd strongly advise against integrating the PEAR code you use into your own code-base.
What happens then if a new version of one of the PEAR packages you use is released to fix security issues and there are multiple dependencies from that package onto others?
Do you download the new versions and check everything works ok and that you've not added a bug yourself by missing something?
The best thing to do, if you are paranoid of the system-wide PEAR install being compromised, is to make your own PEAR install. http://pear.php.net/manual/en/installation.shared.php would be where to start for doing this.
Then it's just a case of doing $pear upgrade [Package] rather than copying loads of files around.
The validate functions have been around a long time - some since 2003. I wouldn't worry too much about the beta tag, but I am still paranoid about code - so write tests for yourself, and don't upgrade the PEAR library on your systems without testing.
Even better - consider integrating the PEAR code you use into your own code-base rather than depending on the system PEAR library that can be upgraded separately.
you can make your own pear install (ie one that isn't system wide) - so you don't have to worry about any interdependencies when you upgrade - let the pear installer figure that out for you.
this is better than simply copying the code of pear packages into your own repo - what would you do if you miss a cricual bug fix released after you've inserted those pear packages that you're using into your revision control system?
honestly the validate package should be taken out of beta - it's been stable other than in name for a very long time.
Judging by the revision number and the revision title. (0.8.2 (Beta)) i would say no. Personally i would advice against using any Beta product in production, though there are many cases that it worked out fine (stackoverflow for example). Though you are always running a risk of something happening.

Categories