473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PEAR::DB kill the script or crashes PHP ?

Hello,

I've a strange problem using PEAR::DB (even with the latest version). Our
PHP version is 4.3.4.

The above line stop the PHP script execution or crashes PHP (I don't know
exactly) when the script is runned throught the browser (so, via Apache) :

$db = DB::connect(DATASOURCE);

I don't have any error message, any traces in the Apache error_log... The
page is WHITE... :-/

But, if use the linux console to cat the php script to apache (cat
script.php | php) the script is running very well... If I use the native
PHP PostgreSQL functions pg_*, everything runs perfectly (in console or
via the browser)

Do you have any idea to solve that problem (except from removing all the
PEAR modules from our application) ?

Thanks in advance for your help !
PS : We are currently removing ALL the PEAR modules from our application,
but since the application is large this will take a while to do.

--
----------------------------------------
Bruno Baguette - bo*****@alussinan.org

Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
Jul 17 '05 #1
3 1974
In article <pa****************************@usenet.baguette.ne t>, Bruno Baguette wrote:
$db = DB::connect(DATASOURCE);
And what does DB::IsError($db) tell?
But, if use the linux console to cat the php script to apache (cat
script.php | php) the script is running very well...


That looks like excessive use of cat,
What's wrong with user@host: /usr/bin/php script.php ?
--
http://home.mysth.be/~timvw
Jul 17 '05 #2
Le Tue, 27 Apr 2004 19:51:14 +0000, Tim Van Wassenhove a écrit :
In article <pa****************************@usenet.baguette.ne t>, Bruno
Baguette wrote:
$db = DB::connect(DATASOURCE);


And what does DB::IsError($db) tell?


Nothing, absolutely nothing... In fact, the script seems to be "killed"
(or PHP crashed) just when I do the $db = DB::connect(DATASOURCE);

Even if I put an echo('Foo'); after that line, the echo is not
displayed... All lines after the $db = DB::connect(DATASOURCE) are not
executed.
But, if use the linux console to cat the php script to apache (cat
script.php | php) the script is running very well...


That looks like excessive use of cat, What's wrong with user@host:
/usr/bin/php script.php ?


php script.php runs perfectly without any problems (DB connection and SQL
queries are done).

My problem only occurs when the script is runned via the Apache server
using the browser. And there isn't any errors in the error_log file.

Any idea about that problem ?

Thanks in advance !

--
----------------------------------------
Bruno Baguette - bo*****@alussinan.org

Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
Jul 17 '05 #3
In article <pa****************************@usenet.baguette.ne t>,
Bruno Baguette <bo*****@alussinan.org> wrote:
PS : We are currently removing ALL the PEAR modules from our application,
but since the application is large this will take a while to do.


Just out of curiosity, why is that? I'm at the moment switching from
mysql_* specific functions to PEAR::DB. I like PEAR's error handling and
the many convenient DB 'shortcut' methods ($db_object->getOne(), et al.).

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kain | last post by:
hi there, I'm currently converting a MySQL application to PostgreSQL, and I hacked this app to support PEAR::Db . after some good coding days, I've found a problem: mysql_insert_id on pear::db ....
0
by: Analysis&Solutions | last post by:
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...
0
by: Derek Battams | last post by:
With PHP5RC2, DB::connect() is not returning the correct type of object. #!/usr/local/bin/php <?php require_once("DB.php"); $dsn = "odbc://db2inst1:badpasswd@testdb"; $db =...
3
by: Sven Jacobs | last post by:
Dear newsgroup, I've upgraded to PEAR::DB 1.6.5 recently. Unfortunately now the database connection doesn't work as expected anymore :( The problems seems to be the method disconnect(), which...
1
by: James | last post by:
Hey everyone, I have a really obscure but impassable problem with a reasonably simple piece of php/PEAR DB/MySQL code When calling several stored procs the first call succeeds, but subsequent...
4
by: andy | last post by:
Hey All, 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";
3
by: mpar612 | last post by:
I am stumped. Below is my code and it doesn't work (I removed the $login info for posting). PHP Code: require 'PEAR/DB.php'; // Connect to the database $db = DB::connect($login); if...
5
by: jmark | last post by:
I need some assistance on how to create a select statement using PEAR DB or MySQL with the LIKE function. That is I am looking of how I can get statement like this work. SELECT * FROM customer...
2
by: daralthus | last post by:
Hello! I would like to ask your help, i have founded a great code here: http://www.jamescaws.co.uk/2008/07/dynamically-count-exit-link-clicks-throughs-using-javascript-php/ but it uses Pear DB...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.