473,811 Members | 3,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(DAT ASOURCE);

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*****@alussin an.org

Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
Jul 17 '05 #1
3 1992
In article <pa************ *************** *@usenet.baguet te.net>, Bruno Baguette wrote:
$db = DB::connect(DAT ASOURCE);
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.baguet te.net>, Bruno
Baguette wrote:
$db = DB::connect(DAT ASOURCE);


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(DAT ASOURCE);

Even if I put an echo('Foo'); after that line, the echo is not
displayed... All lines after the $db = DB::connect(DAT ASOURCE) 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*****@alussin an.org

Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
Jul 17 '05 #3
In article <pa************ *************** *@usenet.baguet te.net>,
Bruno Baguette <bo*****@alussi nan.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
2401
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 . I've those two piece of code, the first is part of a class: --------- function connect($layer,$host,$db_port,$db_name,$user,$pass) { $dsn = "$layer://$user:$pass@$host:$db_port/$db_name";
0
1513
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 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,
0
1365
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 = DB::connect($dsn); echo $db->getMessage(); if(DB::isError($db))
3
2896
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 now closes the database connections of _all_ database objects. I ask myself if this is intentional or a bug. Below a code example: 01 <?php 02   error_reporting(E_ALL);
1
2779
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 calls fail no matter which SP is called first it always works, and the rest fail... with: >>>
4
2760
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
3509
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 (DB::isError($db)) { die ("Can't connect: " . $db->getMessage()); }
5
3569
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 WHERE name LIKE '%?'
2
2071
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 for the database connection. the problem is that it don't works, actually the php don't writes anything in the table and i don't get any error when i add the if (PEAR::isError($db)) { die($db->getMessage());} code, so not the connection... Then i...
0
10651
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.