php-general Digest 19 Dec 2007 09:28:24 -0000 Issue 5189

Topics (messages 266048 through 266064):

Re: Generating Random Numbers with Normal Distribution
        266048 by: Travis L. Font
        266049 by: Daniel Brown
        266062 by: Robert Cummings

About PHP Implements
        266050 by: Jim Webber
        266051 by: Chris
        266052 by: Nathan Nobbe

Re: export data to a ms excel file using php
        266053 by: Chris

Re: control browser with <a href> tag
        266054 by: Richard Lynch
        266059 by: Andrés Robinet

Re: Select Box CSS OT
        266055 by: Richard Lynch
        266058 by: Børge Holen

Re: Just to confirm...
        266056 by: Richard Lynch

Re: Ham marked as Spam with BAYES_99 - PhpMailer to old?
        266057 by: Richard Lynch

Re: php sockets
        266060 by: vixle
        266061 by: vixle

Re: php with threaded MPM problem ?
        266063 by: Rashmi Badan
        266064 by: Jochem Maas

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Here's random! I'm going to close my eyes think of some drinking water
and running AT the same time and just start pushing numbers on the pad
however way my fingers desire while not thinking about it!

Here: 79148888718845748671454531587148354531452141857

 

Good enough?

 

-Travis


--- End Message ---
--- Begin Message ---
On Dec 18, 2007 4:24 PM, Travis L. Font <[EMAIL PROTECTED]> wrote:
> Here's random! I'm going to close my eyes think of some drinking water
> and running AT the same time and just start pushing numbers on the pad
> however way my fingers desire while not thinking about it!
>
> Here: 79148888718845748671454531587148354531452141857
>
>
>
> Good enough?

    No.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
On Tue, 2007-12-18 at 16:26 -0500, Daniel Brown wrote:
> On Dec 18, 2007 4:24 PM, Travis L. Font <[EMAIL PROTECTED]> wrote:
> > Here's random! I'm going to close my eyes think of some drinking water
> > and running AT the same time and just start pushing numbers on the pad
> > however way my fingers desire while not thinking about it!
> >
> > Here: 79148888718845748671454531587148354531452141857
> >
> >
> >
> > Good enough?
> 
>     No.

* Must resist the being sucked back into this thread *

...

Yes, I realize the obvious contradiction :)

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

--- End Message ---
--- Begin Message --- Hello I have a PHP4 server and I'm trying to figure out how to do "implements" on classes. Is there an analogous way to do this without PHP5 installed?
--- End Message ---
--- Begin Message ---
Jim Webber wrote:
Hello I have a PHP4 server and I'm trying to figure out how to do "implements" on classes. Is there an analogous way to do this without PHP5 installed?

If you're using inheritance and child classes you could do it in a way, eg:

class parent_class
{
  function x()
  {
    echo 'You need to override this fn in your child class';
  }
}

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
On Dec 18, 2007 5:45 PM, Chris <[EMAIL PROTECTED]> wrote:

> Jim Webber wrote:
> > Hello I have a PHP4 server and I'm trying to figure out how to do
> > "implements" on classes. Is there an analogous way to do this without
> > PHP5 installed?
>
> If you're using inheritance and child classes you could do it in a way,
> eg:
>
> class parent_class
> {
>   function x()
>   {
>     echo 'You need to override this fn in your child class';
>   }
> }
>

except that you have to waste usage of the extends keyword just to
'implement' parent_class.  you can only implement one interface in this way.
there is no way to reasonably emulate the interface construct in php4.
in c++ you can emulate the interface construct by having a class that is
entirely virtual, but too bad; php4 doesnt have abstract classes either.
i recommend an upgrade to php5.

-nathan

--- End Message ---
--- Begin Message ---
abderrazzak nejeoui wrote:
can you help me to export data to a ms excel file using php. i tried to
export them to an html format and change the extension to .xls that's work
but i have lost the formatting

excel and the navigator doesn't interpret my code in the same why (celles
are not in the same size)

http://pear.php.net/package/Spreadsheet_Excel_Writer might work well.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---

