[PHP] php5beta4 problem

2004-02-12 Thread Gareth Thomas
Hi,

just updated from beta3 (which worked fine) and now my system is hosed. I am
running Apache 1.3.29 on WinXP and when I try and simply bring up phpinfo I
get the following message in the Apache error log file:

Premature end of script headers: c:/php/php.exe

Anyone any idea what is causing this?? One thing I did notice is that the
Zip distribution of b4 is different to b3, for example it no longer creates
a sapi directory with the apache dll's in, so I am wondering if this problem
might be due to subtle differences in the distribution.

Any help would be much appreciated.

G.

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



[PHP] cli file open problem

2003-08-03 Thread Gareth Thomas
Hi,

I am trying to write data to a text file on my Windows 2000 server using PHP
at the command line. I am running PHP 4.3.2, and the script uses the 'touch'
function to create the file (which works fine) but when I try and open the
file to write to it and errors. Anyone any idea? I have checked the security
and also IIS access.. I would assume however that if touch works then so
would fopen... I am stumped. Any help would be much appreciated.

G.



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



[PHP] linux cpu usage

2003-01-24 Thread Gareth Thomas
Hi all,

I have a command line PHP script that is in a continous loop to monitor a
particular database event. I am running RedHat 8 and the only problem I am
finding is that it hogs the CPU. I developed the script originally on
Windows and it worked better there. Is there a way to limit CPU resource for
a PHP command line script in Linux?

Gareth



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




Re: [PHP] apache and php

2003-01-09 Thread Gareth Thomas
Tim,

thanks but it still doesn't work. What puzzles me is that last night I
reinstalled a  'vanilla' install of RedHat 8 from the distribution where I
selected PHP and Apache. So now I am running PHP 4.2.2 and Apache 2.0.40, I
make the change you recommened to httpd.conf, stop and restart the service
and it still simply ignores the PHP code...this is driving me insane.

Gareth

Timothy Hitchens ) [EMAIL PROTECTED] wrote in message
007101c2b784$652736b0$0500a8c0@bambino">news:007101c2b784$652736b0$0500a8c0@bambino...
 Your settings should be something similar to this:

 IfModule mod_php4.c
 AddType application/x-httpd-php .php .html
 AddType application/x-httpd-php-source .phps
 /IfModule

 Do you have the page remotely available to see what is happening for
 you??



 Timothy Hitchens (HiTCHO)
 Open Platform Consulting
 e-mail: [EMAIL PROTECTED]

  -Original Message-
  From: Gareth Thomas [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, 9 January 2003 12:03 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] apache and php
 
 
  I am trying to run a PHP page from my browser (Mozilla) and
  each time I load the page it is attempting to force a dowload
  of the page instead, based on the mime-type. I had been
  developing a command line PHP application which works fine
  and then had just started on a web interface and realised
  that Apache may not be configured correctly. So I edited
  httpd.conf and added the Add Type line for x-type-httpd .php.
  I am running Apache 2.0.40 on RedHat 8 and PHP 4.3.0pre2. Can
  anyone tell me what I am doing wrong? What should the
  modifications be to httpd.conf for PHP?
 
  Thanks in advance
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




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




[PHP] apache and php

2003-01-08 Thread Gareth Thomas
I am trying to run a PHP page from my browser (Mozilla) and each time I load
the page it is attempting to force a dowload of the page instead, based on
the mime-type. I had been developing a command line PHP application which
works fine and then had just started on a web interface and realised that
Apache may not be configured correctly. So I edited httpd.conf and added the
Add Type line for x-type-httpd .php. I am running Apache 2.0.40 on RedHat 8
and PHP 4.3.0pre2. Can anyone tell me what I am doing wrong? What should the
modifications be to httpd.conf for PHP?

Thanks in advance





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




[PHP] socket timeout

2002-12-05 Thread Gareth Thomas
Hi,

