WAMP gzopen issue
Posted by: Lworth (12.15.215.---)
Date: July 18, 2012 12:03AM

I am very very new to scripting and using WAMP. I am trying to send data from a Data Acquisition Server to another PC on my network. I have setup the PHP script based on a template that was sent to me. I keep getting the following error: Can't open logfile. gzopen($LOGFILE) failed. This comes from the following section of my PHP script:

*/
function ProcessLogFileUpload($REMOTE_ADDR, $SERIALNUMBER, $MODBUSIP, $MODBUSPORT, $MODBUSDEVICE, $LOGFILE,
$MODBUSDEVICENAME, $MODBUSDEVICETYPE, $MODBUSDEVICETYPENUMBER, $MODBUSDEVICECLASS)
{
// check here to verify the modbus device name, type, and class make sense
// locate the correct table name to store the data in the sql table

$nSuccessCount = 0; // set counters to zero.
$nDuplicateCount = 0;
$nRejectCount = 0;

$fd = gzopen($LOGFILE, "r"winking smiley;
if (! $fd)
{ ReportFailure("Can't open logfile. gzopen($LOGFILE) failed.", $REMOTE_ADDR, $SERIALNUMBER, $MODBUSIP, $MODBUSPORT, $MODBUSDEVICE);
exit;
}
else

I was told that it is something in the Apache server that I have to enable to use the gzopen function to decompress the incoming files. Is anyone aware of this? It could be something in my scripting, but I was hoping it was something really simple like enabling gzopen through Apache. Again, I am very new to all of this so please bare with me.

Thank you.

Options: ReplyQuote
Re: WAMP gzopen issue
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: July 18, 2012 05:18PM

The gz functions use the zlib extension i believe. As of php 4.3 it is a built in feature and no extensions are required. Pre php 4.3 you have to include the zlib extension.

Are you using an old version of php?

Options: ReplyQuote
Re: WAMP gzopen issue
Posted by: Lworth (12.15.215.---)
Date: July 23, 2012 03:27PM

No, I am using version 5.3.

Options: ReplyQuote
Re: WAMP gzopen issue
Posted by: RiggsFolly (---.ppp.as43234.net)
Date: July 23, 2012 06:37PM

This may sound silly but can you do an

echo $LOGFILE

before the $fd = gzopen($LOGFILE, 'r' ) ;

Then check that that file actually exists, in the correct folder, read will only work if file is there and can be read.

Options: ReplyQuote


Sorry, only registered users may post in this forum.