Changes

Jump to navigation Jump to search

Coral: php pear

7,902 bytes added, 13:42, 12 November 2011
Created page with "<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font..."
<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font-size:12px">'''''Coral'' :'''&nbsp; [[Coral: php intro|PHP]] | [[Coral: php short open_tags|PHP - Short open tags]] | [[Coral: php pear|PHP - PEAR Auto Install]] | [[Coral: php pear manual install|PHP - PEAR Manual Install]] | [[Coral: php apc|PHP - APC]]</span></div>

{|style="margin-top:5px;"
|-valign="top"
|
<span style="margin-bottom:5px;font-size:25px;color: #31799F;">PHP - PEAR Auto Install</span>

The PHP Extension and Application Repository, or PEAR for short contains re-usable code. This page covers PEAR installation using go-pear, which is integrated into The Uniform Server’s architecture.

__TOC__

|
{| cellpadding="0" cellspacing="0" style="margin-left:6px;margin-bottom:5px;padding-left:6px;padding-right:6px;font-size:11px;background-color: #FFFFEB;border: 1px solid darkslateblue;"
|-
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral
|-
|&nbsp;||[[Coral: Introduction|Home]]
|-
|&nbsp;||[[Coral: start quick start|Quick Start]]
|-
|&nbsp;||[[Coral: general intro|General]]
|-
|&nbsp;||[[Coral: apache intro|Apache]]
|-
|&nbsp;||[[Coral: mysql intro|MySQL]]
|-
|<span style="font-size: 14px;">»</span>||[[Coral: php intro|PHP]]
|-
|&nbsp;||[[Coral: msmtp intro|MSMTP]]
|-
|&nbsp;||[[Coral: cron intro|CRON]]
|-
|&nbsp;||[[Coral: dtdns intro|DtDNS]]
|-
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]
|-
|&nbsp;||[[Coral: perl intro|Perl]]
|-
|&nbsp;||[[Coral: index main|Main Index]]
|}
|}

==Install PEAR core package==

{|
|-valign="top"
|
Open Pear control panel as follows:

<span style="padding:6px;background-color:#99FFFF"> Server Configuration > PHP > Pear Control Panel </span>

* Click '''Install Pear''' button (1)
* PEAR intaller opens in your browser. There is nothing to do other than to click OK at each prompt as follows:
** Welcome to go-pear - Click '''Next''' >>
** At the end of Configuration section - '''Click Install'''
* Installation process starts; this will take a while to complete.
|
[[Image:Coral_php_pear_controller_1.gif]]
|-valign="top"
|
*Expected results are shown on right.

'''Note''': Your Installation path may be different!
|
<pre>
Starting installation ...
Loading zlib: ok

Bootstrapping Installer...................
Bootstrapping PEAR.php............(remote) ok
Bootstrapping Archive/Tar.php............(remote) ok
Bootstrapping Console/Getopt.php............(remote) ok

Extracting installer..................
Downloading package: PEAR.............ok
Downloading package: Structures_Graph....ok

Preparing installer..................
Updating channel "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded

Installing selected packages..................
Downloading and installing package: PEAR.............ok
Installing bootstrap package: Structures_Graph.......ok
Downloading and installing package: Archive_Tar-stable.......ok
Downloading and installing package: Console_Getopt-stable.......ok
Downloading and installing package: PEAR_Frontend_Web-beta.......ok

Writing WebFrontend file ... ok

Installation Completed !
Note: To use PEAR without any problems you need to add your
PEAR Installation path (C:\UniServer\home\us_pear\PEAR)
to your include_path.

Using a .htaccess file or directly edit httpd.conf would be working
solutions for Apache running servers, too.

Note: Above path already pre-configured in The Uniform Server hence
you are ready to go.

For more information about PEAR, see:
PEAR FAQ
PEAR Manual

Thanks for using go-pear!

Start Web Frontend of the PEAR Installer >>
</pre>
|-valign="top"
|
* Scroll to end of installation section.
* Click the link '''Start Web Frontend of the PEAR Installer'''
* Web Front End opens in your default browser as shown on right.
|
[[Image:Coral_php_pear_auto_install_1.gif]]
|}

