| View previous topic :: View next topic |
| Author |
Message |
jurassicjeff
Joined: 03 Oct 2007 Posts: 16
|
Posted: Wed Mar 26, 2008 1:52 pm Post subject: problem installating pear and front end |
|
|
Hi,
I have instaled wamp and then I have used go-pear to install pear packages.
The problem is that I have got an example:
class DataObject_Fruits extends DB_DataObject
{
var $__table = "fruits";
var $id;
var $name;
var $stock;
var $price;
}
$dataobject = new DataObject_Fruits();
$datagrid =& new Structures_DataGrid(10);
$datagrid->bind($dataobject); // la magie est ici
$datagrid->render();
nothing appears.
I have instaled different packages unsuccessfully.
I have tried to use front end web , but I have error on template directory.
How can I install and use front end web.
What I have to check
Any help would be greatly appreciated.
Jeff |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Wed Mar 26, 2008 3:24 pm Post subject: Re: problem installating pear and front end |
|
|
| jurassicjeff wrote: | | I have instaled different packages unsuccessfully. |
How did you try to install them? Which error messages did you get?
Are you aware which packages you need for the example?
=> DB, DB_DataObject, Structures_DataGrid, Structures_DataGrid_DataSource_DataObject, Structures_DataGrid_Renderer_HTMLTable
| jurassicjeff wrote: | I have tried to use front end web , but I have error on template directory.
How can I install and use front end web. |
A short tutorial can be found here:
http://cvs.php.net/viewvc.cgi/pear/PEAR_Frontend_Web/README?revision=1.2&view=markup |
|
| Back to top |
|
 |
jurassicjeff
Joined: 03 Oct 2007 Posts: 16
|
Posted: Wed Mar 26, 2008 4:33 pm Post subject: pear installation and frontend_web |
|
|
thank you for your help.
I first have installed wamp 2.0
Then I have started go-pear.bat
After i have installed different packages with
pear install db_dataobject...
When I start the example, nothing appears (no render).
I have also installed pear install pear_frontend_web
I think that it will be easier to check the existence of packages.
In the tutorial you have sent, there is the following line in second step of installation.
copy docs/index.php.txt to <webdir>/index.php where <webdir> is a web-accessible directory
In pear directory, none of different docs directory have index.php or index.php.txt file.
Are there other packages to install.
I have put in php.ini included path
c:\wamp\bin\php\php5..5\pear
it does not change anything
Thank you very much for your help
Jeff |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Wed Mar 26, 2008 6:42 pm Post subject: Re: pear installation and frontend_web |
|
|
| jurassicjeff wrote: | thank you for your help.
I first have installed wamp 2.0
Then I have started go-pear.bat
After i have installed different packages with
pear install db_dataobject...
When I start the example, nothing appears (no render). |
The reason for the missing output might be that you don't have the database table "fruits" or that this table is empty.
Please add the following lines at the beginning of your script:
| Code: |
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once 'PEAR.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
|
| jurassicjeff wrote: | I have also installed pear install pear_frontend_web
I think that it will be easier to check the existence of packages. |
"pear list" also shows the installed packages, but the web interface is also nice.
| jurassicjeff wrote: | In the tutorial you have sent, there is the following line in second step of installation.
copy docs/index.php.txt to <webdir>/index.php where <webdir> is a web-accessible directory
In pear directory, none of different docs directory have index.php or index.php.txt file.
Are there other packages to install. |
Did you install PEAR_Frontend_Web? This package includes the index.php.txt file (and also the README file that my link refered to). |
|
| Back to top |
|
 |
