php-windows Digest 6 Mar 2007 13:22:45 -0000 Issue 3158

Topics (messages 27557 through 27560):

Re: base64 encoded images and printing
        27557 by: bedul

Re: Fatal Error: Allocated memory size problem...
        27558 by: Hartleigh Burton
        27559 by: Stut

.dat-files to outlook?
        27560 by: Gustav Wiberg

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 ---
umm.. sry this kind oot but might related
do you ever upload pic to imageshack? one of their fitur was  zip upload.
where you send a zip (contain n pic inside) where same as u upload many
pic.. i wonder what the script.. anyone have it?

----- Original Message -----
From: "Kevin Smith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Tuesday, March 06, 2007 5:40 AM
Subject: Re: [PHP-WIN] base64 encoded images and printing

--- End Message ---
--- Begin Message ---
Hi Stut,

You were in the right area thats for sure. I had a look through where the script was ending a bit closer... there is a function i use to make the sql query safe for inserts if magic quotes is not on thats something like this...

function WalkAddSlashes(&$item, $key) {
        if(!is_array($item)) {
                $item = addslashes($item);
                $item = str_replace("\"","&quot;",$item);
        }
}

The strange thing is that this function was not being called at all from this particular script, however the include file was being loaded. So I made sure that there were minimalist includes for this particular script which cut out any unnecessary junk. This solved the php memory problem which then brought me to a MySQL error where the max_allowed_packet size was too small which was a simple fix.

Thanks for the help everyone, greatly appreciate it.

On 06/03/2007, at 12:41 AM, Stut wrote:

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

--
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 ---
Hartleigh Burton wrote:
You were in the right area thats for sure. I had a look through where the script was ending a bit closer... there is a function i use to make the sql query safe for inserts if magic quotes is not on thats something like this...

function WalkAddSlashes(&$item, $key) {
if(!is_array($item)) {
$item = addslashes($item);
$item = str_replace("\"","&quot;",$item);
}
}

I'm happy you solved your problem, but I think it's worth pointing out that your function is flawed if the intention is to make the data safe for inclusion in a MySQL query. Addslashes() doesn't do anywhere near enough, you should be using mysql_real_escape_string() instead.

-Stut

--- End Message ---
--- Begin Message ---
Hi there!
 
Anyone who knows if there are any software available to convert from old 
.dat-files (from Lotus Notes) ?
Freeware/ Shareware/ commercial whatever...

I've googled a lot, but I'm not able to find a solution to achieve this. I can 
open the .dat-file in UltraEdit, BUT I'll to make a software
That converts those textfiles into csv so Outlook can handle it. (each contact 
is stored on about 20 rows) (Outlook 2003)

I know that this is not a PHP-question, but I'll take my chance...

Best regards
/Gustav Wiberg

--- End Message ---

Reply via email to