FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » newbie: Zend or PEAR supported on web hosting company?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
newbie: Zend or PEAR supported on web hosting company? [message #171715] Tue, 18 January 2011 12:25 Go to next message
Rob is currently offline  Rob
Messages: 5
Registered: October 2010
Karma: 0
Junior Member
Hi,

Two web hosting companies both use Zend's PHP v5.2.x

As far as PHP frameworks go, I read a lot about PEAR but I do not see
any PEAR packages available on the web hosting companies. Nor do I see
any Zend PHP libraries in the phpinfo() results. I do see many PHP
settings available.

I don't really know the pro's/con's of Zend framework vs PEAR
framework (can they even be used together) but:

[1] How can I load a Zend or PEAR framework onto my account on my web
hosting company?

[2] Is one framework lighter-weight than the other? Meaning, can I
load pieces of one framework instead of the whole thing?

[3] Which framework provides a cache for both database results and
page content?

I'm coming from a Java/J2EE world and checking out PHP. My apologies
for the newbie questions.

Thx
Rob
Re: newbie: Zend or PEAR supported on web hosting company? [message #171716 is a reply to message #171715] Tue, 18 January 2011 12:47 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 18/01/2011 13:25, Rob escribió/wrote:
> Two web hosting companies both use Zend's PHP v5.2.x
>
> As far as PHP frameworks go, I read a lot about PEAR but I do not see
> any PEAR packages available on the web hosting companies. Nor do I see
> any Zend PHP libraries in the phpinfo() results. I do see many PHP
> settings available.

I've never used the Zend framework but... are you sure it contains
binary extensions?


> I don't really know the pro's/con's of Zend framework vs PEAR
> framework (can they even be used together) but:
>
> [1] How can I load a Zend or PEAR framework onto my account on my web
> hosting company?

As about PEAR, just install it in your computer, upload the files and
add the directory to the "include_path" directive. PEAR is only a bunch
of PHP code.

> [2] Is one framework lighter-weight than the other? Meaning, can I
> load pieces of one framework instead of the whole thing?

I don't think you could install every available PEAR package even if you
wanted to :)




--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Re: newbie: Zend or PEAR supported on web hosting company? [message #171718 is a reply to message #171716] Tue, 18 January 2011 14:30 Go to previous messageGo to next message
Derek Turner is currently offline  Derek Turner
Messages: 48
Registered: October 2010
Karma: 0
Member
On Tue, 18 Jan 2011 13:47:52 +0100, Álvaro G. Vicario wrote:


>
> I've never used the Zend framework but... are you sure it contains
> binary extensions?

The basic Zend framework can simply be uploaded to your space and then
invoked thusly:

<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '/home/cantabi1/
library');
include_once 'Zend/Mail.php';

all this is in the online manual.


> As about PEAR, just install it in your computer, upload the files and
> add the directory to the "include_path" directive. PEAR is only a bunch
> of PHP code.
>
My hosting company (JustHost.com) allows you to install PEAR packages
from the cPanel interface. They added Spreadsheet_Excel_Writer to mine
even though it is still "beta" (O.9.2).

hth

--
Derek
Re: newbie: Zend or PEAR supported on web hosting company? [message #171719 is a reply to message #171715] Tue, 18 January 2011 14:50 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Rob wrote:

> Two web hosting companies both use Zend's PHP v5.2.x

AFAIK there is not such a thing. PHP is open source software developed by
the PHP Group, which I understand is a group of volunteers¹, using the Zend
Engine developed by Zend Technologies Ltd.²

_____
¹ <http://php.net/credits.php>
² <http://www.zend.com/>

> As far as PHP frameworks go, I read a lot about PEAR but I do not see
> any PEAR packages available on the web hosting companies.

Because that would not make sense. A web hoster cannot know beforehand
which packages their users would need, or if they even used PEAR packages
to begin with.

> Nor do I see any Zend PHP libraries in the phpinfo() results.

It should say at least

"This program makes use of the Zend Scripting Language Engine:
Zend Engine v2…"

> I do see many PHP settings available.

As you should.

> I don't really know the pro's/con's of Zend framework vs PEAR
> framework (can they even be used together) but:

Zend Framework is a number of PHP *script* libraries, available and to be
used as source code only. PEAR is a code repository (the *P*HP *E*xtension
and *A*pplication *R*epository), not a framework.

> [1] How can I load a Zend or PEAR framework onto my account on my web
> hosting company?

You can download Zend Framework for free and set it up in your webspace.
Preferably you would do it so that it is located *above* your Web root,
and adapt your include path accordingly. IOW, it would be best if your web
hoster installed Zend Framework at a central location, and kept it up-to-
date.

PEAR can be accessed using the `pear' program from the server's console (you
should have SSH access). It is necessary that you are allowed to make
outgoing connections from the server, as PEAR packages will be downloaded
and installed automatically according to a packages dependecies. Probably
you also need to be root on that (virtual) machine, unless you want to
resolve the dependencies yourself.

> [2] Is one framework lighter-weight than the other? Meaning, can I
> load pieces of one framework instead of the whole thing?

One is a framework, the other is not. Apples and oranges.

> [3] Which framework provides a cache for both database results and
> page content?

Zend Framework does. It is also the only framework of the two.

> I'm coming from a Java/J2EE world and checking out PHP. My apologies
> for the newbie questions.

Even as a newbie you could have STFW before posting, and RTFFAQ.
Groveling is no substitute for doing your homework.

<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Re: newbie: Zend or PEAR supported on web hosting company? [message #171720 is a reply to message #171718] Tue, 18 January 2011 15:28 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Derek Turner wrote:

> On Tue, 18 Jan 2011 13:47:52 +0100, Álvaro G. Vicario wrote:
>> I've never used the Zend framework but... are you sure it contains
>> binary extensions?
>
> The basic Zend framework can simply be uploaded to your space and then
> invoked thusly:
>
> <?php
> set_include_path(get_include_path() . PATH_SEPARATOR . '/home/cantabi1/
> library');
> include_once 'Zend/Mail.php';

This probably suffices only here, because Zend Framework uses an autoloader
extensively that need to be set up, too.

> all this is in the online manual.

And to answer the question: Zend Framework does _not_ contain binary
extensions; it is pure, but elaborate (and sometimes a bit inefficient) PHP,
XML, WSDL, XML Schema, and SQL source code, only *using* php.ini-registered
PHP extensions.

>> As about PEAR, just install it in your computer, upload the files and

You meant _download_, which is unnecessary manually if you use the `pear'
program (which one could, as one would have have just *installed* it.)

>> add the directory to the "include_path" directive. PEAR is only a bunch
>> of PHP code.

A bunch of independently written PHP code following a certain code style,
determined to reuse each other, though, with dependencies that need to be so
well documented in the repository as to be automatically resolvable through
the `pear' program. It appears to me a bit backwards to install PEAR
locally just to re-resolve the dependencies manually on the server.

By contrast, Zend Framework is (AFAIK) not written independently. Where
PEAR packages, among other criteria, MUST NOT use include* and require* to
pass QA and to be admitted in the repository, there is no such rule for Zend
Framework code (however, there is QA and code style there, too).

> My hosting company (JustHost.com) allows you to install PEAR packages
> from the cPanel interface. They added Spreadsheet_Excel_Writer to mine
> even though it is still "beta" (O.9.2).

That's good to know, thanks.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Re: newbie: Zend or PEAR supported on web hosting company? [message #171723 is a reply to message #171720] Tue, 18 January 2011 16:30 Go to previous messageGo to next message
Sherm Pendley is currently offline  Sherm Pendley
Messages: 33
Registered: September 2010
Karma: 0
Member
Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:

> Derek Turner wrote:
>
>>> As about PEAR, just install it in your computer, upload the files and
>
> You meant _download_, which is unnecessary manually if you use the `pear'
> program (which one could, as one would have have just *installed* it.)

No - he meant upload. Install it on *your* computer (using pear), then
upload the result to your web space.

sherm--

--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
Re: newbie: Zend or PEAR supported on web hosting company? [message #171724 is a reply to message #171723] Tue, 18 January 2011 17:46 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Sherm Pendley wrote:

> Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:
>> Derek Turner wrote:
>>>> As about PEAR, just install it in your computer, upload the files and
>>
>> You meant _download_, which is unnecessary manually if you use the `pear'
>> program (which one could, as one would have have just *installed* it.)
>
> No - he meant upload. Install it on *your* computer (using pear), then
> upload the result to your web space.

OK, but that's crazy.


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
Re: newbie: Zend or PEAR supported on web hosting company? [message #171725 is a reply to message #171724] Tue, 18 January 2011 21:37 Go to previous messageGo to next message
Sherm Pendley is currently offline  Sherm Pendley
Messages: 33
Registered: September 2010
Karma: 0
Member
Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:

> Sherm Pendley wrote:
>
>> Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:
>>> Derek Turner wrote:
>>>> > As about PEAR, just install it in your computer, upload the files and
>>>
>>> You meant _download_, which is unnecessary manually if you use the `pear'
>>> program (which one could, as one would have have just *installed* it.)
>>
>> No - he meant upload. Install it on *your* computer (using pear), then
>> upload the result to your web space.
>
> OK, but that's crazy.

Why? As someone else (I forget who) mentioned, 'pear' may need root
access, or may not be available on one's web hosting account. But the
end result of running it is just a pile of PHP files, so one can work
around such limited access by running it locally, then uploading the
end result when it's done.

If you think about it, it's really no crazier than developing code on
one's own desktop before uploading it to a deployment server.

sherm--

--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer
Re: newbie: Zend or PEAR supported on web hosting company? [message #171726 is a reply to message #171725] Tue, 18 January 2011 22:46 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Sherm Pendley wrote:

> Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:
>> Sherm Pendley wrote:
>>> Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> writes:
>>>> Derek Turner wrote:
>>>> >> As about PEAR, just install it in your computer, upload the files and
>>>> You meant _download_, which is unnecessary manually if you use the
>>>> `pear' program (which one could, as one would have have just
>>>> *installed* it.)
>>> No - he meant upload. Install it on *your* computer (using pear), then
>>> upload the result to your web space.
>> OK, but that's crazy.
>
> Why? As someone else (I forget who) mentioned, 'pear' may need root
> access, or may not be available on one's web hosting account.

So go get them. They are not hard to come by. But good news: `pear' is
user-configurable¹ and there's go-pear, so root and shell access is not
mandatory; only PHP-CLI and downloads to the server (see below).

_____
¹ <http://pear.php.net/manual/de/guide.users.commandline.cli.php>

> But the end result of running it is just a pile of PHP files,

No, it is a little bit more than just that.

> so one can work around such limited access by running it locally, then
> uploading the end result when it's done.
>
> If you think about it, it's really no crazier than developing code on
> one's own desktop before uploading it to a deployment server.

The difference there is that you *know* what you changed (but preferably you
would rather use SVN & Co., and then checkout the remote repository to the
localhost and the remote servers.)

By contrast, it is not easy to see which packages are downloaded by `pear'
when it resolves the dependencies for the initially needed package, and what
exactly is changed by that. Sure, that upload approach *might* work fine
the first time. But after that you either have to clear your local PEAR
directory before you start installing another package, or always upload
*everything* PEAR to be sure that you do not miss anything (OK, rsync could
help in some cases, but people who can rsync would probably have root[-like]
access already. And it was still not a complete solution).

The sane approach is to find a hoster like Derek's and install the needed
PEAR packages there *and* on one's (local) development server.

See also:
<http://pear.php.net/manual/en/guide.users.commandline.installing.php> and
<http://pear.php.net/manual/en/installation.shared.php>.


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Scaling image is losing background transparency
Next Topic: building a simple xml object from scratch without dom but with formatting
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 12:53:25 GMT 2024

Total time taken to generate the page: 0.02485 seconds