'''''[[#top | Top]]'''''
==Open PEAR Web Frontend==
After installing PEAR, you can access the web-front-end at any time using either of the following methods:

{|cellpadding="6"
|-valign="top"
|style="background-color:#f0f0f0"|
'''Method 1''' <br />
Run the web-front-end from UniController menu as follows;


<span style="padding:6px;background-color:#99FFFF"> Server Configuration > PHP > Pear Control Panel </span>


Click '''View Pear Front-end''' button
|
&nbsp;
|style="background-color:#f0f0f0"|
'''Method 2'''<br />
Alternatively enter the following into your browser:


<span style="padding:6px;background-color:#99FFFF"> <nowiki>http://localhost/us_pear/index.php</nowiki> </span>

|}

'''''[[#top | Top]]'''''
==Using PEAR Frontend==
Open the PEAR front-end using one of the methods explaind above.

Installing PEAR packages is very easy. To confirm our PEAR installation is working and to demonstrate how to install packages, we will be using a package named '''HTML_QuickForm'''

'''''[[#top | Top]]'''''
==Update the Channel Management system==
{|
|-valign="top"
|
Before downloading any package, '''update''' the Channel Management system

* C) Click on '''Channel Management''' - Opens Registered Channels page.
* From this page, click on '''Update All Channels'''

You will receive something similar this:
<pre>
Updating channel "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date
</pre>
|
[[Image:Coral_php_pear_auto_install_1.gif]]
|}

'''''[[#top | Top]]'''''
==Downloading modules==
{|
|-valign="top"
|
Downloading a known package (example HTML_QuickForm)

* A) Click on '''Package Management''' - Opens management page.
* Scroll down page to '''Quick-install a package'''
* Enter package name '''HTML_QuickForm'''
* '''Click Install'''
|
[[Image:Coral_php_pear_auto_install_2.gif]]
|-valign="top"
|
* After a short time the package is installed.
* Note the Warnings! We know this is an older package but want to use it anyway.
|
[[Image:Coral_php_pear_auto_install_3.gif]]
|-valign="top"
|
* A) Click on '''Package Management''' - Opens management page.
* New Installed packages are listed.

Although we intended to only download and install a single package, two were installed. The package HTML_QuickForm will not function without package HTML_Common; it depends on this being in place. In other words, when installing a package, all dependencies that do not exist are also installed.
|
[[Image:Coral_php_pear_auto_install_4.gif]]
|}

'''''[[#top | Top]]'''''
==Form - Test Script==
Create a new text file named '''form.php''' with the following content and save to folder UniServer\www

<pre>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pear HTML_QuickForm test</title>
</head>
<body>
<?php
require_once "HTML/QuickForm.php";

$form = new HTML_QuickForm('frmTest', 'get');
$form->addElement('header', 'MyHeader', 'Testing QuickForm');
$form->addElement('text', 'MyTextBox', 'What is your name?');
$form->addElement('reset', 'btnClear', 'Clear');
$form->addElement('submit', 'btnSubmit', 'Submit');
$form->display();

?>
</body>
</html>
</pre>

{|
|-valign="top"
|
'''''Test'':'''

* Start The Uniform Server
* Type the following into a browser: <nowiki>http://localhost/form.php</nowiki>
* Expected result is shown on right.

|
[[Image:Coral_php_pear_manual_install_6.gif]]
|}

'''''[[#top | Top]]'''''

==Where to next==

[[Coral: php pear manual install|PHP - PEAR Manual Install]] - This page covers manual PEAR installation.


'''''[[#top | Top]]'''''

----

[[Category: Uniform Server 8-Coral]]

Navigation menu