On Tue, December 18, 2007 12:23 pm, Hiep Nguyen wrote:
> hi friends,
>
> i have two pages: list.php and update.php
>
> list.php will have a hyper link that when click on, it will open a new
> window for user to update info.  once user clicks update button on
> update.php page, i want to close update.php and return to list.php.
> however if user doesn't click update button, i don't want user to go
> back to list.php.  in other word, freeze up list.php until user closes
> or clicks update button on update.php.
>
> is this possible to do with php?

It's not even possible with a browser and HTTP, whether PHP is in the
picture or not...

You're describing a desktop application behaviour.

Stop doing that; You'll just make yourself and your users miserable.

Write a web application.  It's different.

Don't popup a new window unless you absolutely have to.  If I want a
new window, I'll use right-click and do it myself.

Don't try to "freeze" up the list (you can't anyway) cuz I might want
to look at other things in the list to decide how to correctly update
the original anyway.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Richard Lynch [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 18, 2007 11:57 PM
> To: Hiep Nguyen
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] control browser with <a href> tag
> 
> 
> 
> On Tue, December 18, 2007 12:23 pm, Hiep Nguyen wrote:
> > hi friends,
> >
> > i have two pages: list.php and update.php
> >
> > list.php will have a hyper link that when click on, it will open a
> new
> > window for user to update info.  once user clicks update button on
> > update.php page, i want to close update.php and return to list.php.
> > however if user doesn't click update button, i don't want user to go
> > back to list.php.  in other word, freeze up list.php until user
> closes
> > or clicks update button on update.php.
> >
> > is this possible to do with php?
> 
> It's not even possible with a browser and HTTP, whether PHP is in the
> picture or not...
> 
> You're describing a desktop application behaviour.
> 
> Stop doing that; You'll just make yourself and your users miserable.
> 
> Write a web application.  It's different.
> 
> Don't popup a new window unless you absolutely have to.  If I want a
> new window, I'll use right-click and do it myself.
> 
> Don't try to "freeze" up the list (you can't anyway) cuz I might want
> to look at other things in the list to decide how to correctly update
> the original anyway.
> 
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
> 
> --

I agree on the point that you should not try to achieve the behavior "with
PHP alone", for the rest of it... I disagree.
Why do users have to rethink application behavior? Sure, the web environment
is different, there is a clear barrier between client and server... but what
do "end users" have to do with all of that? Moreover, why we, developers,
have to rethink UI and application design when we switch from desktop to the
web?

I think we shouldn't... it's only the "legacy stuff" we had to tolerate year
after year, once the web became a massive thing. But now things are
evolving, do things like Web 2.0, Ajax, Adobe Air, Mono, Silverlight, and
the .Net Framework sound familiar to you (yes, the last two are created by
the crappy M$ that we all know)? Because as far as I can see, an effort is
been made everywhere to shorten the desktop-web distance.
Why is CSS, XML and JavaScript so popular these days? We hated them some
years ago, didn't we? They help to shorten the distance now, don't they?

Yes, browsers are a mess to deal with, but they are not as much of a mess as
they where some time ago, and we have some good abstraction layers such as
PrototypeJS, JQuery and Mootools; and... at least we have now IE 7, which is
a big step forward for M$ (despite being buggy as EVERY BROWSER IS), and
Firefox and Opera... or are you going to tell me you still use HTML 3, PHP
3, MySQL 2 and put "This site looks better in Firefox, Get Firefox Now!"
buttons in your websites?

Have you tried ExtJS or the Yahoo UI?... Why is everyone using this "geeky"
stuff?. I believe we should take the desktop-web distance as a "temporary
fact" that can be fixed to some extent, and keep that in mind... but THAT'S
ALL. We must also be prepared for evolution, listen to the trends, and try a
bit with the "new kids on the block"...because evolution will happen, and
we'll either be in or out of the "standard"... because the standard will
change.

All the above sh_t said to Richard (just an opinion, hope you don't take it
wrong), this last paragraph is for the original user. I would search in a
JavaScript forum for a way to "mask" the existing contents, open a DHTML
window on top with a form in it, validate the form (maybe Ajax, maybe only
JavaScript, it depends on what you need to validate) and then if it passes
the test remove the mask and return to the old contents. Otherwise, for a
straightforward solution, that makes use of this "mask thing" give a try to
the form components in ExtJS (if you feel like you can handle JavaScript
very well... of course). If you don't find your way... then you are not
ready and you'd probably better off by creating two pages, so you make the
user move from one to the other and back again... so unless the user fills
in the correct data, you don't display the original form again, but the
"data input" form every time. A last resort, may involve using a regular
"pop-up" window, but the only way to make it "truly modal" is in IE for the
PC (I think).

