473,789 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Postgres php segfault

IDK
I have the following code:
<?
#!/usr/bin/php-cgi -e

$dbconn = pg_pconnect("ho st=localhost dbname=zerus ".
"user=zuser password=1")
or die('Could not connect: ' . pg_last_error() );

pg_close($dbcon n);
echo "B"
?>
*************** *************** *************** ******
And I get the following output:
X-Powered-By: PHP/5.2.3-1+b1
Content-type: text/html

BSegmentation fault

I'm using the php 5.2.3-1+b1 and postgres 8.2.4-2.

This has to be some destruction fault with postgres/php...

I don't get any message when I use mod_php...

Is there any fix or does someone know why this happens?

Jul 10 '07 #1
4 1771
IDK wrote:
This has to be some destruction fault with postgres/php...
What happens using plain old pg_connect?

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 19 days, 21:42.]

demiblog 0.2.0 Released
http://tobyinkster.co.uk/blog/2007/0...emiblog-0.2.0/
Jul 10 '07 #2
IDK
On Jul 10, 8:03 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
wrote:
IDK wrote:
This has to be some destruction fault with postgres/php...

What happens using plain old pg_connect?

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 19 days, 21:42.]

demiblog 0.2.0 Released
http://tobyinkster.co.uk/blog/2007/0...emiblog-0.2.0/
Nice thought, but it gives the same error...

I didn't get this error like yesterday.
I did change some configuration files the day before yesterday,
so I removed all config files and uninstalled php-cgi,
and then reinstalled, just to be sure, but the segfault persists...

Jul 10 '07 #3
IDK wrote:
I didn't get this error like yesterday.
Does this script output the same in both mod_php and php-cgi?

<?php
echo posix_getuid(). "\n";
echo posix_getgid(). "\n";
echo posix_geteuid() ."\n";
echo posix_getegid() ."\n";
echo get_cfg_var('ex tension_dir')." \n";
echo phpversion()."\ n";
echo phpversion('pgs ql')."\n";
?>

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 20 days, 17:17.]

demiblog 0.2.0 Released
http://tobyinkster.co.uk/blog/2007/0...emiblog-0.2.0/
Jul 11 '07 #4
IDK
On Jul 11, 3:50 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
wrote:
IDK wrote:
I didn't get this error like yesterday.

Does this script output the same in both mod_php and php-cgi?

<?php
echo posix_getuid(). "\n";
echo posix_getgid(). "\n";
echo posix_geteuid() ."\n";
echo posix_getegid() ."\n";
echo get_cfg_var('ex tension_dir')." \n";
echo phpversion()."\ n";
echo phpversion('pgs ql')."\n";
?>
When I run the script with mod_php I get the following output:
#!/usr/bin/php-cgi 33 33 33 33 5.2.3-1+b1

And then take a look at the following session:

idk@scaleo:/var/www/zerus$ ./test2
X-Powered-By: PHP/5.2.3-1+b1
Content-type: text/html

1000
1000
1000
1000

5.2.3-1+b1
idk@scaleo:/var/www/zerus$ sudo su www-data
sh-3.1$ ./test2
X-Powered-By: PHP/5.2.3-1+b1
Content-type: text/html

33
33
33
33

5.2.3-1+b1
sh-3.1$ ./test
X-Powered-By: PHP/5.2.3-1+b1
Content-type: text/html
Segmentation fault
sh-3.1$

Which means that group id and user id doesn't matter...

The other values are as you see null, which cannot be good...

Jul 12 '07 #5

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

Similar topics

12
3163
by: Nathaniel Echols | last post by:
I've written a function in C to perform protein sequence alignment. This works fine in a standalone C program. I've added the necessary packaging to use it in Python; it returns three strings and an integer. However, as soon as the function is complete, I get a segfault and the interpreter dies. If I run Python interactively, just calling the function causes a segfault. If I'm running a script, I can actually print out the return...
6
1988
by: Stefan Behnel | last post by:
Hi! In Python 2.4b3, the deque is causing a segfault on two different machines I tested on. With deque, my program runs fine for a while (at least some tens of seconds up to minutes) and then suddenly segfaults. I'm sorry I can't tell exactly when, but I'm running an application that uses a few hundred deques where elements are appendleft()ed and pop()ed (simple queue). As the application is rather complex (and I didn't read about this...
0
1822
by: dale | last post by:
Python newbie disclaimer on I am running an app with Tkinter screen in one thread and command-line input in another thread using raw_input(). First question - is this legal, should it run without issue? If not can you point me to a description of why. While updating objects on the screen I get a segfault after an indeterminate number of updates. It doesn't seem to matter how quickly the updates occur, but it does segfault faster...
7
6668
by: Abdul-Wahid Paterson | last post by:
Hi, I have had a site working for the last 2 years and have had no problems until at the weekend I replace my database server with a newer one. The database migration went like a dream and I had the whole db changed over in 1 hour. Since the upgrade I have been getting the following error message sporadically.
10
1956
by: name | last post by:
When I started testing the algorithms for my wrap program, I threw together this snippet of code, which works quite well. Except that it (predictably) segfaults at the end when it tries to go beyond the file. At some point, I tried to mend that behavior using feof() but without success. The functionality is not harmed, but this has started to bug me. What am I missing here? Sometimes being a code duffer is frustrating!! lol!!! The...
3
8705
by: warwick.poole | last post by:
I am interested in finding out about Enterprise scale Postgres installations and clustering, especially on Linux. Essentially I would like to know the possibility that Postgres can store the database data in a central location (ex: on a SAN fiber array) and have a cluster of machines sharing processor/RAM/IO bandwidth to do the application processing. Or perhaps there is another solution similar to what www.emicnetworks.com have...
18
5155
by: Joe Lester | last post by:
This thread was renamed. It used to be: "shared_buffers Question". The old thread kind of died out. I'm hoping to get some more direction by rephrasing the problem, along with some extra observations I've recently made. The core of the problem is that Postgres is filling up my hard drive with swap files at the rate of around 3 to 7 GB per week (that's Gigabytes not Megabytes) . At this rate it takes roughly two months to fill up my 40...
3
2309
by: kj | last post by:
I am trying to diagnose a bug in my code, but I can't understand what's going on. I've narrowed things down to this: I have a function, say foo, whose signature looks something like: int foo( int w, int x, int y, int z, my_struct **results ) During its execution, foo initializes *results using calloc: ( *results ) = calloc( w+1, sizeof( my_struct ) );
0
2706
by: NM | last post by:
Hello, I've got a problem inserting binary objects into the postgres database. I have binary objects (e.g. images or smth else) of any size which I want to insert into the database. Funny is it works for files larger than 8000 Bytes. If a file is less than 1000 Bytes I get the following message: Error message: --invalid input syntax for type oid: "\074\077......";
0
9663
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10404
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
10195
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...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9979
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
9016
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...
0
6765
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4090
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

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.