php-general Digest 17 Jul 2008 08:21:49 -0000 Issue 5573
Topics (messages 276931 through 276946):
Copy Function Errors
276931 by: Wei, Alice J.
276932 by: Robert Cummings
276934 by: Wei, Alice J.
276935 by: Daniel Brown
276936 by: Robert Cummings
276937 by: Robert Cummings
276938 by: Boyd, Todd M.
276941 by: bruce
276944 by: Wei, Alice J.
Child PID exit signal Illegal instruction (4)
276933 by: Schiz0
Re: is there a problem with php script pulling HTML out of database as it
writes the page??
276939 by: Stut
276940 by: Daniel Brown
Corrupted ZIP files (downloaded via a php script) : Internext Explorer 7
276942 by: robert mena
276946 by: Peter Ford
Soap Call Error
276943 by: VamVan
276945 by: Jason Norwood-Young
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 ---
Hi,
I have a snippet of code here:
shell_exec("tar cvf /var/www/html/test/$id/data.tar
/var/www/html/test/$id/data");
$file1="http:/www.mysite.com/test/$id/data.tar";
$file2="http://www.mysite2.com/test/$id/.tar";
copy($file1,$file2);
I got the following error in the access log of the server:
[Wed Jul 16 15:45:57 2008] [error] PHP Warning:
copy(http://www.mysite.com/test/145/data.tar) [<a
href='function.copy'>function.copy</a>]: failed to open stream: HTTP wrapper
does not support writeable connections. in /var/www/html/beam_calculation.php
on line 20
Is there something I could do here to allow my file be "copied" to the remote
server?
Anything is appreciated.
Alice
======================================================
Alice Wei
MIS 2009
School of Library and Information Science
Indiana University Bloomington
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
On Wed, 2008-07-16 at 15:58 -0400, Wei, Alice J. wrote:
> Hi,
>
> I have a snippet of code here:
>
> shell_exec("tar cvf /var/www/html/test/$id/data.tar
> /var/www/html/test/$id/data");
>
> $file1="http:/www.mysite.com/test/$id/data.tar";
> $file2="http://www.mysite2.com/test/$id/.tar";
>
> copy($file1,$file2);
>
> I got the following error in the access log of the server:
>
> [Wed Jul 16 15:45:57 2008] [error] PHP Warning:
> copy(http://www.mysite.com/test/145/data.tar) [<a
> href='function.copy'>function.copy</a>]: failed to open stream: HTTP wrapper
> does not support writeable connections. in /var/www/html/beam_calculation.php
> on line 20
>
> Is there something I could do here to allow my file be "copied" to the remote
> server?
Use the ftp functions.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
> Hi,
>
> I have a snippet of code here:
>
> shell_exec("tar cvf /var/www/html/test/$id/data.tar
> /var/www/html/test/$id/data");
>
> $file1="http:/www.mysite.com/test/$id/data.tar";
> $file2="http://www.mysite2.com/test/$id/.tar";
>
> copy($file1,$file2);
>
> I got the following error in the access log of the server:
>
> [Wed Jul 16 15:45:57 2008] [error] PHP Warning:
> copy(http://www.mysite.com/test/145/data.tar) [<a
> href='function.copy'>function.copy</a>]: failed to open stream: HTTP wrapper
> does not support writeable connections. in /var/www/html/beam_calculation.php
> on line 20
>
> Is there something I could do here to allow my file be "copied" to the remote
> server?
Use the ftp functions.
Thanks for the tip. I have revised my code to:
// define some variables
$local_file = "C:/Inetpub/wwwroot/test/$id/beamdata.tar";
$server_file = "http://192.168.10.63/test/$id/beamdata.tar";
// set up basic connection
$ftp_server="http://192.168.10.63";
$conn_id = ftp_connect($ftp_server);
// login with username and password
$ftp_user_name="apache";
$ftp_user_pass="xxxxx";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
echo "Successfully written to $local_file\n";
} else {
echo "There was a problem\n";
}
// close the connection
ftp_close($conn_id);
I have put this snippet in the local server of where I want the files to be
copied to. However, I see this on my remote server in the logs:
192.168.10.62 - - [16/Jul/2008:16:40:24 -0400] "GET
/beam_calculation.php?id=145&no=16 HTTP/1.1" 200 22 "-" "Mozilla/4.0
(compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
Is there something I have missed here?
Alice
--- End Message ---
--- Begin Message ---
On Wed, Jul 16, 2008 at 4:45 PM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I have a snippet of code here:
>>
>> shell_exec("tar cvf /var/www/html/test/$id/data.tar
>> /var/www/html/test/$id/data");
>>
>> $file1="http:/www.mysite.com/test/$id/data.tar";
>> $file2="http://www.mysite2.com/test/$id/.tar";
>>
>> copy($file1,$file2);
>>
>> I got the following error in the access log of the server:
>>
>> [Wed Jul 16 15:45:57 2008] [error] PHP Warning:
>> copy(http://www.mysite.com/test/145/data.tar) [<a
>> href='function.copy'>function.copy</a>]: failed to open stream: HTTP wrapper
>> does not support writeable connections. in
>> /var/www/html/beam_calculation.php on line 20
>>
>> Is there something I could do here to allow my file be "copied" to the
>> remote server?
>
> Use the ftp functions.
>
> Thanks for the tip. I have revised my code to:
>
> // define some variables
> $local_file = "C:/Inetpub/wwwroot/test/$id/beamdata.tar";
> $server_file = "http://192.168.10.63/test/$id/beamdata.tar";
>
> // set up basic connection
> $ftp_server="http://192.168.10.63";
> $conn_id = ftp_connect($ftp_server);
>
> // login with username and password
> $ftp_user_name="apache";
> $ftp_user_pass="xxxxx";
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> // try to download $server_file and save to $local_file
> if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
> echo "Successfully written to $local_file\n";
> } else {
> echo "There was a problem\n";
> }
>
> // close the connection
> ftp_close($conn_id);
>
> I have put this snippet in the local server of where I want the files to be
> copied to. However, I see this on my remote server in the logs:
>
> 192.168.10.62 - - [16/Jul/2008:16:40:24 -0400] "GET
> /beam_calculation.php?id=145&no=16 HTTP/1.1" 200 22 "-" "Mozilla/4.0
> (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
>
> Is there something I have missed here?
Are you considered a "special student" at the University?
--
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.
--- End Message ---
--- Begin Message ---
On Wed, 2008-07-16 at 16:53 -0400, Daniel Brown wrote:
> On Wed, Jul 16, 2008 at 4:45 PM, Wei, Alice J. <[EMAIL PROTECTED]> wrote:
> >
> > Is there something I have missed here?
>
> Are you considered a "special student" at the University?
Now, now, no need to be mean. We were all noobs at one time or another.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
On Wed, 2008-07-16 at 16:45 -0400, Wei, Alice J. wrote:
> > Hi,
> >
> > I have a snippet of code here:
> >
> > shell_exec("tar cvf /var/www/html/test/$id/data.tar
> > /var/www/html/test/$id/data");
> >
> > $file1="http:/www.mysite.com/test/$id/data.tar";
> > $file2="http://www.mysite2.com/test/$id/.tar";
> >
> > copy($file1,$file2);
> >
> > I got the following error in the access log of the server:
> >
> > [Wed Jul 16 15:45:57 2008] [error] PHP Warning:
> > copy(http://www.mysite.com/test/145/data.tar) [<a
> > href='function.copy'>function.copy</a>]: failed to open stream: HTTP
> > wrapper does not support writeable connections. in
> > /var/www/html/beam_calculation.php on line 20
> >
> > Is there something I could do here to allow my file be "copied" to the
> > remote server?
>
> Use the ftp functions.
>
> Thanks for the tip. I have revised my code to:
>
> // define some variables
> $local_file = "C:/Inetpub/wwwroot/test/$id/beamdata.tar";
> $server_file = "http://192.168.10.63/test/$id/beamdata.tar";
>
> // set up basic connection
> $ftp_server="http://192.168.10.63";
Shouldn't that be:
$ftp_server="192.168.10.63";
http:// indicates a protocol and I don't think ftp supports the protocol
prefix understood by browsers.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 16, 2008 3:46 PM
> To: Robert Cummings
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Copy Function Errors
---8<--- snip
> > Is there something I could do here to allow my file be "copied" to
> the remote server?
>
> Use the ftp functions.
>
> Thanks for the tip. I have revised my code to:
>
> // define some variables
> $local_file = "C:/Inetpub/wwwroot/test/$id/beamdata.tar";
> $server_file = "http://192.168.10.63/test/$id/beamdata.tar";
>
> // set up basic connection
> $ftp_server="http://192.168.10.63";
> $conn_id = ftp_connect($ftp_server);
>
> // login with username and password
> $ftp_user_name="apache";
> $ftp_user_pass="xxxxx";
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> // try to download $server_file and save to $local_file
> if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
> echo "Successfully written to $local_file\n";
> } else {
> echo "There was a problem\n";
> }
>
> // close the connection
> ftp_close($conn_id);
>
> I have put this snippet in the local server of where I want the files
> to be copied to. However, I see this on my remote server in the logs:
>
> 192.168.10.62 - - [16/Jul/2008:16:40:24 -0400] "GET
> /beam_calculation.php?id=145&no=16 HTTP/1.1" 200 22 "-" "Mozilla/4.0
> (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR
> 2.0.50727)"
>
> Is there something I have missed here?
Alice,
Here are some Wikipedia articles that should give you a good start on
understanding the fundamental differences between the two protocols you
are confusing with each other:
http://en.wikipedia.org/wiki/FTP
http://en.wikipedia.org/wiki/HTTP
HTTP itself does not intrinsically handle file uploads in a
server/client relationship. Web forms that include file uploads
generally have a handler function on the other end, and post files via a
form element.
FTP's main function is the transfer of files (hence [F]ile [T]ransfer
[P]rotocol), and is more in line with what you're trying to do here.
HTH,
Todd Boyd
Web Programmer
--- End Message ---
--- Begin Message ---
Hi Alice...
I just caught/saw this thread. I'm asuming you haven't found/solved what
you're trying to do.
So, What exactly are you trying to accomplish? What OS are you running on
both the client/server machine? Are you trying to copy from a directory on
one box, to a directory on another box? Is this a one time thing? Are the
boxes on the same network (physically close together)? Are you able to login
to the remote box from your initial server?
Let me know what you're looking to do, and I can probably get you going.
-regards...
-----Original Message-----
From: Boyd, Todd M. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2008 2:28 PM
To: Wei, Alice J.
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Copy Function Errors
> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 16, 2008 3:46 PM
> To: Robert Cummings
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Copy Function Errors
---8<--- snip
> > Is there something I could do here to allow my file be "copied" to
> the remote server?
>
> Use the ftp functions.
>
> Thanks for the tip. I have revised my code to:
>
> // define some variables
> $local_file = "C:/Inetpub/wwwroot/test/$id/beamdata.tar";
> $server_file = "http://192.168.10.63/test/$id/beamdata.tar";
>
> // set up basic connection
> $ftp_server="http://192.168.10.63";
> $conn_id = ftp_connect($ftp_server);
>
> // login with username and password
> $ftp_user_name="apache";
> $ftp_user_pass="xxxxx";
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> // try to download $server_file and save to $local_file
> if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
> echo "Successfully written to $local_file\n";
> } else {
> echo "There was a problem\n";
> }
>
> // close the connection
> ftp_close($conn_id);
>
> I have put this snippet in the local server of where I want the files
> to be copied to. However, I see this on my remote server in the logs:
>
> 192.168.10.62 - - [16/Jul/2008:16:40:24 -0400] "GET
> /beam_calculation.php?id=145&no=16 HTTP/1.1" 200 22 "-" "Mozilla/4.0
> (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR
> 2.0.50727)"
>
> Is there something I have missed here?
Alice,
Here are some Wikipedia articles that should give you a good start on
understanding the fundamental differences between the two protocols you
are confusing with each other:
http://en.wikipedia.org/wiki/FTP
http://en.wikipedia.org/wiki/HTTP
HTTP itself does not intrinsically handle file uploads in a
server/client relationship. Web forms that include file uploads
generally have a handler function on the other end, and post files via a
form element.
FTP's main function is the transfer of files (hence [F]ile [T]ransfer
[P]rotocol), and is more in line with what you're trying to do here.
HTH,
Todd Boyd
Web Programmer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Alice...
I just caught/saw this thread. I'm asuming you haven't found/solved what you're
trying to do.
So, What exactly are you trying to accomplish? What OS are you running on both
the client/server machine? Are you trying to copy from a directory on one box,
to a directory on another box? Is this a one time thing? Are the boxes on the
same network (physically close together)? Are you able to login to the remote
box from your initial server?
Let me know what you're looking to do, and I can probably get you going.
What I am trying to accomplish is something simple, which is to copy the files
from one single directory, which is already tarred, and have it be copied to a
remote server. I am guessing that it is never too difficult to untar it when I
get it successfully copied to another server. Right now it appears to me that
it keeps on going to the second loop that says it failed, probably because my
password and user do not match? I have tried switching that to apache, which is
what I set in my httpd.conf for user and group.
I was browsing through the articles Todd suggested, and the port number 1025
kept popping up. I am not sure if I am supposed to open this port on my remote
and my local machine. I do have ssh, which is port 22 open.
Thanks in advance.
Alice
-regards...
-----Original Message-----
From: Boyd, Todd M. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2008 2:28 PM
To: Wei, Alice J.
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Copy Function Errors
> -----Original Message-----
> From: Wei, Alice J. [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 16, 2008 3:46 PM
> To: Robert Cummings
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Copy Function Errors
---8<--- snip
> > Is there something I could do here to allow my file be "copied" to
> the remote server?
>
> Use the ftp functions.
>
> Thanks for the tip. I have revised my code to:
>
> // define some variables
> $local_file = "C:/Inetpub/wwwroot/test/$id/beamdata.tar";
> $server_file = "http://192.168.10.63/test/$id/beamdata.tar";
>
> // set up basic connection
> $ftp_server="http://192.168.10.63";
> $conn_id = ftp_connect($ftp_server);
>
> // login with username and password
> $ftp_user_name="apache";
> $ftp_user_pass="xxxxx";
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> // try to download $server_file and save to $local_file
> if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
> echo "Successfully written to $local_file\n";
> } else {
> echo "There was a problem\n";
> }
>
> // close the connection
> ftp_close($conn_id);
>
> I have put this snippet in the local server of where I want the files
> to be copied to. However, I see this on my remote server in the logs:
>
> 192.168.10.62 - - [16/Jul/2008:16:40:24 -0400] "GET
> /beam_calculation.php?id=145&no=16 HTTP/1.1" 200 22 "-" "Mozilla/4.0
> (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR
> 2.0.50727)"
>
> Is there something I have missed here?
Alice,
Here are some Wikipedia articles that should give you a good start on
understanding the fundamental differences between the two protocols you
are confusing with each other:
http://en.wikipedia.org/wiki/FTP
http://en.wikipedia.org/wiki/HTTP
HTTP itself does not intrinsically handle file uploads in a
server/client relationship. Web forms that include file uploads
generally have a handler function on the other end, and post files via a
form element.
FTP's main function is the transfer of files (hence [F]ile [T]ransfer
[P]rotocol), and is more in line with what you're trying to do here.
HTH,
Todd Boyd
Web Programmer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hey,
I'm running PHP 5.2.6 on FreeBSD 7.0-RELEASE-p2, using apache 2.2.9. I
have a PHP script that is valid code (I tested it on another server
and it worked fine). The problem is, it keeps killing the httpd
processes and outputting nothing.
I get this message in my apache error logs each time the php script is called:
[Wed Jul 16 20:10:18 2008] [notice] child pid 70553 exit signal
Illegal instruction (4)
And same thing in /var/log/messages:
kernel: pid 70649 (httpd), uid 80: exited on signal 4
I read that it has to do with PCRE, so I tried commenting out all the
preg and ereg functions, but that also didn't work.
Here's a list of the modules I'm using:
[PHP Modules]
bz2
date
dom
filter
gd
geoip
hash
iconv
libxml
mbstring
mcrypt
memcache
mysql
mysqli
pcre
Reflection
session
SimpleXML
sockets
SPL
standard
xml
zip
zlib
This is really frustrating me. I'm about to switch over to Lighttpd to
see if it would help :-\
Any suggestions/ideas/comments/solutions would greatly be appreciated.
--- End Message ---
--- Begin Message ---
On 16 Jul 2008, at 19:18, Daniel Brown wrote:
On Tue, Jul 15, 2008 at 5:43 PM, Stut <[EMAIL PROTECTED]> wrote:
Code please, we're not mind readers!
I sensed you would say that, Stuart. ;-P
Can you sense what I'm thinking right now?
BTW, if anyone is looking for a PHP5/MySQL dev job in or around
Camberley, Surrey, England please drop me your CV. Looking for all
levels to join a small team (me + 2 non-devs). Contact me personally
for more info. Sorry, remote working is not an option. We will
consider both perm and contract but perm is preferred. Oh, and you'd
be working for me so bear that in mind ;)
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Wed, Jul 16, 2008 at 5:28 PM, Stut <[EMAIL PROTECTED]> wrote:
>
> Oh, and you'd be working for me so bear that in mind ;)
*crickets*
(And not the games.)
--
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.
--- End Message ---
--- Begin Message ---
Hi,
I have a set of files stored in a directory and I need to serve those via a
php script (in order to protect, control access etc).
The problem is that zip files (exe also) get corrupted when I try from IE7.
I've read the posts from this list and google etc with no idea of how to
solve it.
The stored files are ok (tested from firefox or direct copy). When I use
IE7 the file size is smaller. In my test a config.zip with 248 bytes ends
up with 214 bytes.
This is the code used
header("Pragma: public");
header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: ".$type);
if($remove_date_from_file == false)
header('Content-Disposition: attachment;
filename="'.basename($file).'"');
else
{
$name_ = substr(basename($file),0,strrpos(basename($file),"."));
$ext_ = substr(basename($file),strrpos(basename($file),"."));
$new_name_ = substr($name_,0,strlen($name_)-15).$ext_;
header('Content-Disposition: attachment;
filename="'.$new_name_.'"');
}
header("Content-Transfer-Encoding: binary");
header('Content-Length: '.filesize($file));
while(!feof($fp))
{
echo fgets($fp) ;
}
fclose($fp);
I've added a debug to send me a message with the header and it comes the
same way no matter what browser.
Pragma: public
Expires: Wed, 16 Jul 2008 23:12:00 GMT
Cache-Control: must-revalidate, post-check=0, pre-check=0
Cache-Control: private
Content-Type: application/zip
Content-Disposition: attachment; filename="config.zip"
Content-Transfer-Encoding: binary
Content-Length: 248
Am I doing something wrong or do I have to start looking to the server's
configuration (like mod_deflate)?
--- End Message ---
--- Begin Message ---
robert mena wrote:
Hi,
I have a set of files stored in a directory and I need to serve those via a
php script (in order to protect, control access etc).
The problem is that zip files (exe also) get corrupted when I try from IE7.
I've read the posts from this list and google etc with no idea of how to
solve it.
The stored files are ok (tested from firefox or direct copy). When I use
IE7 the file size is smaller. In my test a config.zip with 248 bytes ends
up with 214 bytes.
This is the code used
header("Pragma: public");
header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: ".$type);
if($remove_date_from_file == false)
header('Content-Disposition: attachment;
filename="'.basename($file).'"');
else
{
$name_ = substr(basename($file),0,strrpos(basename($file),"."));
$ext_ = substr(basename($file),strrpos(basename($file),"."));
$new_name_ = substr($name_,0,strlen($name_)-15).$ext_;
header('Content-Disposition: attachment;
filename="'.$new_name_.'"');
}
header("Content-Transfer-Encoding: binary");
header('Content-Length: '.filesize($file));
while(!feof($fp))
{
echo fgets($fp) ;
}
fclose($fp);
I've added a debug to send me a message with the header and it comes the
same way no matter what browser.
Pragma: public
Expires: Wed, 16 Jul 2008 23:12:00 GMT
Cache-Control: must-revalidate, post-check=0, pre-check=0
Cache-Control: private
Content-Type: application/zip
Content-Disposition: attachment; filename="config.zip"
Content-Transfer-Encoding: binary
Content-Length: 248
Am I doing something wrong or do I have to start looking to the server's
configuration (like mod_deflate)?
Instead of that looping through every byte, have you tried just using the
readfile() function?
In fact, in that code you posted I don't see you opening the file (where does
$fp come from?)
Also in your code, you don't flush the file before closing (fflush($fp)), which
might make a difference, especially since your result seems to be a few bytes short.
Oh, and make VERY sure that there is *nothing* output to the client before you
start pushing the ZIP file out - that definitely leads to corruption of such
things, although if you were sending data before changing the headers you would
get an error message about that.
What I can't understand is why is might work with one browser and not another...
--
Peter Ford phone: 01580 893333
Developer fax: 01580 893399
Justcroft International Ltd., Staplehurst, Kent
--- End Message ---
--- Begin Message ---
Hello Guys,
I have been getting a wierd soap exception lately
[faultstring] => looks like we got no XML document
[faultcode] => Client
[faultcodens] => http://schemas.xmlsoap.org/soap/envelope/
What does that mean? The call gets properly called and it does what it needs
to do, but the response xml is always a $fault? Did anyone have this
problem? I am using php 5.2.6 for the info.
and below is my method...
private function createThread($userID, $applianceTitle,
$applianceDetails_link){
// Define Client
try {
$client = new SoapClient($this->createThreadWSDL, array("trace" =>
1
));
} catch(SoapFault $fault) {
return "";
}
// Define Input array
$params = array(
'subject'=> $applianceTitle,
'body' => $applianceDetails_link,
'communityID' => $this->parentCommunityID,
'userID' => $userID
);
//Make the Call
try {
$result = $client->__soapCall('createThread',
array('parameters'=>$params), NULL, $this->header);
return $result;
} catch (SoapFault $fault){
return $fault;
}
}
Thanks
--- End Message ---
--- Begin Message ---
On Wed, 2008-07-16 at 17:44 -0700, VamVan wrote:
> Hello Guys,
>
> I have been getting a wierd soap exception lately
>
>
> [faultstring] => looks like we got no XML document
> [faultcode] => Client
> [faultcodens] => http://schemas.xmlsoap.org/soap/envelope/
>
> What does that mean? The call gets properly called and it does what it needs
> to do, but the response xml is always a $fault? Did anyone have this
> problem? I am using php 5.2.6 for the info.
This is usually a malformed XML document - I had the problem recently
when fetching an XML document that wasn't complete (no </xml>). Check
what you're *actually* getting with something like:
} catch(SoapFault $exception) {
$request_xml = $client->__getLastRequestHeaders() .
$client->__getLastRequest();
$response_xml = $client->__getLastResponseHeaders() .
$client->__getLastResponse();
print "Response:".$response_xml;
print "Request:".$request_xml;
print $exception;
}
--- End Message ---