jurassicjeff
Joined: 03 Oct 2007 Posts: 16
|
Posted: Wed Mar 26, 2008 11:18 pm Post subject: |
|
|
here is the message I get.
Unknown DataSource driver. Please specify an existing driver.
The table fruits is not empty.
I have installed pear_frontend_web-0.7.2 (installation of pear_frontend_web has failed)
But no index.php.txt file created
I just have pearfrontendweb.php file.
What kind of big mistake I have done.
Do I have to uninstal pear and reinstall it?
Thanks for your help
Jeff |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Wed Mar 26, 2008 11:25 pm Post subject: |
|
|
| jurassicjeff wrote: | here is the message I get.
Unknown DataSource driver. Please specify an existing driver. |
This message indicates that you haven't installed Structures_DataGrid_DataSource_DataObject.
| jurassicjeff wrote: | | I have installed pear_frontend_web-0.7.2 (installation of pear_frontend_web has failed) |
It failed because there is no stable release yet. "pear install pear_frontend_web-0.7.2" (your solution) or "pear_frontend_web-beta" will work. (It's the same for "Structures_DataGrid_DataSource_DataObject-beta".)
| jurassicjeff wrote: | | But no index.php.txt file created |
You're maybe looking in the wrong directory. Please call "pear config-show". Search for "doc_dir" in the output, and switch to that directory then. There should be a directory "PEAR_Frontend_Web" in this directory, and there you should find the index.php.txt. |
|
| Back to top |
|
 |
jurassicjeff
Joined: 03 Oct 2007 Posts: 16
|
Posted: Wed Mar 26, 2008 11:55 pm Post subject: |
|
|
I have checked the file index.php.txt and finally I found it in the directory c:\php5\pear instead of c:\wamp\bin\php\php5.2.5\pear
Here is the result of pear config-show.
I don't understand what is wrong with my installation.
I begun with go-pear where all paths were based on c:\wamp\bin\php\php5.2.5\pear
Where does the path c:\php5\pear come from?
Thanks for help
Jeff
CONFIGURATION (CHANNEL PEAR.PHP.NET):
=====================================
Auto-discover new Channels auto_discover <not set>
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy <not set>
PEAR server [DEPRECATED] master_server pear.php.net
Default Channel Mirror preferred_mirror pear.php.net
Remote Configuration File remote_config <not set>
PEAR executables directory bin_dir C:\wamp\bin\php\php5.2.5
PEAR documentation directory doc_dir C:\php5\pear\docs
PHP extension directory ext_dir c:/wamp/bin/php/php5.2.5/ext/
PEAR directory php_dir C:\wamp\bin\php\php5.2.5\pear
PEAR Installer cache directory cache_dir C:\DOCUME~1\Jeff\LOCALS~1\Temp\pear\cache
PEAR data directory data_dir C:\php5\pear\data
PEAR Installer download download_dir C:\DOCUME~1\Jeff\LOCALS~1\Temp\pear\cache
directory
PHP CLI/CGI binary php_bin C:\wamp\bin\php\php5.2.5\php.exe
php.ini location php_ini <not set>
PEAR Installer temp directory temp_dir C:\DOCUME~1\Jeff\LOCALS~1\Temp\pear\temp
PEAR test directory test_dir C:\php5\pear\tests
Cache TimeToLive cache_ttl 3600
Preferred Package State preferred_state stable
Unix file mask umask 0
Debug Log Level verbose 1
PEAR password (for password <not set>
maintainers)
Signature Handling Program sig_bin c:\gnupg\gpg.exe
Signature Key Directory sig_keydir C:\WINDOWS\pearkeys
Signature Key Id sig_keyid <not set>
Package Signature Type sig_type gpg
PEAR username (for username <not set>
maintainers)
User Configuration File Filename C:\WINDOWS\pear.ini
System Configuration File Filename C:\WINDOWS\pearsys.ini |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Thu Mar 27, 2008 12:13 am Post subject: |
|
|
c:\php5\pear is the default path that the PEAR installer uses. You had the option to change this. And, of course, you can still change this, if you want ("pear help config-set"). But there's nothing really wrong with this path, everything will work, regardless whether it is c:\php5\pear or c:\wamp\...
The only interesting point for you is that you rename and move the index.php.txt file to a place that the webserver can handle. The "doc_dir" isn't meant to be reachable by the webserver, this is even not recommended. |
|
| Back to top |
|
 |
jurassicjeff
Joined: 03 Oct 2007 Posts: 16
|
Posted: Fri Mar 28, 2008 12:54 pm Post subject: |
|
|
I have used config-set to relocate docs data and test directory and the frontend_web works.
Thank you very much for your help.
I am not familiar with the different packages. How can you say
"This message indicates that you haven't installed Structures_DataGrid_DataSource_DataObject."
from message
"Unknown DataSource driver. Please specify an existing driver."
My second question is where I can modify the default installation path (c:\php5\pear) before using go-pear
In the go-pear installation all the paths were correct (I did not see the default path).
Thank you for your precious help
Jeff |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Fri Mar 28, 2008 4:39 pm Post subject: |
|
|
| jurassicjeff wrote: | I am not familiar with the different packages. How can you say
"This message indicates that you haven't installed Structures_DataGrid_DataSource_DataObject."
from message
"Unknown DataSource driver. Please specify an existing driver." |
The reason is that I'm one of the maintainers of Structures_DataGrid and its subpackages (= drivers). Therefore, I know in which cases the "Unknown ..." error message is thrown. And as you said that you have used the PEAR installer, it was very unlikely that you have extracted the .tgz files yourself and have put the files into a wrong place (this would also lead to the error, and some people had this problem before).
| jurassicjeff wrote: | My second question is where I can modify the default installation path (c:\php5\pear) before using go-pear
In the go-pear installation all the paths were correct (I did not see the default path). |
There should have been some options during installation that allowed you to change from the default path to your custom path. Maybe you haven't changed all of them? If you did, this could be a bug in the installer. But if it would be a bug, I would expect that anybody else already noticed that bug before. |
|
| Back to top |
|
 |
jurassicjeff
Joined: 03 Oct 2007 Posts: 16
|
Posted: Sat Mar 29, 2008 2:04 am Post subject: |
|
|
| thank you very much for your help |
|
| Back to top |
|
 |
rej
Joined: 18 Nov 2008 Posts: 2
|
Posted: Tue Nov 18, 2008 9:14 am Post subject: Structures Datagrid |
|
|
I have tried the same example
My code is
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// -----------
// PATH Settings
// -----------
define ('FULL_PATH', dirname(__FILE__).'/');
define( 'ROOT_DIR', FULL_PATH );
define( 'SMARTY_DIR', FULL_PATH . 'libs/Smarty/' );
define( 'TEMPLATE_DIR', FULL_PATH . 'templates/' );
define( 'TEMPLATE_C_DIR', FULL_PATH . 'templates_c/' );
define( 'PEAR_DIR', FULL_PATH . 'libs/Pear/' );
define( 'CONFIG_PATH', FULL_PATH . 'myconfigs/' );
define( 'LANG_DIR', FULL_PATH . 'language/' );
/* Includes */
require_once PEAR_DIR."PEAR.php";
PEAR::setErrorHandling(PEAR_ERROR_DIE);
define("DB_DATAOBJECT_NO_OVERLOAD",true); /* This is needed for some buggy versions of PHP4 */
require_once PEAR_DIR."DB/DataObject.php";
require_once PEAR_DIR."Structures/DataGrid.php";
DB_DataObject::debugLevel (1);
/* Database and DataObject setup */
$dataobjectOptions = &PEAR::getStaticProperty("DB_DataObject","options");
$dataobjectOptions["database"] = "mysql://root:@192.168.1.28/rej";
$dataobjectOptions["proxy"] = "full";
class DataObject_Fruits extends DB_DataObject
{
var $__table = "fruits";
var $id;
var $name;
var $stock;
var $price;
}
/* Instantiate */
$dataobject = new DataObject_Fruits();
$datagrid =& new Structures_DataGrid(10); /* 10 rows per table */
//print_r($datagrid);
/* Bind */
$new = $datagrid->bind($dataobject);
//print_r($new);
/* Output */
$datagrid->render();
?>
sorry to say that i am getting the error "Unknown DataSource driver. Please specify an existing driver."
my PEAR installations are listed as under
Installed Packages, channel pear.php.net:
Package --- version --- state
Archive_Tar --- 1.3.2 --- stable
Console_Getopt--- 1.2.3 --- stable
DB--- 1.7.13--- stable
DB_DataObject --- 1.8.8 --- stable
Date --- 1.4.7 --- stable
HTML_Common--- 1.2.4 --- stable
HTML_Table --- 1.8.2--- stable
MDB2--- 2.5.0b1 --- beta
PEAR --- 1.7.1--- stable
Pager --- 2.4.7 --- stable
Structures_DataGrid --- 0.9.0 --- beta
Structures_DataGrid_DataSource_DataObject--- 0.2.1--- beta
Structures_DataGrid_DataSource_MDB2 --- 0.1.11--- beta
Structures_DataGrid_Renderer_HTMLTable --- 0.1.5--- beta
Structures_DataGrid_Renderer_Pager--- 0.1.3--- beta
Structures_Graph --- 1.0.2--- stable
I was working on wamp5 and faced the same problem. I uninstalled it and changed to latest version of Wampserver 2.0
But the problem remains same..... I am sure there is some minor thing unnoticed by me... can any of you help !!![/img] |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Tue Nov 18, 2008 7:39 pm Post subject: |
|
|
The problem is that you use | Code: | | require_once PEAR_DIR."PEAR.php"; | (and similar calls for other PEAR files). Instead of using the constant PEAR_DIR you need to set the include_path setting correctly. It needs to contain the directory in which PEAR.php resides. Otherwise packages like Structures_DataGrid are not able to find their own files. |
|
| Back to top |
|
 |
rej
Joined: 18 Nov 2008 Posts: 2
|
Posted: Wed Nov 19, 2008 3:14 pm Post subject: |
|
|
Hi Mark,
Thanks a lot !!!! The include_path helped me make the code work perfect.
It is really nice that you responded so fast.
Regards,
Rej |
|
| Back to top |
|
 |
|