[PHP] problem compiling 5.3 with postgresql

2011-03-19 Thread Jim White

I am having problems compiling 5.3.? with postgresql support.

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' 
'--with-pdo-pgsql=/usr/local/postgresql-9.0.3' 
'--with-pgsql=/usr/local/postgresql-9.0.3'


This configure works with 5.2.?, but 5.3.? gets this

ext/standard/.libs/dns.o: In function `php_parserr':
/usr/local/php-5.3.5/ext/standard/dns.c:418: undefined reference to 
`__dn_expand'


and more lines like the last one.

How can I fix this? I am using Ubuntu 10.10.

JIm



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] script failing at same line

2009-09-08 Thread jim white

Ben,

My solution was to add a table to my database, and add an insert job id 
into the table after the line that is causing the problem. When I submit 
the script I use setTimeout to run an AJAX query of the table 5 seconds 
later. If the line has failed the job id will not be in the table and I 
alert the user. It works - and some day I hope to fix the software 
problem and make this unnecessary.


Thanks,
Jim

Ben Dunlap wrote:
On Fri, Sep 4, 2009 at 2:38 PM, jim white jbw2...@earthlink.net 
mailto:jbw2...@earthlink.net wrote:


It's a web app that draws maps in a browser. Sometime it will
generate a seg fault. The command should not take long, so if
there is some script construct that will throw an exception after
a few seconds if the command has not completed I could signal the
user that the map will not draw and to reload the page.


There's a pecl extension called Libevent that can apparently trigger 
an action to occur after a certain amount of time has elapsed:


http://us3.php.net/manual/en/ref.libevent.php

I've not used it and have no idea how mature or reliable it is. I'm 
also wondering whether any solution will work that relies on the same 
script that's about to trigger a segfault.


I think I'd be inclined to build an XHR-based monitor to run in the 
user's browser. Even simpler would be to start the map-building 
process asynchronously with XHR and then just alert the user, or 
automatically refresh the browser, if a certain amount of time elapses 
before you get a response from the map-building script. But I don't 
know how much you'd have to alter your existing client-side code to 
use the latter method.


Either way it's creeping away from PHP so maybe I should leave it at that.

Ben

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] script failing at same line

2009-09-04 Thread jim white

Hi,

I have a script that intermittently fails at the same line. I am trying 
to write some code that will throw an exception after 5 seconds if the 
command on that line fails and the script freezes.

Any ideas?

Jim White


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] script failing at same line

2009-09-04 Thread jim white

$map = ms_newMapObj($mapfile);

The command creates a new mapscript object.

Jay Blanchard wrote:

[snip]
I have a script that intermittently fails at the same line. I am trying 
to write some code that will throw an exception after 5 seconds if the 
command on that line fails and the script freezes.

Any ideas?
[/snip]

I have lots of ideas! But those really won't help you :)

We need to see the code at that line and be told what is being done in
order to make a reasonable guess.

My bet is that the data being fed to the script has a character that is
not expected or something.

  



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] script failing at same line

2009-09-04 Thread jim white
It's a web app that draws maps in a browser. Sometime it will generate a 
seg fault. The command should not take long, so if there is some script 
construct that will throw an exception after a few seconds if the 
command has not completed I could signal the user that the map will not 
draw and to reload the page.


Jim

Ben Dunlap wrote:


$map = ms_newMapObj($mapfile);

The command creates a new mapscript object.


And PHP is hanging somewhere inside that constructor? Is this in a web 
context or a command-line context? Or both?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] script failing at same line

2009-09-04 Thread jim white

Hi,

Thanks I'll look at libevent. I have also been thinking about using an 
XHR approach, but wonder how passing PHP references works with javascript.


Jim

Ben Dunlap wrote:
On Fri, Sep 4, 2009 at 2:38 PM, jim white jbw2...@earthlink.net 
mailto:jbw2...@earthlink.net wrote:


It's a web app that draws maps in a browser. Sometime it will
generate a seg fault. The command should not take long, so if
there is some script construct that will throw an exception after
a few seconds if the command has not completed I could signal the
user that the map will not draw and to reload the page.


There's a pecl extension called Libevent that can apparently trigger 
an action to occur after a certain amount of time has elapsed:


http://us3.php.net/manual/en/ref.libevent.php

