php-windows Digest 5 Mar 2007 22:40:25 -0000 Issue 3157
Topics (messages 27549 through 27556):
Re: [PHP-DB] Re: [PHP-WIN] Fatal Error: Allocated memory size problem...
27549 by: Bastien Koert
Re: Fatal Error: Allocated memory size problem...
27550 by: Stut
27554 by: Hartleigh Burton
base64 encoded images and printing
27551 by: Bill Bolte
27555 by: Bill Bolte
27556 by: Kevin Smith
Re: php_http
27552 by: datsclark
Hire a full-time programmer for $800
27553 by: JC Mae Palmes
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 ---
check your php ini file for memory limits and filesize limits. Also check
the mysql (if that is where the problem is) config to make sure you have
enough resources allocated in memory
bastien
From: "bedul" <[EMAIL PROTECTED]>
To: "Hartleigh Burton" <[EMAIL PROTECTED]>
CC: <[email protected]>,<[email protected]>
Subject: [PHP-DB] Re: [PHP-WIN] Fatal Error: Allocated memory size
problem...
Date: Mon, 5 Mar 2007 12:57:37 +0700
same here not work for me
----- Original Message -----
From: "Hartleigh Burton" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, March 05, 2007 9:13 AM
Subject: [PHP-WIN] Fatal Error: Allocated memory size problem...
> Hi All,
>
> I am having some problems while uploading a file to a MySQL database
> relating to file sizes. I have created a script which successfully
> uploads most files to the database, however anything roughly over 1MB
> in size seems to return a PHP error. I am not trying to upload
> anything larger than 15MB. The error I am getting is as follows:
that's weird.. i upload a pic 1mb more.. it error.. database say.. mysql is
DEAD!! or something like that
to avoid this.. i upload the file to a folder not to database.. is not what
i want but it worked..
why not try upload to localhost instead?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________
Win a trip for four to a concert anywhere in the world!
http://www.mobilelivetour.ca/
--- End Message ---
--- Begin Message ---
Hartleigh Burton wrote:
I am having some problems while uploading a file to a MySQL database
relating to file sizes. I have created a script which successfully
uploads most files to the database, however anything roughly over 1MB in
size seems to return a PHP error. I am not trying to upload anything
larger than 15MB. The error I am getting is as follows:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 8439363 bytes) in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\_dev\mraintranet\settings\common.php on line
78 (memory_limit = 64M)
I have done a fair bit of reading on the google-net and found that this
is a very common problem. So I started changing the configuration of the
php.ini file to try and resolve it the same way others have. Currently I
have the memory_limit set to 64M, which is significantly more than the
8M or 12M that is set by default in the php.ini file. When I bump it up
to say 128M or 256M I get the same error with different
exhausted/allocated sizes. I have tried putting this up to 512M. Example:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 7311167 bytes) in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\_dev\mraintranet\settings\common.php on line
77 (memory_limit = 128M)
That is uploading the exact same file (which is approximately 3.5MB). I
don't understand why the 'tried to allocate' size is different. I also
don't understand why the error is occurring on different lines. I have
changed post_max_size to 20M. I upgraded to PHP 5.2.1 after first
noticing the problem and reading that this version of PHP had a lot of
memory bug fixes in it. I am using the following software:
Windows 2000 (SP4)
PHP 5.2.1
Apache 2.2.4
MySQL 5.0.27
If anyone has any ideas on how to solve this then the help is greatly
appreciated.
Show us your script. Chances are that you have a bug that is causing
lots of memory to be allocated.
Incidentally, the "tried to allocate n bytes" message indicates how much
it was trying to allocate when it ran out. If you change the
memory_limit then I'm not surprised that this value changes.
-Stut
--- End Message ---
--- Begin Message ---
I am using a longblob to store the file data, however this seems to
be a php error rather than a mysql error.
On 05/03/2007, at 5:22 PM, Gustav Wiberg wrote:
Hi there!
What fieldtype do you try to store the file in?
Best regards
/Gustav Wiberg
-----Original Message-----
From: Hartleigh Burton [mailto:[EMAIL PROTECTED]
Sent: Monday, March 05, 2007 3:14 AM
To: [email protected]
Subject: [PHP-WIN] Fatal Error: Allocated memory size problem...
Hi All,
I am having some problems while uploading a file to a MySQL database
relating to file sizes. I have created a script which successfully
uploads most files to the database, however anything roughly over 1MB
in size seems to return a PHP error. I am not trying to upload
anything larger than 15MB. The error I am getting is as follows:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried
to allocate 8439363 bytes) in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\_dev\mraintranet\settings\common.php on
line 78 (memory_limit = 64M)
I have done a fair bit of reading on the google-net and found that
this is a very common problem. So I started changing the
configuration of the php.ini file to try and resolve it the same way
others have. Currently I have the memory_limit set to 64M, which is
significantly more than the 8M or 12M that is set by default in the
php.ini file. When I bump it up to say 128M or 256M I get the same
error with different exhausted/allocated sizes. I have tried putting
this up to 512M. Example:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
to allocate 7311167 bytes) in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\_dev\mraintranet\settings\common.php on
line 77 (memory_limit = 128M)
That is uploading the exact same file (which is approximately 3.5MB).
I don't understand why the 'tried to allocate' size is different. I
also don't understand why the error is occurring on different lines.
I have changed post_max_size to 20M. I upgraded to PHP 5.2.1 after
first noticing the problem and reading that this version of PHP had a
lot of memory bug fixes in it. I am using the following software:
Windows 2000 (SP4)
PHP 5.2.1
Apache 2.2.4
MySQL 5.0.27
If anyone has any ideas on how to solve this then the help is greatly
appreciated.
Regards,
Hartleigh Burton.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Regards,
Hartleigh Burton
Resident Geek
MRA Entertainment Pty Ltd
5 Dividend St | Mansfield | QLD 4122 | Australia
Phone: (07) 3457 5041
Fax: (07) 3349 8806
Mobile: 0421 646 978
www.mraentertainment.com
--- End Message ---
--- Begin Message ---
in a nutshell, i'm displaying a base64 encoded image (that is being
parsed from a remote xml file) in the browser doing a simple header
output:
<?php
header('Content-Length: '.$length);
header('Content-Type: image/gif');
echo base64_decode($image);
?>
it will print fine with Firefox but nothing in IE (just a box with an x
in the corner). didn't realize that IE wouldn't print these. am i stuck
with having to save the image to the server for IE to be able to print
it? i didn't really want to have to save these images out as they are
temporary.
Bill
--- End Message ---
--- Begin Message ---
Update, I have it working in IE7 but not IE6. I can view it in both
IE6-7, but it only prints in IE7. here's what I'm doing...
<?php
//snippet
$outputfile = $shipid.'.gif';
$ifp = fopen('tmp/'.$outputfile, "wb");
fwrite($ifp, base64_decode($image));
fclose($ifp);
echo '<img src="fetch.php?id='.$outputfile.'" />';
?>
fetch.php is thus, read file and delete:
<?php
//snippet
header('Content-Type: image/gif');
readfile('image/'.$_GET['id']);
unlink('image/'.$_GET['id']);
?>
anyone have any other ideas to try?
__________________
-----Original Message-----
From: Bill Bolte [mailto:[EMAIL PROTECTED]
Sent: Monday, March 05, 2007 9:29 AM
To: [email protected]
Subject: [PHP-WIN] base64 encoded images and printing
in a nutshell, i'm displaying a base64 encoded image (that is being
parsed from a remote xml file) in the browser doing a simple header
output:
<?php
header('Content-Length: '.$length);
header('Content-Type: image/gif');
echo base64_decode($image);
?>
it will print fine with Firefox but nothing in IE (just a box with an x
in the corner). didn't realize that IE wouldn't print these. am i stuck
with having to save the image to the server for IE to be able to print
it? i didn't really want to have to save these images out as they are
temporary.
Bill
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Bill,
This is what I've used for the last 4 years or so and works in every
browser that I've come across, obviously the data is being called from a
database instead.
<?php
//snippet
$query = "select bin_data, file_type from content_images where
image_id=".$_GET['id'];
$result = mysql_query($query);
$line = mysql_fetch_array($result) ;
$data = $line[0];
$file_type = $line[1];
header("Content-Type: $file_type");
header('Content-Transfer-Encoding: binary');
header('Content-Length: '. strlen($data));
print($data);
?>
<img src="foobar.php?id=12345" />
The important thing here is the headers "Content-Transfer-Encoding" and
"Content-Length", which is why IE6 does not work, as without these the
browser gets all upset that it doesn't know the true size of the image
not the proper encoding of the file, this obviously being an image.
It's good practice to put these headers in anyway.
Hope this helps.
Regards,
Kevin Smith
Bill Bolte wrote:
Update, I have it working in IE7 but not IE6. I can view it in both
IE6-7, but it only prints in IE7. here's what I'm doing...
<?php
//snippet
$outputfile = $shipid.'.gif';
$ifp = fopen('tmp/'.$outputfile, "wb");
fwrite($ifp, base64_decode($image));
fclose($ifp);
echo '<img src="fetch.php?id='.$outputfile.'" />';
?>
fetch.php is thus, read file and delete:
<?php
//snippet
header('Content-Type: image/gif');
readfile('image/'.$_GET['id']);
unlink('image/'.$_GET['id']);
?>
anyone have any other ideas to try?
__________________
-----Original Message-----
From: Bill Bolte [mailto:[EMAIL PROTECTED]
Sent: Monday, March 05, 2007 9:29 AM
To: [email protected]
Subject: [PHP-WIN] base64 encoded images and printing
in a nutshell, i'm displaying a base64 encoded image (that is being
parsed from a remote xml file) in the browser doing a simple header
output:
<?php
header('Content-Length: '.$length);
header('Content-Type: image/gif');
echo base64_decode($image);
?>
it will print fine with Firefox but nothing in IE (just a box with an x
in the corner). didn't realize that IE wouldn't print these. am i stuck
with having to save the image to the server for IE to be able to print
it? i didn't really want to have to save these images out as they are
temporary.
Bill
--
PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
BZ2 shouldn't be needed, but I enabled it anyway. http still doesn't load.
I've gone with CURL at this point, but i'm still curious why I can't get
HTTP to load.
Odd.
"Edin Kadribasic" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> And bz2? That needs to be enabled and loaded before httpd.
>
> Edin
>
> datsclark wrote:
>> Yeah, they are installed. I was under the impression they are all on by
>> default in 5.2. phpinfo() shows them all as modules
>>
>> "Niel Archer" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>> Hi
>>> have you also made sure the required extensions (hash, iconv, SPL) are
>>> also installed
>>>
>>>
>>> Niel
>>
--- End Message ---
--- Begin Message ---
GMCI Online Experts
Do you want a company that gives their clients value for their money and gives
them the assurance of a dedicated professional who will not only do the job but
will do the job perfectly? Lease a professional from the GMCI Online Experts
Team, it may prove to be the best decision you have ever made for your online
ventures.
The Online Experts Advantage
GMCI Online Experts is an offshore IT Staff Leasing Company based in Passaic,
New Jersey and the operations is centralized in Iloilo City, Philippines. We
specialize in hiring out programmers, designers, writers and webmaster supports
to clients worldwide.
Web/Graphic Designers
So, why choose our designers? Simply because our designers are professionals,
customer-service oriented, and innovative. Our designers are passionate about
their craft and would see to it that every creation is a work of art and would
suit the tastes of your chosen market.
Programmers
Our programmers have the energy, drive, enthusiasm, and passion for technology
that produces high-quality work. They adapt to changes quickly, love new
challenges, and solve problems creatively.
Webmaster Supports
Can't handle your online tasks alone? Need someone to do the tiring data entry
work for your website? We have the right solution for you. Our webmaster
support agents are very competent individuals who are willing to lighten your
load. We hire only the best, our agents are experts in their fields and will
give you the service you are looking for and more.
Writers
Our writers have the skills and experience to write to your target audience.
They are well-trained and seasoned writers in the SEO arena. If you are looking
for the best, look no more. Our writers are highly competent individuals ready
to take on whatever writing challenge you may post.
Avail of our reduced rates NOW!!!
Check out our competitive rates and act now:
Webmaster Support = $600/mo
Writer = $600/mo
Graphic Designer = $700/mo
Programmer = $800/mo
The monthly fee includes the following:
- A total of 160 worked hours (8hrs a day, 5days a week)
- Project Manager
- Office facilities and equipments
- Daily, weekly, bi-monthly or monthly updates and reports
Thank you for taking the time to check us out. We are looking forward to
provide you quality, affordable service. For more information, you can contact
us through 1-800-254-9162 ext 022.
Sincerely,
JC Mae Palmes
Account Executive-
GMCI Online Experts
1-800-254-9162 ext 022
MSN: [EMAIL PROTECTED]
Yahoo! Messeger: jcmaepalmes
Skype: onlinexperts
G-Talk: jpalmes
ICQ: 404-200-858
http://www.onlineexperts.gmciusa.com
GMCI Online Experts | 161 Park Ave. | Passaic | NJ | 07055
--- End Message ---