I am attempting to timeout a socket_read() that is part of a handshaking
process using socket_set_timeout(). Problem is it doesn't seem to work at
all. If I switch of the handshaking write on the server side the read just
sits there and doesn't time out at all. I have tried
socket_set_timeout($socket,1) which I believe is 1 second and it never times
out...

Any thoughts on this would be most appreciated.

Gareth



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




[PHP] Re: socket timeout

2002-12-05 Thread Gareth Thomas
Hi,

apparently this does not work with socket_read() but only with higher level
socket functions (fread etc). However I have found a function called
socket_set_nonblock(socketname) which apparently does something very
similar, it prevents the socket_read from waiting to receive data. I simply
built my own timeout loop into the code and voila!!

Gareth

Gareth Thomas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I am attempting to timeout a socket_read() that is part of a handshaking
 process using socket_set_timeout(). Problem is it doesn't seem to work at
 all. If I switch of the handshaking write on the server side the read just
 sits there and doesn't time out at all. I have tried
 socket_set_timeout($socket,1) which I believe is 1 second and it never
times
 out...

 Any thoughts on this would be most appreciated.

 Gareth





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




[PHP] re-writing to the same socket

2002-11-26 Thread Gareth Thomas
Hi,

I have some code that writes data to a socket (works fine) and stores the
resource id created in a table with the column defined as varchar (80). Then
the next time I need to write data to the same IP I retrieve the resource id
and reuse it. Problem is that the socket_write seems to work fine (it
returns no error) and yet the data appears to disappear into the ether...I
am using 4.2.3 client on Win2K and server on Linux.

Anyone have any ideas.

Any help much appreciated.

G.



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




[PHP] sockets (again)

2002-11-25 Thread Gareth Thomas
Hi,

I really need some help here because I am going to lose my mind otherwise!!
A script that was running fine Friday has decided not to work for no
apparent reason today. The problem seems to be with a socket_create that
just stops the script, so I created a simple test script as shown below to
see what happens. When I run this is simply drops out at the socket_create,
no error message, nothing. Again this worked fine Friday and nothing has
changed on my machine. I am running 4.2.3 on Win2K... any ideas? Help!!


G.

$zone = 192.168.0.60;
$port = 1;
$command = play;

echo('here');

$slip_socket = socket_create (AF_INET, SOCK_STREAM, 0);

echo('here 2');

if ($slip_socket  0) {
   echo socket_create() failed: reason:  . socket_strerror ($slip_socket)
. \n;
} else {
   $result = socket_connect ($slip_socket, $zone, $port);
   if ($result  0) {
  echo socket_connect() failed.\nReason: ($result)  .
socket_strerror($result) . \n;
   }
}

$command=$command.\n;
echo('Sending command: '.$command.' for '.$zone.'\n');
socket_write ($slip_socket, $command, strlen ($command));




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




[PHP] sockets

2002-11-21 Thread Gareth Thomas
Hi,

I realise that sockets is still 'experimental' but any help will be much
appreciated. I am developing a queue system to send commands across from a
server to a client using sockets. Problem is that the I keep getting a
'connection reset by peer' error after the first command is sent. The server
script itself is in a loop which I believe should maintain the socket
connection. I am using socket_write() to send the data across the socket,
and I am wondering if I should be using socket_send()? Does anyone have any
ideas or experience of doing this?

My PHP version is 4.2.3. My server software is running on Windows and client
software on Linux although eventually both will be on Linux.

Thanks.

Gareth




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




[PHP] sockets

2002-11-07 Thread Gareth Thomas
Hi,

I am running 4.3.0pre2 on RH 7.2 and on Windows2k I am trying to implement a
socket based client/server communication program with the server being on
the Linux side and the current test client on windows (although it will be
on Linux eventually). A series of commands is sent by the client side which
consists of 2 PHP pages, the first with some buttons and the second that
sends the button commands to the server using sockets. The problem I am
finding is that it appears PHP closes the socket connection once the second
script has ended and it returns back to the first. Is there anyway of
keeping the socket 'open' or can someone suggest a better way of doing
this...

Thanks in advance