Irritating Warning On ->PEAR->DB->PGSQL
I am getting following message from pear. I am running RedHat 8.0, PostgreSQL is 7.3.2 PHP Version 4.2.2 and pear:db 1.6.5.
Warning: pg_errormessage(): supplied argument is not a valid
PostgreSQL link resource in /usr/share/pear/DB/pgsql.php on line 449
Any idea.
View Complete Forum Thread with Replies
Related Forum Messages:
Irritating Pop Out
when i click the BACK button in moziila or IE to browse my site that i write, then always pop out this error msg. how to modify my code to make it disappear?
View Replies !
PEAR DB - Warning: Problem With Method Call - Please Report This Bug
When I have DB.php (PEAR) in the root directory of my project it works ok using require "DB.php"; When I put it in a seperate folder and call it using require "classes/DB.php"; i get the following errors: Warning: Problem with method call - please report this bug in / home/..../DB.php on line 520 Warning: Problem with method call - please report this bug in / home/..../DB.php on line 543
View Replies !
Warning: Main(PEAR.php) [function.main]: Failed To Open Stream:
I was required to configure an application to run on local machine with windowsXP. I installed wamp server with PHP4.1 , MYSQL 5.0 and Apache. When I executed the application it gave an error Warning: main(PEAR.php) [function.main]: failed to open stream: No such file or directory in c:wampwwwMYGFconfig.php on line 18 Fatal error: main() [function.require]: Failed opening required 'PEAR.php' (include_path=':.:lib/:lib/pear/:lib/classes:lib/smarty/:.;C:php5pear') in c:wampwwwMYGFconfig.php on line 18 Then I was asked to configure PEAR. I configured PEAR with go-pear.php and then it said Start Web Frontend of the PEAR Installer >> I clicked it and got Parse error: syntax error, unexpected T_STRING in c:wampwwwMYGFlibPEARindex.php on line 33.
View Replies !
--with-pgsql=WHERE?
I need an installation with Postgres support, and was happy to find in my phpinfo that there was a --with-pgsql=shared option in the config line. but I still got "call to undefined function: pgsql_connect (4.3.11) So I figured whatev, I'll put a new installation (PHP5, in fact), but I always fail config with: Cannot find libpq-fe.h. Please specify correct Postgresql installation path 'course i looked in my handy old webmin to see where Postgres might be... tried various paths I found in various places --with-pgsql=/var/lib/pgsql/ --with-pgsql=/usr/share/pgsql --with-pgsql=/usr/bin/psql obviously not a lib, but getting desparate...
View Replies !
PHP Installation With Pgsql
I got PostgreSQL installed and now I'm trying to get PHP installed too. I do ./configure --with-pgsql and everything works fine. But when I do make, I get this error: ext/mysql/libmysql/my_lib.o(.text+0x37a): In function `my_dir': /home/marc/extract/php-4.3.1/ext/mysql/libmysql/my_lib.c:169: undefined reference to `errno' ext/mysql/libmysql/my_lib.o(.text+0x546): In function `my_stat': /home/marc/extract/php-4.3.1/ext/mysql/libmysql/my_lib.c:588: undefined reference to `errno' ext/mysql/libmysql/my_tempnam.o(.text+0x79):/home/marc/extract/php-4.3.1/ext/mysql/libmysql/my_tempnam.c:108: more undefined references to `errno' follow collect2: ld returned 1 exit status make: *** [sapi/cgi/php] Error 1 I need php installed soon. I don't know what is causing this error to occur.
View Replies !
Hosting PHP And PGSQL DB
Can anyone recommend somewhere that offers cheap or even free web hosting for PHP scripting with a PGSQL database? I am looking to build a small website with some images and dynamic content, such as a forum/message board and wondered what it would cost me for this? I used to use themooseisloose for hosting (one-off payment of £2.77 GBP), but have been alerted that have gone bust (at some point at the end of last year). I've have googled, but was just wondering if anyone had any positive experiences of hosts that will allow this setup mentioned cheaply.
View Replies !
Error Management : Php-pgsql.
My goal : obtain the error message if the connection fail. ## my code : <?php $cnxString = "host=localhost port=5432 dbname=toto user=atlante password=aiThoo3g"; $pgsql_conn = pg_connect($cnxString, PGSQL_CONNECT_FORCE_NEW); if ($pgsql_conn) { print "Connexion réussie à : " . pg_host($pgsql_conn) . "<br/> "; } else { echo pg_last_notice($pgsql_conn); exit; } ?> ## if «php_value display_errors 1» the screen result is this one : Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: FATAL: la base de données «toto» n'existe pas in /home/willou/public_html/atlanpolis/wwws/tools/checkdb.php on line 5 Warning: pg_last_notice() expects parameter 1 to be resource, boolean given in /home/willou/public_html/atlanpolis/wwws/tools/checkdb.php on line 10 ## If not, i haven't got any result. The message just appears in my logs The return of pg_connect not seems to be an connection resource when the connection fails.
View Replies !
My Dad Wants PHP & MySQL Or PgSQL Hosting
To my surprise last month, my dad wanted to start dabbling in PHP and MySQL or pgSQL. I've been helping him out a bit. He's into athletic medicine and wants to have a website to help athletes and physical therapists improve performance. His current web hosting provider -- Earthlink -- doesn't give him anything but PHP 3.0.x. I want to get him at least on PHP 4.2.x (or better) along with either MySQL or PostgreSQL (pgSQL) support. I've done some googling on this, but I wanted real user opinions on cost, customer support, uptime, etc. At this point he's just looking at something that suits him somewhere between hobbyist and early sole proprietorship strength. Shared web hosting would suit him fine. Cost might be an issue for him initially. He's going to need some sort of simplistic web interface to be able to create databases, tables, and user accounts.
View Replies !
Pgsql Socket Timeout
I am encountering a problem with PHP5 and postgresql on a fedora core 3 box. I have a database driven report application written in PHP5 on a remote server. This application allows a user to submit a sql statement created by php based on user input parameters to the postgresql server. The application works great as long as the database server can return the result set within what appears to be 2 minutes. If the query takes longer than two minutes to execute the database server will eventually finish the work *but* no rows of data appear on the web page. I am thinking that the network socket connection between the php engine and the postgresql database server gets dropped after two minutes and that is way the results never arrive at the php page. If you think this might be a plausible explanation can you provide some assistance as to how I can go about adressing this problem?
View Replies !
Ubuntu Php4-pgsql
I found some strange kind of mild install bug when installing Ubuntu 5.04 php4-pgsql module (the module that connects PHP4 to PostgreSQL). You may encounter the error: Call to undefined function: pg_connect() No amount of using Synaptic Package Manager would fix this for me. The solution was all at command line under 'root' account: $ apt-get update $ apt-get install php4-pgsql $ /etc/init.d/postgresql restart $ /etc/init.d/apache2 restart
View Replies !
MySQL And PGSQL And Hostname Question
i would like the thoughts of some folks with more experience than i have. i want to learn pgsql. i have some vb and msaccess experience and would like to learn how to use php and pgsql to develop some nice website / application functionality. however, i'm not sure the hurdle of relatively miniscule documentation and tutorials is worth the effort. i'm now thinking i should just use mysql to start and, if the need really arises, move over to pgsql. i'm busy with a lot of stuff right now - regular job, starting a business, developing a web site for the business, learning graphics programs, living life, blah, blah, blah. what is your opinion? go with the better documented db and develop more quickly but have to possibly switch over later when time may be more available and retain my hair or bite the bullet and go with pgsql? differing opinions are appreciated and encouraged so i can evaluate them based on my own set of values. also i am trying to set up localhost as my url so my hardcoded links work on my local win98 machine (actual webserve is linux). host.sam is as follows... 127.0.0.1 localhost www.easyautodeals.com my apache httpd.conf file shows the following for ServerName: ServerName www.easyautodeals.com however, when i type easyautodeals into my web browser, i go straight to my actual web server and not to my "localhost" location.
View Replies !
PGSQL 7.4.8 PHP 4.3.4 & Apache 2.0.49 Segmentation Fault With Client Certs
Having an issue that is specific to PHP compiled with PGSQL support with versions noted in subject line. I understand that there are many variables to consider here but believe I have narrowed down the Apache Client Cert failures to my PHP/PGSQL build. 1. Apache PHP without PGSQL works as expected using client certificates 2. Apache PHP with PGSQL works fine with standard SSL connections 3 Apache PHP with PGSQL fails with client certificates - no output other than Segmentation faults in the apache error logs as follows: [Wed Nov 30 23:26:57 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2).... I also performed same tests on another instance of Apache/PHP/PGSQL which was version 2.0.54 of apache and PHP/PGSQL versions same as subject line with same exact results. Any ideas as to the source of this problem and suggestions for tests/fixes are greatly appreciated. There are no errors in any of the logs other than what I have included so it's very difficult to see what is wrong. All I know for sure is that I am able to reproduce the results on more than one machine.
View Replies !
PEAR Newbie Trying To User PEAR DB And Falling At The First Hurdle
I've just installed PEAR on my local machine and all is well, updated the include_path to point to my PEAR dir. So, when I just try to make a simple connection like so the script just seems to stop but no error messsages. I do get error messages normally (ie. when I can a method from an object that doesnt actually exist) as I have set...
View Replies !
Pear Shaped PEAR
I read about PEAR in here a few days ago and thought I would give it a try but I have got myself in a mess with the installation. I have found some guides but they seem to move swiftly on from installation and get down to using it. I am using PHP 5.2.3 which came with NuSPhere PhED and is installed under...
View Replies !
Go-pear.bat:okay - Pear.bat Error - 5.2.4
first attempt at PEAR installation: PHP 5.2.4 - WinXP Sp2 - Apache 2.2 the Initial instruction, post-installation [local, vs system-wide] tells me (not verbatim) "...old version found... remember to use ./php/pear.bat instead...." hence, the following command. note the feedback. Code:
View Replies !
To PEAR Or NOT To Pear?
This is just a discussion type post, I'm interesed to know your opinion and experiance with Pear Libraries, I have used some Pear libraries a while back, but not enough to form an opinion wheather it is worth it or not. Some of the question I have is scalability and performance specs, and if I ever have to switch hosts do I need to make sure they have the same version or are they usualy backward compatible... so to Pear or Not to Pear that is the question?
View Replies !
PEAR DB Help
I am currently running Windows XP Pro with PHP 5.2 and MySQL 5.0 installed. My remote server is a UNIX system with PHP 5.1 installed and MySQL 5.0 installed. Here is the code I'm trying to run: // Load up the PEAR DB class // $this->mysql = DB::connect(sprintf("%s://%s:%s@%s/%s", TYPE, USERNAME, PASSWORD, HOST, DATABASE)); echo "hello"; On my computer it works perfectly fine, returns a db_mysql class and no errors. On my server it does nothing. I put echo "hello" there as a test, and when I run the script I don't even see "hello" get printed to the screen, for some reason it's just screwing the entire script up. I checked the USERNAME, PASSWORD, etc. values against the ones I have in CPANEL and they match. Does anyone know what might be causing this problem?
View Replies !
Help For Pear
where can i find some sample code for PEAR. i have pear manual but it is not sufficient to get all details of how PEAR work.
View Replies !
OOP And Pear::DB
I am currently working on a PHP application which I am using as a personal learning environment for getting a better working understanding about how to tackle application development in an OOP/MVC pattern fashion. I am using PEAR::DB to create database connection objects, and my major question concerns where these objects should be created. For example: Let's say I have a login application that that has a controller-like script that looks something like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // login.php <?php require_once('User.class.php'); $user = new $User; $user->getAdminRights(); ?> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ....and a model-like User class that looks something like this: (The important note is that I may need to load data multiple times from a database.) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // User.class.php <?php class User { public $user_name; public $user_id; public $admin_rights = array(); protected $db_connection; function __construct() { if (!this->db_connection){ require_once(); $this->db_connection = DB::connect(DB_DSN); } $sql = "SELECT USERNAME, USER_ID FROM SOME_TABLE..."; $result = $this->dbh->getAll($sql, array($this->request_id); $this->user_name = $result['USERNAME']; $this->user_id = $result['USER_ID']; } function getAdminRights() { $sql = "SELECT * FROM SOME_TABLE WHERE ADMIN_ID = ?"; $this->admin_rights = $this->dbh->getAll($sql, array($this->user_id); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View Replies !
Pear
kann somebody tell me what i do wrong? i write this little script: <?php include_once "DB.php"; // Example: echo "Hi"; ?> then, i have the first page von "go-pear"
View Replies !
PEAR: Is It Really Necessary?
I've been using PHP for a while now but I haven't actually used PEAR. I have just read half a chapter in a book, it sounds alright but haven't actually used it. I was just wondering, is it really necessary to use PEAR? I usually get things done using PHP/MySQL. I don't know if I'm really missing out on something by not using PEAR. How highly is it recommended? On most job ads, i don't even see them mentioning PEAR. They mostly just say PHP/MySQL.. Why is that? Don't people like PEAR much?
View Replies !
Php --without-pear
Lately I started to "bravely fight" with Postfix + Squirrelmail everything works great (PHP also :)) but I want to have possibility to change passwords (from MySql database) through the webside SM has a plugin (change_sqlpass) - but it needs Pear DB installed [root@kompik ~]# rpm -q php-pear php-pear-1.4.9-1.2 [root@kompik ~]# rpm -q php-pear-DB php-pear-DB-1.7.6-6.fc5 and as You see I installed it ... but ..... PHP has no PEAR handling installed i checked through phpinfo() and there are Configure Commands and unfortunatelly there is also '--without-pear' I installed everything without to many combination using rpm-s so now i don't really know howto recompile php without this option ... i prefer not to uninstall php and compile it by myself because i would have to uninstall lots of other stuff .. Does anyone know any solution for my problem ?
View Replies !
To Pear DB Or Not To Pear DB?
i'm developing a small web app for a non-profit i'm affiliated with and i'm not sure if i want to use the pear DB abstraction layer or not. i've got a simple page currently developed w/o it, so all my database calls are using MySQL specific functions. i know that using the pear DB is good if, say, we end up changing databases down the road, but i highly doubt we will. i mean, MySQL isn't going anywhere, right? anyhow, i just simply don't like pear DB. maybe the fact that it took me a friggin hour to install it has something to do w/ that. also, i'm re-writing the simplest of code using DB functions and i'm having a hell of a time, probably b/c i have nothing but a cheesy pear manual to go by.
View Replies !
A DB.php PEAR
I am preparing a few PHP scripts conversion to registerglobals=Off And presently testing a new login script that requires PEAR I tested it on my local RH and it works fine in both configurations (with registerglobals On or Off) But on a production server that I do not manage it does not work. And does not display anything (Blank screen)In order to narrow down the problems I used <? Error_reporting (E_ALL) ;?> Which shows that my “require†for DB.PHP class does not find it. How can I find if PEAR is made available? And if it is. Is the directory that contains the PEAR files included in my include_path in my php.ini. And if so do I have to provide a path?
View Replies !
PEAR: Yes Or No
Some PEAR packages seam really cool but I worry about my code starting to be too *dependant* on PEAR if I start using it. You know, the way it handles errors, etc. What are your thoughts? Recommendations?
View Replies !
Using PEAR
im not getting into using pear but i have a problem, im not sure how it works exactly i have read the website but i contacted my shared server host they say: Please note that the path to pear package on the server is: /usr/local/lib/php/ but not sure how to incorporate that in scripts do i need to include a certain file?
View Replies !
PHP 5 And PEAR
I've been using PHP for a while now - and have recently been trying to set up PHP, MySQL and Apache on Windows (for a client). It seems like all the PEAR stuff under PHP 5 doesn't work out of the box. It took me a while to track down the go-pear.bat file in the root - what with all the other garbage in there. Shouldn't this file get at least a mention in: install.txt and /PEAR/go-pear.php The installation instructions in /PEAR/go-pear.php for Windows seem rather out of date - and sent me off in totally the wrong direction :- ( -- __________ |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.
View Replies !
All Pear
I'm using a prepare and execute sql statement. I'm curious if there is a getAll() function that can be used with the execute. Not sure if this would be advantageous if it existed, but I was thinking to try it if I could.
View Replies !
What Is PEAR?
What is the use of PEAR? How can I get it working with localhost IIS I am using PHP Version 4.3.2 Server API CGI/FastCGI I've a PEAR directory in c:/php4/includes/pear whenever I enable it in php.ini, I get errors in my php applications e.g., Fatal error: main(): Failed opening required 'mainfile.php' (include_path='C:php4includespear') in C:Inetpubwwwroot ukehtmlincludescounter.php on line 25 other examples of error: Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.;../phpwebsitelibpear') in C:InetpubwwwrootphpwebsitelibpearHTMLTemplateIT.php on line 22 Warning: main(): Failed opening '/path/to/xoops/directory/include/common.php' for inclusion (include_path='.;c:php4pear') in C:Inetpubwwwrootxoopshtmlmainfile.php on line 60
View Replies !
PEAR DB
is when no row is found: $what = $db->getOne("SELECT field FROM table WHERE 1=2"); if($what=="") echo "emptystring"; if($what==false) echo "false"; if($what==NULL) echo "null"; echo $what; echoes "emptystringfalsenull". $id = $db->getOne("SELECT id FROM table WHERE condition='fulfilled'); // this one? if($id=="") do_something(); // or this one? if($id==false) do_something(); // or that one? if($id != NULL) do_something(); else do_something_else($id).
View Replies !
PEAR Questions
Can someone explain to me exactly what PEAR is? I've been looking around for different html modules/classes and it keeps coming up, but I can't find anything that actually explains what it's all about. Also, is there a complete list of "PEAR" modules anywhere, organised in one place?
View Replies !
Pear Madness
I'm trying to install the HTTP_Request package but I get this error: ---------------------------- root@host [~]# pear install http://pear.php.net/get/HTTP_Request-1.3.0.tgz downloading HTTP_Request-1.3.0.tgz ... Starting to download HTTP_Request-1.3.0.tgz (13,808 bytes) ......done: 13,808 bytes requires package `Net_Socket' >= 1.0.2 ----------------------------- So naturally I went to install Net_Socket 1.0.6: ----------------------------- root@host [~]# pear install http://pear.php.net/get/Net_Socket-1.0.6.tgz downloading Net_Socket-1.0.6.tgz ... Starting to download Net_Socket-1.0.6.tgz (4,623 bytes) ......done: 4,623 bytes Net_Socket already installed ------------------------------ What's going on? Pear won't let me upgrade Net_Socket. Has anyone ever ran into this problem before?
View Replies !
PEAR Doesn't Seem To Be Working
I installed PHP with PEAR support on my Windows computer. I tried the snippet of the book "Learning PHP5": <?php error_reporting(E_ERROR | E_WARNING | E_PARSE); echo "test"; include 'DB.php' $db = DB::connect('mysql://penguin:top^hat@db.example.com/restaurant'); if (DB::isError($db)) { die("Can't connect: " . $db->getMessage( )); } ?> But it only prints "test", it should display an error message saying it's not able to connect to the DB. Do you know why nothing happens? Also, I think there should be a real "DB.php" file, correct? What should I put into this file? Or is it only a line "as is", that doesn't mean there needs a "DB.php" file?
View Replies !
PEAR/Info.php
I tried to use Example 49-1. Using PEAR_Info This is not showing PEAR installation information on local/remote server. What I see local, I've no file Info.php in package PEAR in PEAR directory. I've installed PEAR, why this file is missing? My Web host say, they've installed PEAR, and I can use PEAR.
View Replies !
Help On Pear Modules
First of all, I'm not a very seasoned programmer. It's just a hobby grown out of control. For a project I am working on I need to be able to send and receive e-mail. I wrote some code for this myself, but that is just not quite good enough. So I did a little research and found the Pear modules. I installed all the Pear modules that I am supposed to need, but I don't understand the documentation. Could someone please explain to me how I am supposed to compose, send, receive and identify the various parts of an incoming e-mail? I am, of course, in full control of the mailsever.
View Replies !
Must I Still Use Addslashes With PEAR DB?
I now use the DB classes from PEAR with mysql. Do I still have to use addslashes? I ask, because I get some very strange results, I get slashes in front of every " and they get saved in my database. Now my hoster has turned magic_quotes_gpc on anyway. As a workaround: On a PHP-environment where magic_quotes_gpc is turned on, can I do stripslashes on every request-data without danger? Or what is the recommended way to safely insert request-data into mysql with PEAR?
View Replies !
Emails & PHP / PEAR ?
Ive found this nifty script that does what I want - in PEAR.. (to send emails) However i'm getting an error.. - Can anyone advise a suitable course of action to correct this :-
View Replies !
PEAR Server Down?
I am unable to reach PEAR server. Here is the error message: # pear upgrade-all XML_RPC_Client: Connection to RPC server pear.php.net:80 failed. Connection timed out
View Replies !
Pear XML Serializer
I'm trying to run a script that uses the XML Serializer package but I get this error: [Mon May 15 13:14:24 2006] [error] PHP Fatal error: Call to undefined function: sethandlerobj() in /usr/local/lib/php/XML/Unserializer.php on line 852 I reinstalled the package just to be sure but no luck. I didn't edit the file so I don't know why this is happening. Anybody know what's up?
View Replies !
Mysql_num_fields To PEAR
Anyone know how to handle the while and for loops with PEAR in the code below?? // ---------------------------------------------------------------- $result = mysql_query("SELECT bus_price FROM cf where name='$name'", $connect); while ($row = mysql_fetch_row($result)) { for ($i = 0; $i < mysql_num_fields($result); $i++) { /* Hunt down instances of newline breaks and text spaces in blob field of database and replace with HTML linebreak and HTML spaces... */ $replace = str_replace(" ", " ", $row[$i]); $replace = nl2br($replace); echo "<font face = "arial, helvetica, sans-serif" size ="2"> <b>Price:</b> <br>" . $replace . " "; } } // ----------------------------------------------------------------
View Replies !
Use The Pear Db Feature In Php
I am TRYING to use the Pear db feature in php to build a signon script. I am on PHP 4.2.1, APACHE 1.3.26 AND MYSQL On Win ME. While executing the db connect function( "require_once db.php" )it gives an error, "Undefined Class Name 'db' in SCRIPT blah blah. The script looks like this: Code:
View Replies !
PEAR DB 1.6.0 Has Been Released
[This has be cross-posted. Be careful when following up, please.] Greetings: Crack open the beer, PEAR DB 1.6.0 is here! (Hey, I'm a bit giddy with excitement that my intense work during the past seven weeks has come to fruition.) For those unfamiliar with PEAR DB, it's a package of PHP classes that provide an object oriented API with common methods of accessing thirteen of PHP's database driver extensions: dBase, FrontBase, InterBase, Informix, mSQL, MS SQL Server, MySQL, Oracle, ODBC (tested with DB2 and Access), PostgreSQL, SQLite and Sybase. Key links for PEAR DB: Download: http://pear.php.net/get/DB Change Log: http://pear.php.net/package-changelog.php?package=DB Manual: http://pear.php.net/manual/en/package.database.php Home Page: http://pear.php.net/package/DB Notable changes since 1.5.0RC2 include: * New portability features, making it possible to write applications which can be easily ported between DBMS's. * Tons of bug fixes, making the package actually work for more than just MySQL systems. * Improved error reporting. * Getting prepare/execute to work the same way for all DBMS's and allow escaping of placeholder characters. * Deploying tableInfo() in more drivers and officially moving it from DB_result to DB_common. See the documentation for proper usage. * Making the test suite simpler to use and work on both windows and *nix platforms. * Various optimizations, several of which were uncovered using Zend Studio's Code Analyzer. * Countless documentation corrections. * Full PHP 5 compatibility. * Requiring PHP to be at version 4.2.0 or higher. * Deprecating quote() and quoteString(). If you're one of the lucky few people using PHP's mysqli extension, do note that the DB file/class has been renamed from mysql4 to mysqli, but the online documentation won't reflect this modification until they're rebuilt on Sunday. Similarly, there are a few other features and documentation bugs that won't show up there until then either.
View Replies !
PEAR::Config
I'm writing a little app for my personal use and want to store the configuration data in an xml file. I found PEAR::Config that lets me read the config data into my app. But so far, I haven't figured out how to get modifcations back to the xml file. Here's what I've got so far. I ran across this basic code in an article at DevShed. <?php require_once 'Config.php' $conf = new Config; $root =& $conf->parseConfig('/usr/local/apache/myapp.xml', 'XML'); if (PEAR::isError($root)) { die('Error while reading configuration: ' . $root->getMessage()); } $settings = $root->toArray(); printf('User settings<br>'); printf('=============<br>'); printf('dbhost: %s<br>',$settings['root']['connect']['dbhost']); printf('dbuser: %s<br>',$settings['root']['connect']['dbuser']); printf('dbpass: %s<br>',$settings['root']['connect']['dbpass']); printf('dbname: %s<br>',$settings['root']['connect']['dbname']); $conf->writeConfig('/usr/local/apache/myapp.xml', 'XML'); ?> What I want to able to do is modify the values in the settings array (not the problem) and the write them back out to the xml file. I understand that it takes all the data from the root level and assigns it to an array called $settings. What I'm having trouble with is getting $settings back to the file. Has anyone else used PEAR::Config doing this sort of thing?
View Replies !
Upgrading PEAR
I see some references to this on the web but I can not find a specifically what the fix is - please, I need to know specifically what I do to fix it. I'm using win2k. Here's the error message I get when I try go-pear.bat, I upgraded from PHP4 to 5, seems to all work except for PEAR: Unknown(): (null): Unable to initialize module Module compiled with module API=20040412, debug=0, thread-safety=1 PHP compiled with module API=20020429, debug=0, thread-safety=1 These options need to match Edit/Delete Message
View Replies !
PEAR Conflict
Iam running a server and PEAR is compiled with PHP. Before some days I have upgraded PHP from 4.3.4 to 4.3.7 using Apache update from WHM (cPanel). This went well but after that one client contacted me to tell me that he have problems with showing some variables. The thing is that he told me that he is using his own PEAR installation in his web hosting account ! This is part of the code which had a problem: $ID_rubrike =$row[ID]; //THIS VARIABLE NOT SHOWING $ID_stranice =$row[ID_stranice]; //THIS VARIABLE NOT SHOWING $tip_vijesti =$row[$naziv_tablica];//THIS VARIABLE WORKING OK Problem was found but it is weird. In his configuration od DB.php file following value was changed : define('DB_PORTABILITY_LOWERCASE', 0); This value was somehow set to "1" so "ID" was watched as "id" Then he change it back to "0" and it is OK now. I inspect server's PEAR installation under PHP and found that this value default is "1" . But it seems that his scripts are using his PEAR installation and not server PEAR.
View Replies !
|