I've not used it and have no idea how mature or reliable it is. I'm 
also wondering whether any solution will work that relies on the same 
script that's about to trigger a segfault.


I think I'd be inclined to build an XHR-based monitor to run in the 
user's browser. Even simpler would be to start the map-building 
process asynchronously with XHR and then just alert the user, or 
automatically refresh the browser, if a certain amount of time elapses 
before you get a response from the map-building script. But I don't 
know how much you'd have to alter your existing client-side code to 
use the latter method.


Either way it's creeping away from PHP so maybe I should leave it at that.

Ben

 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: RE: [PHP] flushing AJAX scripts

2009-03-27 Thread jim white
My page submits the AJAX request to complete a report that takes some 
time, and upon completion stores results in a database. A second AJAX 
request polls every 5 seconds and queries the database if the report is 
ready. This hopefully will get around any timeout problems I am having 
with a long running request, and seems to be working. It looks like I 
can accept the default behavior for now. I don't depend on getting a 
response from the original request, but is there a point where the AJAX 
response script will be stopped either by Apache or PHP before it can 
insert into the database?


Jim


Andrea Giammarchi wrote:

Some browser would like to receive at list N characters (bytes) even if
you force the flush, before the browser will show those characters.
In
any case, the Ajax request will not be completed until its readyState
will be 4, which means the page execution on the server has finished
(released, php has gone, flush or not flush)
For a task like this one you have few options:
 1 - launch  new thread if your host is able to do it
 2 - use a Comet like response (for php I wrote Phico some while ago)
In any case, I hope this stressful operation cannot be performed from thousand 
of users or you can say bye bye to the service.
Alternatives:
 1 - optimize your database
 2 - delegate the job once a time rather than every click (cronjob)
 3 - if the bottleneck is PHP, create an extension in C to perform the same task

Hope this help.

Regards

P.S.
Internet Explorer a part, you can read the responseText on readystate 3
which will be called different time (most likely for each flush).
If IE is not your target, you could consider this opportunity to read the sent 
stream so far.

  

Date: Fri, 27 Mar 2009 08:49:35 +1100
From: dmag...@gmail.com
To: jbw2...@earthlink.net
CC: php-general@lists.php.net
Subject: Re: [PHP] flushing AJAX scripts

jim white wrote:

I am using jQuery AJAX request to run a script that can take several 
minutes to create a report. I want to start the script and immediately 
echo a response to close the connection and then let the script complete 
a report which I can get later. I have tried several thing such as


ob_start();
echo json_encode(array(time=$now, message=Report has started 
running!));

ob_end_flush();
  

Try something like this

echo something;
flush();

without the ob* stuff.

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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
  



--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: RE: [PHP] flushing AJAX scripts

2009-03-27 Thread jim white
Well, the point was that I had tried the first way, submitting one AJAX 
request and waiting for it to finish and it was timing out, probably on 
my firewall which it shouldn't have - but it did. The reports can take 
10 seconds or 10 minutes to create. Doing it this way I can still load 
the report even if the original request shuts down after 3-4 minutes.


Jim

Andrea Giammarchi wrote:
Sorry Jim, I meant Jim when I wrote Kim ... and 
Phico: http://webreflection.blogspot.com/2008/04/phomet-changes-name-so-welcome-phico.html


Regards

  

From: an_...@hotmail.com
To: php-general@lists.php.net
Date: Fri, 27 Mar 2009 15:55:28 +0100
Subject: RE: [PHP] flushing AJAX scripts


Sorry, Kim, but why on earth you are polling with a second request to know when 
the first one has finished?
I mean, when the first request inserts data in the database that's it, you'll 
manage the end of the request.

$A ---  do stuff; do stuff; do stuff; report ready;
$B --- report ready?
$B --- report ready?
$B --- report ready?
$B --- report ready?
report ready; --- notification to A
$B --- report ready;

the report ready, if it is when $A request has been finished, will be in $A, 
the polling via $B is absolutely useless, imo.

There is no timeout from Ajax, it simply keep waiting, but obviously if your 
PHP has max_execution_time 30 seconds and the script execution takes more than 
30 seconds there's no polling that could save you.

The same if the user closes the browser, connection lost, bye bye response.

To have a notice, you need Comet, try out Phico but still, a page that requires 
that much is not suitable for the web. Report creation should be a cronjob in a 
separed thread if it is that stressful.

Regards



