[PHP] Increasing maximum file descriptors (OS X Lion 10.7, PHP 5.3.8 via Macports)

2011-11-07 Thread René Fournier
I have a working socket server in PHP that I wish to improve (allow for more socket connections). I am running into a limit I can't crack, related to the max number of incoming socket connections. Using Macports for package management... I've recompiled PHP with the --enable-fd-setsize=2048 in t

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-15 Thread René Fournier
On 2009-12-15, at 11:55 PM, Richard Quadling wrote: > Do you have a default stream context defined for the http stream? Nope. > > A _LONG_ time ago, when I was using a firewall with NTLM > authentication (which PHP doesn't deal with), I had to route all my > calls through a local proxy. > > Th

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-15 Thread René Fournier
On 2009-12-15, at 11:55 PM, Richard Quadling wrote: > Do you have a default stream context defined for the http stream? Nope. > > A _LONG_ time ago, when I was using a firewall with NTLM > authentication (which PHP doesn't deal with), I had to route all my > calls through a local proxy. > > Th

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread René Fournier
On 2009-12-14, at 10:44 PM, Cafer Şimşek wrote: > René Fournier writes: > >> 4. as per php.ini, allow_url_fopen On > > Look at from phpinfo() the settings is already "On". Yes, I know. Which is why it's odd that the function fails on URLs. -- PHP General

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread René Fournier
Anyone, anyone? Bueller? On 2009-12-14, at 10:05 PM, Gaurav Kumar wrote: > Sorry buddy, I cant think of anything else which is going on wrong. > > > 2009/12/14 René Fournier > > PHP Version 5.3.0 > > Directive Local Value Master Value > allow_c

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-13 Thread René Fournier
;> >> // set URL and other appropriate options >> curl_setopt($ch, CURLOPT_URL, "http://www.google.co.in";); >> //http://www.google.com >> curl_setopt($ch, CURLOPT_HEADER, 0); >> >> // grab URL and pass it to the browser >> curl_exec($ch); >>

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-13 Thread René Fournier
e.com > curl_setopt($ch, CURLOPT_HEADER, 0); > > // grab URL and pass it to the browser > curl_exec($ch); > > // close cURL resource, and free up system resources > curl_close($ch); > > ?> > > Thanks, > > Gaurav Kumar > > > > 2009/12/13 René F

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-12 Thread René Fournier
Something is stopping you to access > external connection. > > Let me know when your problem is fixed. > Also I tried the below code and it works fine- > > $str = file_get_contents ('http://www.google.com'); > echo $str; > ?> > > Thanks, >

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-11 Thread René Fournier
r > blog.oswebstudio.com > > > > On Thu, Dec 10, 2009 at 9:01 PM, René Fournier wrote: > I thought error_reporting would display them, but I guess php.ini had them > suppressed. Anyway, with: > > > error_reporting(-1); > ini_set('display_errors'

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-10 Thread René Fournier
hat help with the diagnosis? On 2009-12-10, at 12:28 AM, Richard Quadling wrote: > 2009/12/9 René Fournier : >> It is, and I use curl elsewhere in the same script to fetch remote content. >> This exact same function works fine on my MacBook Pro (10.6 client, PHP >> 5.3),

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-09 Thread René Fournier
t http://www.google.com in your command line to see whether the network is > reachable > > LinuxManMikeC wrote: >> >> On Wed, Dec 9, 2009 at 8:02 AM, LinuxManMikeC >> wrote: >> >>> On Wed, Dec 9, 2009 at 6:45 AM, René Fournier wrote: >>> >&g

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-09 Thread René Fournier
No. And it doesn't matter if the url is local (localhost, host.domain.com) or remote. On 2009-12-09, at 10:30 PM, kranthi wrote: > may be unrelated to your problem... but are you behind a proxy?

[PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-09 Thread René Fournier
Strange problem I'm having on Mac OS X Server 10.6 running PHP 5.3. Any call of file_get_contents() on a local file works fine -- the file is read and returned. But any call of file_get_contents on a url -- any url, local or remote -- always returns false. var_dump (file_get_contents ('http://w

[PHP] What was the unix timestamp of last week, Monday 12:00 am?

2009-04-12 Thread René Fournier
I'm trying to write a [simple] function, such that: function earlier_unix_timestamp () { $now = mktime(); [...] return $then; // e.g., 1238983107 } Anyone have something already made? There seem to be many ways to skin this cat, with date() arithmetic, etc.

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-19 Thread René Fournier
On 11-Dec-07, at 2:13 PM, Per Jessen wrote: René Fournier wrote: However, the number of socket clients connecting in the past 3-4 months has steadily increased, and this seems to have exposed (if not created) a strange performance "issue" with PHP 5.2.4, MySQL 5.0.45 and/or Mac O

[PHP] Re: Mac OS X Server limits... was [PHP] Pushing the limits of stream_socket_server() and stream_select()

2007-12-11 Thread René Fournier
S X gurus out there know how to increase OS X Server's (10.4.11) maximum connections per socket value? There seems to no such setting in sysctl or ulimit. Any ideas? Anyone? Anyone? ...Rene On 11-Dec-07, at 4:55 PM, René Fournier wrote: On 11-Dec-07, at 4:32 PM, René Fournier wrote

Re: [PHP] Pushing the limits of stream_socket_server() and stream_select()

2007-12-11 Thread René Fournier
On 11-Dec-07, at 4:32 PM, René Fournier wrote: Just curious what people found the limits to be with stream_socket_server(), in terms of maximum concurrent connections, packet sizes, etc. I'm am presently stress-testing a multi-client socket server and am finding I can sometimes bre

[PHP] Pushing the limits of stream_socket_server() and stream_select()

2007-12-11 Thread René Fournier
Just curious what people found the limits to be with stream_socket_server(), in terms of maximum concurrent connections, packet sizes, etc. I'm am presently stress-testing a multi-client socket server and am finding I can sometimes break it with as few as 100 concurrent connections, and alw

[PHP] Bug in stream_socket_server()?

2007-12-11 Thread René Fournier
"If you want a high speed socket server, use the low-level sockets instead (socket_create/bind/listen). The stream_socket_server version appears to have internal fixed 8k buffers that will overflow if you don't keep up by reading. This is a serious problem if you an application that reads t

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread René Fournier
That makes sense, but I'm not sure I really want to do this, since it's fairly important that Listener continue listening without interruption. I also don't think it's probably necessary, since from what I read, I'm not really pushing the envelope in terms of real load. Right now, I might

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread René Fournier
On 10-Dec-07, at 5:20 PM, Jim Lucas wrote: Tom Rogers wrote: Hi, Tuesday, December 11, 2007, 6:42:18 AM, you wrote: RF> Hello, Put a usleep(1000) in the listen while() loop and give the cpu a break. This makes me think about asking if you have to short of a timeout on your receiving conn

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread René Fournier
On 10-Dec-07, at 4:42 PM, Tom Rogers wrote: Put a usleep(1000) in the listen while() loop and give the cpu a break. Good advice, but I've already been doing that. The thing is, when the script first starts up, the CPU rarely exceeds 30%, even when many clients (200+) are simultaneously c

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread René Fournier
Hi Jim, I have a server that "listens" like yours does. I get 80k - 85k connections a day to it. When I first started it, I was only getting about 3k of connections aday. Then I upped the listening pattern and it tanked. I noticed that all my mail/web/db connections just sat there.

[PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread René Fournier
Hello, I have a command-line PHP script--called Listener--that is designed to run indefinitely with a predictable CPU usage and memory footprint. In a nutshell, it's a multi-client socket server that waits for incoming connections, processes incoming data, stores results in a MySQL databa

Re: [PHP] Possible?

2006-04-28 Thread René Fournier
Anyway, I've started looking at this, but I'm not quite sure if it's even possible. I mean, can "something" send a request to Apache, and continue to write data along that TCP socket? Normally, HTTP requests include GET or POST for such data, but this is not a a web browser that's opening t

[PHP] Possible?

2006-04-28 Thread René Fournier
Simple problem: Many client apps need to send data to a server. By default each client will open a persistent TCP socket connection to a common IP address:port (10.10.10.10:1234) and write to it (which the server will save/log, etc.). My question is, what should be ready to listen at the IP

[PHP] Multi-threaded port listener

2006-04-28 Thread René Fournier
Anyone find any good tutorials, code samples, etc. on such a thing? Basically, I want to write server (in PHP) that listeners on a particular port, and spins off a thread/process (essentially, execute a separate script) for each incoming connection. There won't be a lot of data to process,

Re: [PHP] Accessing data posted from a different URL

2006-03-20 Thread René Fournier
On 20-Mar-06, at 4:40 PM, Richard Lynch wrote: On Mon, March 20, 2006 5:04 pm, René Fournier wrote: What does this value actually look like? How long is it? Is mail wrapping it to 72 characters with a newline, thereby breaking the data up? Though you would still get some POST data, just

Re: [PHP] Accessing data posted from a different URL

2006-03-20 Thread René Fournier
On 20-Mar-06, at 3:05 PM, Jay Blanchard wrote: [snip] Hmm, perhaps I didn't explain clearly. To put it another: 1. A script sends an email to a user with sign-in details. 2. The user clicks a [submit] button in the email message called "Quick Sign In" 3. A web browsers opens to http://www.websi

Re: [PHP] Accessing data posted from a different URL

2006-03-20 Thread René Fournier
Hmm, perhaps I didn't explain clearly. To put it another: 1. A script sends an email to a user with sign-in details. 2. The user clicks a [submit] button in the email message called "Quick Sign In" 3. A web browsers opens to http://www.website.com/signin.php (from the http://www.website.com/s

[PHP] Accessing data posted from a different URL

2006-03-20 Thread René Fournier
I have a script that periodically sends an email that includes form post to a script, which is meant to do something with the posted data. My problem is that apparently some PHP security measure is not permitting the externally posted data to be access via $_POST. I assume this is due to c

Re: [PHP] PHPMailer inserting unwanted spaces

2006-01-03 Thread René Fournier
5:37 AM, Lam Cheuk Hin wrote: Can You Write The Strings/Text? On 12/30/05, René Fournier <[EMAIL PROTECTED]> wrote: Has anyone encountered this? I am composing an HTML email with PHPMailer, and for some reason PHPMailer is inserted spaces periodically, which breaks the formatting. I

[PHP] PHPMailer inserting unwanted spaces

2005-12-29 Thread René Fournier
Has anyone encountered this? I am composing an HTML email with PHPMailer, and for some reason PHPMailer is inserted spaces periodically, which breaks the formatting. I've looked through the docs, but can only find a setting for Word Wrap (which is set to 0). ...Rene -- PHP General Mailing

[PHP] array_search() with preg_match?

2005-06-23 Thread René Fournier
I need to search an array for a string, with a twist. E.g.: $array = array(0 => 'this sky is blue', 1 => 'pencils are orange', 2 => 'I like green apples', 3 => 'strawberries are red'); $key = array_search('green', $array); With the above code, nothing will be returned, but I would like it to

[PHP] Got a makestringsafe_for_filename() function?

2005-06-22 Thread René Fournier
I imagine some of you have written a nice little function for taking an arbitrary user-input string, and sanitizing and cleaning it for us as a UNIX (Mac OSX) filename... Would you mind sharing it? Thanks. René --- René Fournier www.renefournier.com -- PHP General Mailing List (http

[PHP] Can this code go faster?

2005-04-26 Thread René Fournier
I've looked in the docs and don't see anything for this per se... I need to convert a binary number of arbitrary length to a signed integer. This is how I'm doing it now: CODE function bin2int ($bin) { if (substr($bin,0,1) == 1) { $val = 0 - bindec(substr($bin,1))

Re: [PHP] Re: Create MDB File

2005-03-31 Thread René Fournier
Coincidentally, I also need a way to read a table from MySQL and write it out to an .MDB file on-the-fly (from within a PHP script). The CSV export idea isn't an option in this case. Has anyone found a way to create an MDB file (with a single table) from PHP? ...Rene On 28-Mar-05, at 7:18 PM,

[PHP] Sprintf?

2005-03-29 Thread René Fournier
I need to go from 1754210747 (decimal) to 17 54 21 a7 47 (hex per character) Basically, reformat the string for each character, converting it to Hex, and spacing after each two characters. Sprintf? ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

[PHP] String format best practice

2005-03-29 Thread René Fournier
value (23602210718), so maybe sprintf would be a direct way? ...Rene Best regards, René Fournier --- René Fournier GPS Police.NET 31, 1339 - 40th Ave NE Calgary, AB T2E 8N6 Canada Tel +1 (403) 250. Fax +1 (403) 291-2997 www.gpspolice.net -- PHP General Mailing List (http://www.php.net/) To unsubs

Re: [PHP] How to make a PHP Socket client crash-proof?

2004-12-10 Thread René Fournier
waiting for you to send more. How do you signal the end of your data to be sent? Does the server understand that signal? -- Like Music? http://l-i-e.com/artists.htm ...René --- René Fournier www.renefournier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How to make a PHP Socket client crash-proof?

2004-12-08 Thread René Fournier
not crash-proof) and after (not working at all, just looping endlessly, really fast). Many thanks in advance for any suggestions you can offer. ...René --- René Fournier www.renefournier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Socket trouble

2004-10-28 Thread René Fournier
a zero length string ("") indicating the end of communication (i.e. the remote end point has closed the connection)." Does this "end of communication" include cases when the socket server dies without gracefully disconnecting? How could my code check for this zero leng

[PHP] Multiple web sites, one IP address...

2004-09-15 Thread René Fournier
is kind of thing, I would very much appreciate it. ...Rene ...René --- René Fournier www.renefournier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Output buffering (gzip) on Mac OS X 10.3.5

2004-08-12 Thread René Fournier
ot;ob_gzhandler"); session_start(); // ...code ob_end_flush(); header('Content-Encoding: gzip'); ?> I've tried numerous permutations of this and other code, but have yet to get anything to compress. Any ideas? ...René --- René Fournier www.renefournier.com -- PHP General

Re: [PHP] Re: convert degrees to heading

2004-07-16 Thread René Fournier
Works beautifully. Thanks! ...Rene On Friday, July 16, 2004, at 04:36 PM, Tim Van Wassenhove wrote: function degrees2compass($degrees) { $compass = array('N', 'NNW', 'NNE', 'NE', ...); $index = $heading_degrees / sizeof($compass); return $compass[$index]; } -- PHP General Mailing List (

[PHP] convert degrees to heading

2004-07-16 Thread René Fournier
I have to write a little function to convert a direction from degrees to a compass -type heading. 0 = West. 90 = North. E.g.: from: 135 degrees to: NW Now, I was planning to write a series of if statements to evaluate e.g., if ($heading_degrees < 112.5 && $heading_degrees > 67.5) { $headi

[PHP] Interactive Voice Response (IVR)

2004-07-08 Thread René Fournier
Hi, I am looking for an IVR system that would allow a person to call a number (via telephone), and then using the keypad to send commands that are processed by a PHP script which—after hitting a mySQL database a few times—responds with a value (success/failure) which then is played back to the

Re: [PHP] Socket Tutorial

2004-07-08 Thread René Fournier
Hi Andrew, This one helped me a lot: http://www.devshed.com/c/a/PHP/Socket-Programming-With-PHP/ This isn't a tutorial, but good sample code for a multi-client chat server: http://dave.dapond.com/socketselect.phps ...Rene On Monday, July 5, 2004, at 12:39 PM, Andrew wrote: Hi guys, Can somebody p

Re: [PHP] Re: MapServer and PHP/MapScript

2004-06-14 Thread René Fournier
Can I ask, what platform/OS you are running it on? I am looking to build it for OSX 10.3... ...Rene On Monday, June 14, 2004, at 03:16 PM, Lester Caine wrote: René fournier wrote: Anybody have any experience (good or bad) with MapServer? (http://mapserver.gis.umn.edu/) And if so, can you

[PHP] MapServer and PHP/MapScript

2004-06-14 Thread René Fournier
Anybody have any experience (good or bad) with MapServer? (http://mapserver.gis.umn.edu/) And if so, can you comment on how good or bad PHP/MapScript is? (http://mapserver.gis.umn.edu/doc42/phpmapscript-class-guide.html) Thanks. ...Rene -- PHP General Mailing List (http://www.php.net/) To unsu

Re: [PHP] Expedia.com

2004-06-09 Thread René Fournier
I guess a better question would be, what is the "best practices" way of showing a "Please wait..." page while a server operation is performed (which could take 5 or 45 seconds), then make the page display the resulting data (via reload, or slow-load, or whatever)? Would love to find an article

[PHP] Expedia.com

2004-06-09 Thread René Fournier
When Expedia.com is searching for flights, it displays a page with a little animated GIF progress bar, then display the results. How do they do that? How does the page sit idle until the query is finished, and then sends a new page with the results? I was thinking that they might use HTTP-REFRE

Re: [PHP] Can someone explain this?

2004-06-08 Thread René Fournier
Thanks. The fact that this behaviour is a bug somehow makes me feel better. At least I'm not crazy—or, not as crazy as I thought. ...Rene On Tuesday, June 8, 2004, at 12:57 PM, Curt Zirzow wrote: * Thus wrote Ren Fournier ([EMAIL PROTECTED]): Now, thanks to your suggestions, I can convert that nu

Re: [PHP] Can someone explain this?

2004-06-08 Thread René Fournier
OK, that makes sense. But here's the problem: I receive binary data from SuperSPARC (big-endian), which I need to unpack according to certain documented type definitions. For example, let's say that $msg has the value "3961595508" and is packed as an unsigned long integer (on the remote SPARC).

[PHP] Can someone explain this?

2004-06-08 Thread René Fournier
$dec = -71788; echo $dec."\n"; $hex = dechex($dec)."\n"; $dec2 = hexdec($hex)."\n"; echo $dec2."\n"; -= PRODUCES: =- -71788 3961595508 Is this something about signed versus unsigned integers? What I really would like to do is convert that negative number (-71788), which I suppose is u

[PHP] Mapping solutions

2004-06-04 Thread René Fournier
I'm looking for a good mapping solution for a PHP project I'm working on, and wondered if any of you would be able to recommend one. Basically, I would like to be able to pass this "Map Module" several values: Latitude, longitude, map scale (e.g., 5KM x 5KM), and map resolution (500 pixels x 50

[PHP] Secure login script

2004-05-31 Thread René Fournier
The link I posted previously is causing me some grief, apparently because I don't know the first thing about object-oriented PHP or PEAR. Here's the thing: If I MUST learn these two things in order to copy the security of the sample script, I will, but is it really necessary in your opinion? .

[PHP] PHP login script

2004-05-31 Thread René Fournier
I'm looking for some good, secure login code, and found the following article: http://www.devshed.com/c/a/PHP/Creating-a-Secure-PHP-Login-Script/ Not being much of a security expert, I was wondering if anyone here could say whether this code is any good? Or if there's a better one elsewhere? (I

php-general@lists.php.net

2004-05-31 Thread René Fournier
Oops... I mean, what's the difference between function &myfunction() { } and function myfunction() { } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

php-general@lists.php.net

2004-05-31 Thread René Fournier
What's the difference between function &myfunction() { } and function &myfunction() { } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How do I grab the contents of a web page?

2004-05-20 Thread René Fournier
On Thursday, May 20, 2004, at 06:42 PM, Brian Dunning wrote: On May 20, 2004, at 5:43 PM, raditha dissanayake wrote: I'm sure there's a really simple way to do this: how can I grab the source code of a specified web page and store it in a variable? Never mind, I found it: $string = get_file_conten

Re: [PHP] World's simplest tutorial on socket_select???

2004-05-20 Thread René Fournier
On Thursday, May 20, 2004, at 05:15 PM, Curt Zirzow wrote: * Thus wrote Ren Fournier ([EMAIL PROTECTED]): I am building a SIMPLE socket client that makes ONE connection to ONE server, and waits for data (socket_read)... and when no data comes for a few seconds, does something else, then waits for d

Re: [PHP] I am in Socket Paradise

2004-05-20 Thread René Fournier
On Thursday, May 20, 2004, at 04:17 PM, Chris W. Parker wrote: René Fournier <mailto:[EMAIL PROTECTED]> on Thursday, May 20, 2004 2:58 PM said: Please ignore my previous "I-AM-SO-FRUSTRATED-I-AM-READY-FOR-A-JACKET-WITH-REALLY-LONG-SLEEVES" posts. I have managed to solve my

[PHP] I am in Socket Paradise

2004-05-20 Thread René Fournier
Please ignore my previous "I-AM-SO-FRUSTRATED-I-AM-READY-FOR-A-JACKET-WITH-REALLY-LONG-SLEEVES" posts. I have managed to solve my socket woes. My simple client works loops, timesout, loops again... elegantly. (I've learned not take those PHP warnings so seriously... and to clear socket errors.)

[PHP] World's simplest tutorial on socket_select???

2004-05-20 Thread René Fournier
I've seen a sweet script for a multi-client, multi-socket server in PHP (http://dave.dapond.com/socketselect.php.txt), but its purpose is quite different from mine, and it's about one billion times more complex than I need. I am building a SIMPLE socket client that makes ONE connection to ONE

[PHP] Blocking vs. Selecting

2004-05-20 Thread René Fournier
MY PROGRAM FLOW: Enter loop Wait incoming data If (incoming data) { do something } elseif (no data && delay > 5 seconds) { send ping to server return to top of loop

[PHP] socket_select()

2004-05-20 Thread René Fournier
All the examples I see of socket_select() are on socket servers. But is it reasonable/feasible to use socket_select() on a socket client, that is receiving data periodically from a server (and when not receiving, doing something else)? ...Rene -- PHP General Mailing List (http://www.php.net/) T

[PHP] Missing data types?

2004-05-14 Thread René Fournier
I need to pack() data in PHP according to a typedef'ed C format structure, but there seems to be two problems (as per the docs: http://ca.php.net/manual/en/function.pack.php). First, in PHP there is no format option for "long signed integers, big-endian byte order", just "signed long (always 32

[PHP] Breaks on socket_read

2004-05-14 Thread René Fournier
Can anyone suggest why this script (well, part of the script) fails on the "while(($bug=socket_read..." line after it successfully loops several times? (Of course, it is only after it timesout, but that is what I need it to do.) ---CODE-- $msg_recv = 3; $timeout

[PHP] Socket client can do one thing (loop), but not the other (loop, timeout, loop again)

2004-05-14 Thread René Fournier
Hello everyone, I really appreciate the suggestions so far with my socket client problem. Somebody suggested I repost the issue with the program flow and code, to clarify the situation (a good idea). So here it is: To sumarrize: My socket client runs fine when all it does is (1) wait for data

Re: [PHP] Why would a socket be unavailable?

2004-05-14 Thread René Fournier
ointed out that as this thread has grown, the original issue is no longer clear.) Thanks guys for helping. ...rene Warren Vail -Original Message----- From: René Fournier [mailto:[EMAIL PROTECTED] Sent: Thursday, May 13, 2004 5:13 PM To: Vail, Warren Cc: php Subject: Re: [PHP] Why would a

Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
e ip address of the other process)? Warren Vail -Original Message- From: René Fournier [mailto:[EMAIL PROTECTED] Sent: Thursday, May 13, 2004 4:49 PM To: Vail, Warren Cc: php Subject: Re: [PHP] Why would a socket be unavailable? There is no firewall-it's all running locally, on my iBook

Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
ized sockets on protected machines. Warren Vail -Original Message- From: René Fournier [mailto:[EMAIL PROTECTED] Sent: Thursday, May 13, 2004 4:24 PM To: [EMAIL PROTECTED] Cc: php Subject: Re: [PHP] Why would a socket be unavailable? On Thursday, May 13, 2004, at 05:13 PM, Daniel Clark w

Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
On Thursday, May 13, 2004, at 05:13 PM, Daniel Clark wrote: http://www.php.net/manual/en/ref.sockets.ph Yes, I've read that page... many times. It has not helped me. That is why I am posting my problem here, in that hopes that someone can help. (I don't mean to be completely helpless, but I just

Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
There is no firewall. I'm running this locally. On Thursday, May 13, 2004, at 05:00 PM, raditha dissanayake wrote: #1 cause for socket failures happen to be firewalls. René Fournier wrote: I get this output: PHP Warning: socket_read() unable to read from socket [35]: Resource tempor

Re: [PHP] Socket looping challenge

2004-05-13 Thread René Fournier
The script doesn't even get that first "while" condition line. It loops a few times (while receiving messages), then when no more messages are coming from the server, and it times-out, it breaks out of the "while", then returns to the top again, where it that while condition returns the error "

[PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
I get this output: PHP Warning: socket_read() unable to read from socket [35]: Resource temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on line 63 From this code: do { socket_set_block($socket); socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);

[PHP] Socket looping challenge

2004-05-13 Thread René Fournier
Hi all, Still encountering some challenges with my socket loop. Basically, I need this socket client to wait to read incoming data, but if nothing happens for more than three seconds, I want it to do something, then return to waiting (for another three seconds). I've got some good help fro

Re: [PHP] Breaking out of a loop...

2004-05-12 Thread René Fournier
Thanks for the help, but I now get the error "PHP Warning: socket_set_option() expects exactly 4 parameters, 3 given in /Users/test/cr.php on line 51" when I run the script. Also, it still seems to just wait on that "while" line, instead of skipping to the "} elseif ($elapsed > 5) {" a

[PHP] Breaking out of a loop...

2004-05-12 Thread René Fournier
Hi, I have this code (below) that waits for particular data to come over the socket ("ENX"), at which point it breaks out of the loop and does other things. Presently, it will loop forever, until it receives "ENX"—a good start—but I also need it to break-out if the loop runs longer than five s

[PHP] Constant questions

2004-05-12 Thread René Fournier
Hi, I have two questions involving Constants. 1. I want to refer to a refer to a Constant by its value (which is unique), and return its name. E.g.,: define ("SEND_DS","1"); define ("SEND_DS_ACK","2"); define ("RESEND_DS","3"); define ("STARTUP_DS","12"); For exa

[PHP] Binary to ASCII

2004-05-10 Thread René Fournier
When reading from a Socket Server, my Socket Client retrieves data that includes ASCII and binary data: while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) { $data .= $buf; if(preg_match("/ENX/", $data)) break; } echo "RESPONSE: ".$data."\n"; The output look

[PHP] unsigned long int

2004-05-10 Thread René Fournier
I don't know C, but I was wondering if it is possible to: 1. Define 32-bit integer in PHP, called $val (max value of $val); 2. Assign the value of 10 to $val. 3. Pack $val to a binary variable ($bin_var); ...such that $val is only equal to 10, but it is occupying 32-bits of data... (In case you

[PHP] To pack(), or not to pack()

2004-05-10 Thread René Fournier
Hi, I'm developing a PHP program that must send data, over a socket connection, to a server. The server requires the data in a particular format, e.g.: FORMAT: 3-byte delimiter - Message Length (N = 4 bytes) - Message Type (4 bytes) - Message Body (N - 4 bytes) - 3-byte Delimiter SAMPLE MESSA

[PHP] Socket server with multiple connections

2004-04-23 Thread René Fournier
I've gone through a few good socket client and server tutorials (such as http://www.devshed.com/c/a/PHP/Socket-Programming-With-PHP/), and have got the samples working. What I'm trying to do now is write a simple Socket Server that will accept multiple connections, do its thing, and keep runnin

[PHP] Socket Server problem

2004-04-15 Thread René Fournier
I'm working through Ori Staub's excellent Socket Server tutorial (http://www.zend.com/zend/tut/tutorial-staub3.php), but can't get the sample server working. I've read the user comments and fixed a couple things, but still, no dice. Here's the error I receive: [Valhalla:~/Sites/test] rene% /usr

[PHP] Socket client application

2004-04-13 Thread René Fournier
Hi, I've gone through several good PHP sockets tutorials, but all of them seem to focused on making socket servers. What I actually need to do is write a socket client. There's an app runnning on a distant server that accepts incoming TCP connections at such-and-such an IP address and port, an

[PHP] regular expressions

2004-04-09 Thread René Fournier
I'm trying to 'clean up' some text that is extracted from a web directory, and I need to use (I think) preg_replace or ereg_replace, etc. I've read a bunch of tutorials, but none of them seem to cover the particular thing I want to do. Here's an example of text I need to process: - J.

[PHP] HELP! -- Problem with imagejpeg()

2003-12-27 Thread René Fournier
Hello, I have a function that is meant to check if an image is greater than a certain width and height, and if it is, downsample it. The checking part works fine. Downsampling is not happening though. Here's what I've got (btw, $file = "/somedirectory/photo.jpg"): $src_img=imagecreatefromJPEG($

[PHP] Problems with imagejpeg

2003-12-27 Thread René Fournier
I have a function that [is meant to] check if an image is greater than a certain width and height, and if it is, downsample it. The checking part works fine. Downsampling is happening though. Here's what I've got ($file = "/somedirectory/photo.jpg"): $src_img=imagecreatefromJPEG($file);

[PHP] GD question

2003-11-16 Thread René Fournier
I want to write a function the creates a new image composited from a 3x3 tile. The idea is that the center tile will be a photo, and the surrounding eight images will constitute a border and shadow to the composited image. So... The eight "border/shadow" images will always be the same, but the

[PHP] Sweet PHP backup / dump function for MySQL database

2003-11-04 Thread René Fournier
Right now, I'm using phpMyAdmin to periodically backup/dump a client MySQL database to a textfile (from which one can simply restore the database if it ever got corrupted). I'm also working on a super-simple CMS for the client to use themselves. I would like the client to also be able to easily

[PHP] mysql_field_type() ...

2003-11-03 Thread René Fournier
...will say if a field is of type "ENUM", but not its possible values (including default). Does anyone know how I can fetch possible values of a field type of ENUM? Thanks. ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Copying an uploaded file...

2003-10-30 Thread René Fournier
it without changing the "userfile" part—and since there was no 'userfile' in my form, it would never have worked. Using my own variable pointer $fld works. Thus: copy($_FILES[$fld]['tmp_name']. ...works. And that is all. In any case, thanks for the suggestions. ...

Re: [PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
I've added a path, but still no success On Wednesday, October 29, 2003, at 05:11 PM, John Nichel wrote: René Fournier wrote: Thanks John. I've simplified and improved the quote per your suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is the code: /

Re: [PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
pvnTFqr [error] => 0 [size] => 2326 ) ) Should the tmp directory maybe be set elsewhere? (If so, how can that be done? I've looked at the httpd.conf file, but there is no entry for upload tmp directory.) Many thanks in advance. ...Rene On Wednesday

Re: [PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
pvnTFqr [error] => 0 [size] => 2326 ) ) Should the tmp directory maybe be set elsewhere? (If so, how can that be done? I've looked at the httpd.conf file, but there is no entry for upload tmp directory.) Many thanks in advance. ...Rene On Wednesday

[PHP] Copying an uploaded file...

2003-10-29 Thread René Fournier
I'm trying to get a little upload script working... But I can't seem to copy the tmp file to my local web directory (btw, do I really need to specify the path, or can I just use a filename, and the file will be written to the same directory as the PHP script??). Anyway, here is the code: $rea

[PHP] Tricky variable syntax...

2003-10-27 Thread René Fournier
I'm trying to refer to a variable using $$, but with a twist. So far, this works: echo 'temp file: '.$$fld.''; In this case, $fld equals "img_photo" (although it could be anything). The above statement could have thus been "echo 'file name: '.$img_photo.'';" with the same results. So here I actua

[PHP] Check mysq_field_type, display appropriate FORM element

2003-10-22 Thread René Fournier
Hello everyone, I'm upgrading my simple CMS app, and would like to add a [simple] function to it—which I'm finding is no so simple (at least for me). To illustrate: The user clicks "Edit" on a particular table row. The CMS then fetches that row from the table and begins displaying the value of

  1   2   >