Happy coding
(and read more, so you'll ask better questions ;)) 

Rob

P.S. You'll see no links in this email... but you can use google to find the
resources

--- End Message ---
--- Begin Message ---
On Tue, December 18, 2007 2:06 pm, Børge Holen wrote:
> On Tuesday 18 December 2007 20:03:53 Stut wrote:
>> VamVan wrote:
>> > Please apologize for sending this question to PHP forums.
>>
>> If you know this already why ask the question here? Also, this is
>> not a
>> forum.
>>
>> > But I would appreciate it very much if some could please help me
>> styling
>> > <select mutiple> in HTMl with CSS?
>> >
>> > I have .selectmulti { border: 1px solid #c9c9c9 } this code but it
>> only
>> > works in firefox How can I make this work in IE?
>> >
>> > And also I want to change the selected color.
>>
>> AFAIK this can't be done without some very nasty code due to the way
>> IE
>> renders select elements. Google has the answer if you really want
>> it.
>
> Trinity renders shit, but for gods sake I would prefer if gecko would
> render
> atleast acid2 and keep up with the demands of the stylists, before
> they call
> themselves better than others. But then again, neither webkit or khtml
> is as
> versatile as the other two.
> Anyone with thoughts on opera...

All the browsers suck.

They are all rushing half-baked "features" to market instead of
focussing on quality user experience.

Opera just sucks in different ways.  No worse, no better.

ymmv

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Wednesday 19 December 2007 03:59:11 Richard Lynch wrote:
> On Tue, December 18, 2007 2:06 pm, Børge Holen wrote:
> > On Tuesday 18 December 2007 20:03:53 Stut wrote:
> >> VamVan wrote:
> >> > Please apologize for sending this question to PHP forums.
> >>
> >> If you know this already why ask the question here? Also, this is
> >> not a
> >> forum.
> >>
> >> > But I would appreciate it very much if some could please help me
> >>
> >> styling
> >>
> >> > <select mutiple> in HTMl with CSS?
> >> >
> >> > I have .selectmulti { border: 1px solid #c9c9c9 } this code but it
> >>
> >> only
> >>
> >> > works in firefox How can I make this work in IE?
> >> >
> >> > And also I want to change the selected color.
> >>
> >> AFAIK this can't be done without some very nasty code due to the way
> >> IE
> >> renders select elements. Google has the answer if you really want
> >> it.
> >
> > Trinity renders shit, but for gods sake I would prefer if gecko would
> > render
> > atleast acid2 and keep up with the demands of the stylists, before
> > they call
> > themselves better than others. But then again, neither webkit or khtml
> > is as
> > versatile as the other two.
> > Anyone with thoughts on opera...
>
> All the browsers suck.
>
> They are all rushing half-baked "features" to market instead of
> focussing on quality user experience.
>
> Opera just sucks in different ways.  No worse, no better.
>
> ymmv

lol, the suckiness scale close to tips to the point where it almost f*s up on 
serverside ;D

>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?



-- 
---
Børge Holen
http://www.arivene.net

--- End Message ---
--- Begin Message ---
On Tue, December 18, 2007 9:17 am, Richard Heyes wrote:
> Emails that bounce get sent back to the address in the Return-Path:
> header. Correct?

Depends on who is following which standards from which era...

There was an "Error-to:" header that was popular for awhile, and...

I don't think you can safely assume all email clients/muas/mtas are
going to actually follow the same standard you are reading, much less
follow it correctly. :-)

ymmv

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Tue, December 18, 2007 8:41 am, Merlin Morgenstern wrote:
> I am running a small community page with PHP. Members can select
> notification e-mails on comments etc.
>
> Since today those e-mails - or basically all e-mails from the system -
> get taged as spam with a score of 3.5 that totally results to
> BAYES_99.
>
> How come? I am using PHP-Mailer 1.73. I am wondering if this will go
> away if I upgrade to 2.0. However I would rather not like to do that
> as a .0 release makes me a bit worried.
>
> Does anybody have an idea on how to eleminate that BAYES_99 score?
> Those
> mails are absolutly no spam. They contain a link to the commment page
> but that should not be the problem. At least it was not a problem for
> the last years.
>
> Any ideas?

Bayes usually refers to the Bayseian (sp?) algorithm where the system
"learns" what is junk based on users' marking things as spam.

So if you add a bunch of people to your list that don't expect to be
on it, and they all mark your email as spam, whammo, all your emails
are marked as spam.

Or so I understand it...

Or possibly mis-understand it. :-v

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
this code doesn't interact with with php client while with c++ based one it
works just fine.
.....anybody?
#include <stdio.h>
#include <winsock2.h>
#include <iostream>
#include <process.h>
using namespace std;
int i = 0;
int ar = 0;
const int is = 50;
SOCKET stack[is];
void clientserve(void* ws)
{
   SOCKET wsocket = *(SOCKET*)ws;
   int fgotused = 0;
   char sendbuf[70];
   char recvbuf[70];
   int scnt = 0;
   ar++;
   int id = ar;
   while(scnt <= ar)
   {
      if(stack[scnt] == 0)
      {
         stack[scnt] = wsocket;
         id = scnt;
         fgotused = 1;
         scnt = 0;
         break;
      }
      scnt++;
   }
   if(fgotused == 0)
      stack[id] = wsocket;
   send(stack[id], "Server message: You are now successfuly connected.", 70,
0 );
   while(1)
   {
      scnt = 0;
      if(recv(wsocket, recvbuf, 70, 0 ) == SOCKET_ERROR)
      {
         if(WSAGetLastError() == WSAECONNRESET)
         {
            i--;
            stack[id] = 0;
            cout << "Client Disconnected." << endl;
            cout << "Clients connected: " << i << endl;
            closesocket(wsocket);
            return;
         }
      }
      if(recvbuf)
      {
         cout << recvbuf << endl;
         while(scnt <= ar)
         {
            if(scnt != id)
               send(stack[scnt], recvbuf, 70, 0);
            scnt++;
         }
         recvbuf = null;
      }
   }
}
void main()
{
   WSADATA wsaData;
   int iResult = WSAStartup(MAKEWORD(2,2),&wsaData);
   if (iResult != NO_ERROR)
      printf("Error at WSAStartup()\n");
   SOCKET m_socket;
   m_socket = socket (AF_INET, SOCK_STREAM, 0);
   if (m_socket == INVALID_SOCKET)
   {
      printf("Error at socket(): %ld\n", WSAGetLastError());
      WSACleanup();
      return;
   }
   sockaddr_in service;
   service.sin_family = AF_INET;
   service.sin_addr.s_addr = inet_addr("127.0.0.1");
   service.sin_port = htons(27015);
   if (bind(m_socket,(SOCKADDR*)&service, sizeof(service)) == SOCKET_ERROR)
   {
      printf("bind() failed.\n");
      closesocket(m_socket);
      return;
   }
   if (listen(m_socket, 700) == SOCKET_ERROR)
      printf( "Error listening on socket.\n");
   SOCKET AcceptSocket;
   printf("Waiting for a client to connect...\n");
   while (AcceptSocket = accept(m_socket, NULL, NULL))
   {
      i++;
      cout << "Client Connected." << endl;
      cout << "Clients connected: " << i << endl;
      _beginthread(clientserve, 0, (void*)&AcceptSocket);
   }
}

""vixle"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> <?php
>
> /* Get the port for the WWW service. */
> //$service_port = getservbyname('www', 'tcp');
>
> /* Get the IP address for the target host. */
> //$address = gethostbyname('www.example.com');
>
> /* Create a TCP/IP socket. */
> $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> //echo "Attempting to connect to '$address' on port '$service_port'...";
> $result = socket_connect($socket, "127.0.0.1", "27015");
>
> socket_RECV($socket, $read, 300, null);
>   echo $read;
> socket_close($socket);
> ?>
>
> i have a daemon running on that port that sends a message when it's  got a 
> client connected
> but the script above doesn't output anything it just loads my cpu up to 
> 100 percent and thats it then it basically stops working. While i need it 
> to display the messages sent by server(daemon) to the user running the 
> script has anyone got any idea why it rejects to work? (yeah the daemon is 
> written in c++ if that matters) 

--- End Message ---
--- Begin Message ---
this code doesn't interact with php client while with c++ based one it
works just fine.
.....anybody?
#include <stdio.h>
#include <winsock2.h>
#include <iostream>
#include <process.h>
using namespace std;
int i = 0;
int ar = 0;
const int is = 50;
SOCKET stack[is];
void clientserve(void* ws)
{
   SOCKET wsocket = *(SOCKET*)ws;
   int fgotused = 0;
   char sendbuf[70];
   char recvbuf[70];
   int scnt = 0;
   ar++;
   int id = ar;
   while(scnt <= ar)
   {
      if(stack[scnt] == 0)
      {
         stack[scnt] = wsocket;
         id = scnt;
         fgotused = 1;
         scnt = 0;
         break;
      }
      scnt++;
   }
   if(fgotused == 0)
      stack[id] = wsocket;
   send(stack[id], "Server message: You are now successfuly connected.", 70,
0 );
   while(1)
   {
      scnt = 0;
      if(recv(wsocket, recvbuf, 70, 0 ) == SOCKET_ERROR)
      {
         if(WSAGetLastError() == WSAECONNRESET)
         {
            i--;
            stack[id] = 0;
            cout << "Client Disconnected." << endl;
            cout << "Clients connected: " << i << endl;
            closesocket(wsocket);
            return;
         }
      }
      if(recvbuf)
      {
         cout << recvbuf << endl;
         while(scnt <= ar)
         {
            if(scnt != id)
               send(stack[scnt], recvbuf, 70, 0);
            scnt++;
         }
         recvbuf = null;
      }
   }
}
void main()
{
   WSADATA wsaData;
   int iResult = WSAStartup(MAKEWORD(2,2),&wsaData);
   if (iResult != NO_ERROR)
      printf("Error at WSAStartup()\n");
   SOCKET m_socket;
   m_socket = socket (AF_INET, SOCK_STREAM, 0);
   if (m_socket == INVALID_SOCKET)
   {
      printf("Error at socket(): %ld\n", WSAGetLastError());
      WSACleanup();
      return;
   }
   sockaddr_in service;
   service.sin_family = AF_INET;
   service.sin_addr.s_addr = inet_addr("127.0.0.1");
   service.sin_port = htons(27015);
   if (bind(m_socket,(SOCKADDR*)&service, sizeof(service)) == SOCKET_ERROR)
   {
      printf("bind() failed.\n");
      closesocket(m_socket);
      return;
   }
   if (listen(m_socket, 700) == SOCKET_ERROR)
      printf( "Error listening on socket.\n");
   SOCKET AcceptSocket;
   printf("Waiting for a client to connect...\n");
   while (AcceptSocket = accept(m_socket, NULL, NULL))
   {
      i++;
      cout << "Client Connected." << endl;
      cout << "Clients connected: " << i << endl;
      _beginthread(clientserve, 0, (void*)&AcceptSocket);
   }
}
""vixle"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> <?php
>
> /* Get the port for the WWW service. */
> //$service_port = getservbyname('www', 'tcp');
>
> /* Get the IP address for the target host. */
> //$address = gethostbyname('www.example.com');
>
> /* Create a TCP/IP socket. */
> $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> //echo "Attempting to connect to '$address' on port '$service_port'...";
> $result = socket_connect($socket, "127.0.0.1", "27015");
>
> socket_RECV($socket, $read, 300, null);
>   echo $read;
> socket_close($socket);
> ?>
>
> i have a daemon running on that port that sends a message when it's  got a 
> client connected
> but the script above doesn't output anything it just loads my cpu up to 
> 100 percent and thats it then it basically stops working. While i need it 
> to display the messages sent by server(daemon) to the user running the 
> script has anyone got any idea why it rejects to work? (yeah the daemon is 
> written in c++ if that matters) 

--- End Message ---
--- Begin Message ---
Hi,

Thank you all for your response. But turns out that the problem I am facing
is caused by something else and unrelated to MPMs being threaded. The test
case details gave me a clue.

The test was trying to load mod_php between graceful restarts, i.e start
apache without mod_php, then modify the config file to load it and do a
graceful restart. This clearly fails because mod_php loads only on the
second load within apache. It does this by setting some pool user data in
the beginning of sapi_apache2.c:php_apache_server_startup(). So I'd have to
do two graceful restarts for it to take effect.

Now, I want to know if I can comment out this piece of code where it
checks/sets the user data and make it load every time. This will help me
enable the  module between restarts too. Will this break something ? Do I
need to post this query on a different mailing list to get a response from
the PHP dev team ?

Rgds,
Rashmi

On Dec 14, 2007 10:34 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:

> On Thu, December 13, 2007 11:38 pm, Rashmi Badan wrote:
> > I'm using php 5.2.1 with apache 2.2.6 and while running certain tests
> > I see
> > a segmentation fault - the relevant stack is given below. My php
> > configure
> > line is as follows
> >
> > configure '--prefix=/my/php/installdir' *'--with-tsrm-pthreads'
> > *'--with-ldap'
> > *'--enable-maintainer-zts'* '--enable-sigchild' '--enable-so'
> > '--with-apxs2=/my/apache2/bin/apxs' '--without-sqlite'
> > '--without-pdo-sqlite' '--with-oci8=/my/oracle/installdir'
> > '--enable-mbstring'
> >
> > I'm running apache with a threaded MPM. Is that a probem as I remember
> > reading somewhere that php does not quite work well with threaded
> > MPMs.
> > Would appreciate any help/pointers on this.
>
> PHP itself works fine with MPM, as far as anybody knows.
>
> But one of your --enable-xyz may NOT work fine with MPM!
>
> PDO is "new" and suspect.
> "mbstring" is on the way out in favor of PHP 6 Unicode, and I think
> it's also suspect.
> OCI8, well, I dunno...  You'd think enough folks would be using that
> to get rid of all the thread-bugs, but...
>
> > -----------------------------------
> > #0  0x007937a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
> > #1  0x007d7c96 in kill () from /lib/tls/libc.so.6
> > #2  0x08070da8 in sig_coredump ()
> > #3  <signal handler called>
> > #4  0x00a00d24 in pthread_mutex_lock () from /lib/tls/libpthread.so.0
> > *#5  0xb461d9f5 in tsrm_mutex_lock (mutexp=0x0)
> >     at /ade/rbadan_gollum/oracle/apache_modules/mod_php/php-5.2.1
> > /TSRM/TSRM.c:660
> > #6  0xb461d071 in ts_resource_ex (id=0, th_id=0x0)*
> >     at /ade/rbadan_gollum/oracle/apache_modules/mod_php/php- 5.2.1
> > /TSRM/TSRM.c:345
> > #7  0xb472dcb5 in php_handler (r=0x85c65b0)
> >     at /ade/rbadan_gollum/oracle/apache_modules/mod_php/php-5.2.1
> > /sapi/apache2handler/sapi_apache2.c:500
> > #8  0x080829af in ap_run_handler ()
> > #9  0x08082807 in ap_invoke_handler ()
> > #10 0x080976d5 in async_run_handlers ()
> > #11 0x080975f3 in async_process_connection ()
> > #12 0x08097346 in process_socket ()
> > #13 0x08096e97 in worker_thread ()
> > #14 0xb7f83e33 in dummy_worker (opaque=0x85bf438) at
> > threadproc/unix/thread.c:142
> > #15 0x009ff371 in start_thread () from /lib/tls/libpthread.so.0
> > #16 0x008779be in clone () from /lib/tls/libc.so.6
>
> You probably should post this into:
> http://bugs.php.net
>
> It is a pretty cogent error report.
>
> If you can provide source code for the tests that make this segfault,
> then odds are extremely good that somebody on the PHP Dev Team can
> reproduce it and fix it.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
>
>

--- End Message ---
--- Begin Message ---
Rashmi Badan schreef:
> Hi,
> 
> Thank you all for your response. But turns out that the problem I am facing
> is caused by something else and unrelated to MPMs being threaded. The test
> case details gave me a clue.
> 
> The test was trying to load mod_php between graceful restarts, i.e start
> apache without mod_php, then modify the config file to load it and do a
> graceful restart. This clearly fails because mod_php loads only on the
> second load within apache. It does this by setting some pool user data in
> the beginning of sapi_apache2.c:php_apache_server_startup(). So I'd have to
> do two graceful restarts for it to take effect.
> 
> Now, I want to know if I can comment out this piece of code where it
> checks/sets the user data and make it load every time. This will help me
> enable the  module between restarts too. Will this break something ? Do I
> need to post this query on a different mailing list to get a response from
> the PHP dev team ?

yes - your better off posting this to [EMAIL PROTECTED], that's where
the devs hang out and one of them should be able to offer you some knowledge
advice on the matter.

as a sidenote: there is a not so small chance this will not be the only
segfault you run into (assuming you get this fixed) depending on which
php extensions you are using.

regardless please do post a progress report to this list if you make any
headway ... I'm sure Im not the only one interesed to here how you get on.

rgds,
Jochem

> 
> Rgds,
> Rashmi
> 
> On Dec 14, 2007 10:34 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> 
>> On Thu, December 13, 2007 11:38 pm, Rashmi Badan wrote:
>>> I'm using php 5.2.1 with apache 2.2.6 and while running certain tests
>>> I see
>>> a segmentation fault - the relevant stack is given below. My php
>>> configure
>>> line is as follows
>>>
>>> configure '--prefix=/my/php/installdir' *'--with-tsrm-pthreads'
>>> *'--with-ldap'
>>> *'--enable-maintainer-zts'* '--enable-sigchild' '--enable-so'
>>> '--with-apxs2=/my/apache2/bin/apxs' '--without-sqlite'
>>> '--without-pdo-sqlite' '--with-oci8=/my/oracle/installdir'
>>> '--enable-mbstring'
>>>
>>> I'm running apache with a threaded MPM. Is that a probem as I remember
>>> reading somewhere that php does not quite work well with threaded
>>> MPMs.
>>> Would appreciate any help/pointers on this.
>> PHP itself works fine with MPM, as far as anybody knows.
>>
>> But one of your --enable-xyz may NOT work fine with MPM!
>>
>> PDO is "new" and suspect.
>> "mbstring" is on the way out in favor of PHP 6 Unicode, and I think
>> it's also suspect.
>> OCI8, well, I dunno...  You'd think enough folks would be using that
>> to get rid of all the thread-bugs, but...
>>
>>> -----------------------------------
>>> #0  0x007937a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
>>> #1  0x007d7c96 in kill () from /lib/tls/libc.so.6
>>> #2  0x08070da8 in sig_coredump ()
>>> #3  <signal handler called>
>>> #4  0x00a00d24 in pthread_mutex_lock () from /lib/tls/libpthread.so.0
>>> *#5  0xb461d9f5 in tsrm_mutex_lock (mutexp=0x0)
>>>     at /ade/rbadan_gollum/oracle/apache_modules/mod_php/php-5.2.1
>>> /TSRM/TSRM.c:660
>>> #6  0xb461d071 in ts_resource_ex (id=0, th_id=0x0)*
>>>     at /ade/rbadan_gollum/oracle/apache_modules/mod_php/php- 5.2.1
>>> /TSRM/TSRM.c:345
>>> #7  0xb472dcb5 in php_handler (r=0x85c65b0)
>>>     at /ade/rbadan_gollum/oracle/apache_modules/mod_php/php-5.2.1
>>> /sapi/apache2handler/sapi_apache2.c:500
>>> #8  0x080829af in ap_run_handler ()
>>> #9  0x08082807 in ap_invoke_handler ()
>>> #10 0x080976d5 in async_run_handlers ()
>>> #11 0x080975f3 in async_process_connection ()
>>> #12 0x08097346 in process_socket ()
>>> #13 0x08096e97 in worker_thread ()
>>> #14 0xb7f83e33 in dummy_worker (opaque=0x85bf438) at
>>> threadproc/unix/thread.c:142
>>> #15 0x009ff371 in start_thread () from /lib/tls/libpthread.so.0
>>> #16 0x008779be in clone () from /lib/tls/libc.so.6
>> You probably should post this into:
>> http://bugs.php.net
>>
>> It is a pretty cogent error report.
>>
>> If you can provide source code for the tests that make this segfault,
>> then odds are extremely good that somebody on the PHP Dev Team can
>> reproduce it and fix it.
>>
>> --
>> Some people have a "gift" link here.
>> Know what I want?
>> I want you to buy a CD from some indie artist.
>> http://cdbaby.com/from/lynch
>> Yeah, I get a buck. So?
>>
>>
> 

--- End Message ---

Reply via email to