Date: Fri, 27 Mar 2009 10:47:10 -0400
From: jbw2...@earthlink.net
To: an_...@hotmail.com
CC: php-general@lists.php.net
Subject: Re: RE: [PHP] flushing AJAX scripts

My page submits the AJAX request to complete a report that takes some 
time, and upon completion stores results in a database. A second AJAX 
request polls every 5 seconds and queries the database if the report is 
ready. This hopefully will get around any timeout problems I am having 
with a long running request, and seems to be working. It looks like I 
can accept the default behavior for now. I don't depend on getting a 
response from the original request, but is there a point where the AJAX 
response script will be stopped either by Apache or PHP before it can 
insert into the database?


Jim
  

_
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx



_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
  



--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] flushing AJAX scripts

2009-03-26 Thread jim white
I am using jQuery AJAX request to run a script that can take several 
minutes to create a report. I want to start the script and immediately 
echo a response to close the connection and then let the script complete 
a report which I can get later. I have tried several thing such as


ob_start();
echo json_encode(array(time=$now, message=Report has started 
running!));

ob_end_flush();

However, the script does not respond and (I suppose close the 
connection) until the report is complete. How can I fix this behaviour?


Jim


--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] help installing phpDocumentor

2009-02-23 Thread jim white
I have tried to install phpDocumentor, but am having problems getting it 
to run. Finding install directions has so far eluded me. Are there any 
installation instructions for this?


Jim White



--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] help installing phpDocumentor

2009-02-23 Thread jim white

Jim Lucas wrote:

jim white wrote:
  

I have tried to install phpDocumentor, but am having problems getting it
to run. Finding install directions has so far eluded me. Are there any
installation instructions for this?

Jim White






searching google for install phpDocumentor

first result is this

http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.quickstart.pkg.html

Is this what you are looking for?

  
No, I already found that. I have installed it according to the 
instructions. PEAR didn't work at all, and install using tar file only 
partly works.




--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] help installing phpDocumentor

2009-02-23 Thread jim white

Jim Lucas wrote:

jim white wrote:
  

Jim Lucas wrote:


jim white wrote:
 
  

I have tried to install phpDocumentor, but am having problems getting it
to run. Finding install directions has so far eluded me. Are there any
installation instructions for this?

Jim White






searching google for install phpDocumentor

first result is this

http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.quickstart.pkg.html


Is this what you are looking for?

  
  

No, I already found that. I have installed it according to the
instructions. PEAR didn't work at all, and install using tar file only
partly works.






When you say PEAR didn't work.  What exactly do you mean.  If you received an 
error, what was it?

What exactly only partly worked with the tar installer?

  
It seems part of my problem, at least with the tar install, was not 
setting my directory permissions so it could write the files. PEAR I 
will skip since I almost have it working using the tar file. I have 
tried creating docs with HTML:Smarty:default which works, but for 
HTML:frames:default at the file level I get *Parse error*: syntax error, 
unexpected T_STRING.


Also, if I want to download the other formats, where do you install them?

Jim


--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] help installing phpDocumentor

2009-02-23 Thread jim white

Jim Lucas wrote:

Back on the list...

jim white wrote:
  

Jim Lucas wrote:


jim white wrote:
 
  

Jim Lucas wrote:
   


jim white wrote:
 
 
  

I have tried to install phpDocumentor, but am having problems
getting it
to run. Finding install directions has so far eluded me. Are there any
installation instructions for this?

Jim White






searching google for install phpDocumentor

first result is this

http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.quickstart.pkg.html



Is this what you are looking for?


  

No, I already found that. I have installed it according to the
instructions. PEAR didn't work at all, and install using tar file only
partly works.






When you say PEAR didn't work.  What exactly do you mean.  If you
received an error, what was it?

What exactly only partly worked with the tar installer?

  
  

Here is my problem.

?xml version=1.0 encoding=iso-8859-1?

Need to look into turning this off or setting my web server to parse it
correctly.

Jim






Best bet would be to tell your system to not use short tags.

That is where your parse error is coming from.

Or, assuming that the above line is in an included file, change it to

?
echo '?xml version=1.0 encoding=iso-8859-1?';
?

or something similar

But, if it were me, I would disabled short tags.

I may be wrong, but I heard short tags were going the way of the Dodo bird as 
of PHP6.

  

Thanks, all looks good now!

Jim

--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/ 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php