[PHP] Weird numbers around HTTP response body

2004-09-13 Thread tmp1000
I noticed some numbers mixed with the response generated by my PHP code,
and I can't figure out what's causing it.  I've dumbed my PHP script
down to just this (what could be simpler?):



And I monitor the HTTP response coming from the server (apache), it
looks like this:

HTTP/1.1 200 OK
Date: Mon, 13 Sep 2004 20:03:21 GMT
Server: Apache/2.0.44 (Unix) PHP/4.3.1
Accept-Ranges: bytes
X-Powered-By: PHP/4.3.1
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1

7
testing
0


Note the "7" and the "0".  After some experimenting I believe the first
number is the length of the body, then there's the body, and finally a 0
at the end.  What gives?  How to I get rid of these numbers?

I'm running on linux.  The software versions are in the HTTP headers but
in case you missed them, apache 2.0.44 and PHP 4.3.1.

And help is appreciated.  Thanks.

-Dave
-- 
  
  [EMAIL PROTECTED]

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



[PHP] imagecreatefromjpeg fails on large files

2004-07-16 Thread tmp1000
I'm running into a problem where imagecreatefromjpeg fails and gives me
a warning like this:

Warning: imagecreatefromjpeg(): 'albums/userpics/10001/dave_sharath.jpg'
is not a valid JPEG file in
/homepages/32/d91926016/htdocs/photos/include/picmgmt.inc.php on line
202

The file in question is a valid jpeg, I've loaded it without problems in
a number of viewers.

I've checked phpinfo for GD support and its there, version 2.0 or
higher.  PHP version is 4.3.6.  To see phpinfo visit
http://yogadex.org/test.php

The code in question works on images whose file size is below some
threshold but I'm not certain what the threshold is.  That is, it works
on small files, fails on all large files.  The file in my example above
is 815384 bytes.

I'm using Coppermine 1.3.0.  So I didn't write the code myself, but
Coppermine is open source so I'm able to see what's going on.  And like
I said everything works fine when the images are smaller, so I'm
confident the issue is somehow related to image file size. 

Thanks in advance for any help.

-Dave
-- 
  
  [EMAIL PROTECTED]

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



Re: [PHP] imagecreatefromjpeg fails on large files

2004-07-19 Thread tmp1000
[Sorry if there's multiple posts...]
Raditha,

Thanks for the good suggestion.  It turns out that the call to
imagecreatefromjpeg succeeds when run from the command line and fails
when invoked via the web server.  I guess it is a memory limit issue
of some sort.  I tried upping the memory_limit via ini_set and while
my setting seems to take effect according to phpinfo(), the
imagecreate call still fails.

So seeing that it runs from the command line, I tried to have php code
from the web server call a php script via exec().  This resulted in
some truly strange behavior.  It seemed that instead of running the
script I asked exec() to run, it ran the same php page that was being
served up by the server.  It's like exec was not actually launching
any new process, and I had the same trouble with system() and
back-tics.

I'm pretty much ready to give up on this one.  Thanks again for your
help.

-Dave



[EMAIL PROTECTED] (Raditha Dissanayake) on Sat, 17 Jul 2004 08:55:26 +0600:

> Hav you had luck running the script from the command line? if that
> works for you it could be that you are hitting the memory limits for
> your php scripts. A JPEG when loaded in memory could take up  more
> memory than the size of the file.

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