php-windows Digest 13 Aug 2013 19:28:25 -0000 Issue 4134
Topics (messages 31108 through 31114):
Re: Performance/handling limit on mysqli_real_escape_string() function?
31108 by: Jacob Kruger
31109 by: Jacob Kruger
31110 by: Jacob Kruger
31111 by: Jacob Kruger
31113 by: Jacob Kruger
31114 by: Jacob Kruger
Readfile() + mpg = http status 500, windows server 2012, php 5.5.1
31112 by: james maisner
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Thanks - looks pretty much exactly what I want to try achieve, so will try
modd'ing my code/script and see if works...<smile>
Also nice to maybe use the actual parameter binding for a change instead of
just building up sql statement strings using sprintf() etc. - know better
practice anyway.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 9:08 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
hi!
On Mon, Aug 12, 2013 at 11:24 PM, Jacob Kruger <ja...@blindza.co.za> wrote:
What with trying to store image data in mySQL database, I am saving the
results of fread() function carried out using the file handle returned
from fopen(), with the "rb" argument to tell it the file is for binary
reading.
Either way, for example, this specific image file is a 2.1Mb PNG file, and
mySQL server on my local, windows development machine seems to lock up
roundabout when I tell it to carry out the mysqli_real_escape_string()
function on the value of the variable that now contains the data read from
the physically uploaded file, and just wondering if this could be
something like a process overload, etc., and whether should just try
taking out the string real escaping for now, or whether that's likely to
cause problems, or should I try something like splitting the file's data
into more manageable size chunks, carry out the string escaping on those
chunks one at a time, with even a possible form of pause inbetween, and
then re-append them together before writing them to the database, or
should I maybe just implement at least a form of file size limit, which
might be an issue if the user will insist on certain image sizes,
resolutions, etc. etc.?
Thoughts/suggestions?
Not really windows specific, php-database could fit better for this
question but here is what you should do:
https://blogs.oracle.com/oswald/entry/php_s_mysqli_extension_storing
Cheers,
--
Pierre
@pierrejoye | http://www.libgd.org
--- End Message ---
--- Begin Message ---
Ok, even when trying to use the mysqli_statement->bind_params() and
mysqli_statement->send_long_data() to pass larger blob data chunks through,
I am still hitting a form of timeout - from the mysqli_statement->errorno,
and error string:
["errno"]=> int(2006)
["error"]=> "MySQL server has gone away"
Will have to try find out what error no. 2006 refers to - bit of an
irritation that it's a possibly too commonly used search term, in terms of
being a relatively recent year, etc...<smile>
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 9:28 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Thanks - looks pretty much exactly what I want to try achieve, so will try
modd'ing my code/script and see if works...<smile>
Also nice to maybe use the actual parameter binding for a change instead
of just building up sql statement strings using sprintf() etc. - know
better practice anyway.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 9:08 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
hi!
On Mon, Aug 12, 2013 at 11:24 PM, Jacob Kruger <ja...@blindza.co.za>
wrote:
What with trying to store image data in mySQL database, I am saving the
results of fread() function carried out using the file handle returned
from fopen(), with the "rb" argument to tell it the file is for binary
reading.
Either way, for example, this specific image file is a 2.1Mb PNG file,
and mySQL server on my local, windows development machine seems to lock
up roundabout when I tell it to carry out the mysqli_real_escape_string()
function on the value of the variable that now contains the data read
from the physically uploaded file, and just wondering if this could be
something like a process overload, etc., and whether should just try
taking out the string real escaping for now, or whether that's likely to
cause problems, or should I try something like splitting the file's data
into more manageable size chunks, carry out the string escaping on those
chunks one at a time, with even a possible form of pause inbetween, and
then re-append them together before writing them to the database, or
should I maybe just implement at least a form of file size limit, which
might be an issue if the user will insist on certain image sizes,
resolutions, etc. etc.?
Thoughts/suggestions?
Not really windows specific, php-database could fit better for this
question but here is what you should do:
https://blogs.oracle.com/oswald/entry/php_s_mysqli_extension_storing
Cheers,
--
Pierre
@pierrejoye | http://www.libgd.org
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
And, here's the current test code:
//start code
$f = fopen("./candles.png", "rb");
$fB = fread($f, filesize("./candles.png"));
fclose($f);
$b = NULL;
$stmnt = $mysqliObj->prepare("update tbl_mysqli_test set b_test = ? where id
= 1;");
$stmnt->bind_param("b", $b);
$stmnt->send_long_data(0, $fB);
$stmnt->execute();
var_dump($stmnt);
//end code
And, the results of the error it outputs, and the results of the var_dump
function are the following:
Warning: Error while sending STMT_EXECUTE packet. PID=3372 in
C:\xampp\htdocs\mysqli\bind.php on line 21
object(mysqli_stmt)#2 (9) { ["affected_rows"]=> int(-1) ["insert_id"]=>
int(0) ["num_rows"]=> int(0) ["param_count"]=> int(1) ["field_count"]=>
int(0) ["errno"]=> int(2006) ["error"]=> string(26) "MySQL server has gone
away" ["sqlstate"]=> string(5) "HY000" ["id"]=> int(1)
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 9:28 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Thanks - looks pretty much exactly what I want to try achieve, so will try
modd'ing my code/script and see if works...<smile>
Also nice to maybe use the actual parameter binding for a change instead
of just building up sql statement strings using sprintf() etc. - know
better practice anyway.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 9:08 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
hi!
On Mon, Aug 12, 2013 at 11:24 PM, Jacob Kruger <ja...@blindza.co.za>
wrote:
What with trying to store image data in mySQL database, I am saving the
results of fread() function carried out using the file handle returned
from fopen(), with the "rb" argument to tell it the file is for binary
reading.
Either way, for example, this specific image file is a 2.1Mb PNG file,
and mySQL server on my local, windows development machine seems to lock
up roundabout when I tell it to carry out the mysqli_real_escape_string()
function on the value of the variable that now contains the data read
from the physically uploaded file, and just wondering if this could be
something like a process overload, etc., and whether should just try
taking out the string real escaping for now, or whether that's likely to
cause problems, or should I try something like splitting the file's data
into more manageable size chunks, carry out the string escaping on those
chunks one at a time, with even a possible form of pause inbetween, and
then re-append them together before writing them to the database, or
should I maybe just implement at least a form of file size limit, which
might be an issue if the user will insist on certain image sizes,
resolutions, etc. etc.?
Thoughts/suggestions?
Not really windows specific, php-database could fit better for this
question but here is what you should do:
https://blogs.oracle.com/oswald/entry/php_s_mysqli_extension_storing
Cheers,
--
Pierre
@pierrejoye | http://www.libgd.org
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Also, BTW, if I leave out the blob/binary data field, and use all of that
test code, apart from the send_long_data() call, it works fine with integer
and varchar fields.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 5:45 PM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
And, here's the current test code:
//start code
$f = fopen("./candles.png", "rb");
$fB = fread($f, filesize("./candles.png"));
fclose($f);
$b = NULL;
$stmnt = $mysqliObj->prepare("update tbl_mysqli_test set b_test = ? where
id = 1;");
$stmnt->bind_param("b", $b);
$stmnt->send_long_data(0, $fB);
$stmnt->execute();
var_dump($stmnt);
//end code
And, the results of the error it outputs, and the results of the var_dump
function are the following:
Warning: Error while sending STMT_EXECUTE packet. PID=3372 in
C:\xampp\htdocs\mysqli\bind.php on line 21
object(mysqli_stmt)#2 (9) { ["affected_rows"]=> int(-1) ["insert_id"]=>
int(0) ["num_rows"]=> int(0) ["param_count"]=> int(1) ["field_count"]=>
int(0) ["errno"]=> int(2006) ["error"]=> string(26) "MySQL server has gone
away" ["sqlstate"]=> string(5) "HY000" ["id"]=> int(1)
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 9:28 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Thanks - looks pretty much exactly what I want to try achieve, so will
try modd'ing my code/script and see if works...<smile>
Also nice to maybe use the actual parameter binding for a change instead
of just building up sql statement strings using sprintf() etc. - know
better practice anyway.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 9:08 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
hi!
On Mon, Aug 12, 2013 at 11:24 PM, Jacob Kruger <ja...@blindza.co.za>
wrote:
What with trying to store image data in mySQL database, I am saving the
results of fread() function carried out using the file handle returned
from fopen(), with the "rb" argument to tell it the file is for binary
reading.
Either way, for example, this specific image file is a 2.1Mb PNG file,
and mySQL server on my local, windows development machine seems to lock
up roundabout when I tell it to carry out the
mysqli_real_escape_string() function on the value of the variable that
now contains the data read from the physically uploaded file, and just
wondering if this could be something like a process overload, etc., and
whether should just try taking out the string real escaping for now, or
whether that's likely to cause problems, or should I try something like
splitting the file's data into more manageable size chunks, carry out
the string escaping on those chunks one at a time, with even a possible
form of pause inbetween, and then re-append them together before writing
them to the database, or should I maybe just implement at least a form
of file size limit, which might be an issue if the user will insist on
certain image sizes, resolutions, etc. etc.?
Thoughts/suggestions?
Not really windows specific, php-database could fit better for this
question but here is what you should do:
https://blogs.oracle.com/oswald/entry/php_s_mysqli_extension_storing
Cheers,
--
Pierre
@pierrejoye | http://www.libgd.org
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Ok, and think now figured out cause of issue with binding etc. - local mySQL
server was set to max_packet_length = 1M
And, that's 1Mb, so set it to match production server value of 999M, and
then, the following code works - seems like you should assign value to
parameter variable after binding it to statement:
$stmnt = $mysqliObj->prepare("update tbl_mysqli_test set b_test = ? where id
= 1;");
$stmnt->bind_param("b", $b);
$b = NULL;
$stmnt->send_long_data(0, $fB);
$stmnt->execute();
Did then also use mysqli_statement to retireve value and output it to
browser, to test, and it seemed to work, since could open saved/outputted
file in paint thereafter, and double check it's dimensions, etc.:
$mysqliObj = new mysqli("localhost", "root", "", "mysql");
$stmnt = $mysqliObj->prepare("select b_test from tbl_mysqli_test;");
$stmnt->execute();
$stmnt->bind_result($bOut);
$stmnt->fetch();
header("Content-Type: image/png");
header("Content-Disposition: attachment; filename=\"test.png\"");
echo $bOut;
$stmnt->close();
$mysqliObj->close();
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 5:49 PM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Also, BTW, if I leave out the blob/binary data field, and use all of that
test code, apart from the send_long_data() call, it works fine with
integer and varchar fields.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 5:45 PM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
And, here's the current test code:
//start code
$f = fopen("./candles.png", "rb");
$fB = fread($f, filesize("./candles.png"));
fclose($f);
$b = NULL;
$stmnt = $mysqliObj->prepare("update tbl_mysqli_test set b_test = ? where
id = 1;");
$stmnt->bind_param("b", $b);
$stmnt->send_long_data(0, $fB);
$stmnt->execute();
var_dump($stmnt);
//end code
And, the results of the error it outputs, and the results of the var_dump
function are the following:
Warning: Error while sending STMT_EXECUTE packet. PID=3372 in
C:\xampp\htdocs\mysqli\bind.php on line 21
object(mysqli_stmt)#2 (9) { ["affected_rows"]=> int(-1) ["insert_id"]=>
int(0) ["num_rows"]=> int(0) ["param_count"]=> int(1) ["field_count"]=>
int(0) ["errno"]=> int(2006) ["error"]=> string(26) "MySQL server has
gone away" ["sqlstate"]=> string(5) "HY000" ["id"]=> int(1)
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 9:28 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Thanks - looks pretty much exactly what I want to try achieve, so will
try modd'ing my code/script and see if works...<smile>
Also nice to maybe use the actual parameter binding for a change instead
of just building up sql statement strings using sprintf() etc. - know
better practice anyway.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 9:08 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
hi!
On Mon, Aug 12, 2013 at 11:24 PM, Jacob Kruger <ja...@blindza.co.za>
wrote:
What with trying to store image data in mySQL database, I am saving the
results of fread() function carried out using the file handle returned
from fopen(), with the "rb" argument to tell it the file is for binary
reading.
Either way, for example, this specific image file is a 2.1Mb PNG file,
and mySQL server on my local, windows development machine seems to lock
up roundabout when I tell it to carry out the
mysqli_real_escape_string() function on the value of the variable that
now contains the data read from the physically uploaded file, and just
wondering if this could be something like a process overload, etc., and
whether should just try taking out the string real escaping for now, or
whether that's likely to cause problems, or should I try something like
splitting the file's data into more manageable size chunks, carry out
the string escaping on those chunks one at a time, with even a possible
form of pause inbetween, and then re-append them together before
writing them to the database, or should I maybe just implement at least
a form of file size limit, which might be an issue if the user will
insist on certain image sizes, resolutions, etc. etc.?
Thoughts/suggestions?
Not really windows specific, php-database could fit better for this
question but here is what you should do:
https://blogs.oracle.com/oswald/entry/php_s_mysqli_extension_storing
Cheers,
--
Pierre
@pierrejoye | http://www.libgd.org
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
And, again, however, for whatever reason, although it's reading full length
of image file into variable, for whatever reason, it's only saving like 64Kb
of data to server - no errors being generated, etc., so assume there's some
or other automatic limit can't find cause/mention of/for, etc.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 7:03 PM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Ok, and think now figured out cause of issue with binding etc. - local
mySQL server was set to max_packet_length = 1M
And, that's 1Mb, so set it to match production server value of 999M, and
then, the following code works - seems like you should assign value to
parameter variable after binding it to statement:
$stmnt = $mysqliObj->prepare("update tbl_mysqli_test set b_test = ? where
id = 1;");
$stmnt->bind_param("b", $b);
$b = NULL;
$stmnt->send_long_data(0, $fB);
$stmnt->execute();
Did then also use mysqli_statement to retireve value and output it to
browser, to test, and it seemed to work, since could open saved/outputted
file in paint thereafter, and double check it's dimensions, etc.:
$mysqliObj = new mysqli("localhost", "root", "", "mysql");
$stmnt = $mysqliObj->prepare("select b_test from tbl_mysqli_test;");
$stmnt->execute();
$stmnt->bind_result($bOut);
$stmnt->fetch();
header("Content-Type: image/png");
header("Content-Disposition: attachment; filename=\"test.png\"");
echo $bOut;
$stmnt->close();
$mysqliObj->close();
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 5:49 PM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Also, BTW, if I leave out the blob/binary data field, and use all of that
test code, apart from the send_long_data() call, it works fine with
integer and varchar fields.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 5:45 PM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
And, here's the current test code:
//start code
$f = fopen("./candles.png", "rb");
$fB = fread($f, filesize("./candles.png"));
fclose($f);
$b = NULL;
$stmnt = $mysqliObj->prepare("update tbl_mysqli_test set b_test = ?
where id = 1;");
$stmnt->bind_param("b", $b);
$stmnt->send_long_data(0, $fB);
$stmnt->execute();
var_dump($stmnt);
//end code
And, the results of the error it outputs, and the results of the
var_dump function are the following:
Warning: Error while sending STMT_EXECUTE packet. PID=3372 in
C:\xampp\htdocs\mysqli\bind.php on line 21
object(mysqli_stmt)#2 (9) { ["affected_rows"]=> int(-1) ["insert_id"]=>
int(0) ["num_rows"]=> int(0) ["param_count"]=> int(1) ["field_count"]=>
int(0) ["errno"]=> int(2006) ["error"]=> string(26) "MySQL server has
gone away" ["sqlstate"]=> string(5) "HY000" ["id"]=> int(1)
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Jacob Kruger" <ja...@blindza.co.za>
To: <php-wind...@lists.php.net>
Cc: "Pierre Joye" <pierre....@gmail.com>
Sent: Tuesday, August 13, 2013 9:28 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
Thanks - looks pretty much exactly what I want to try achieve, so will
try modd'ing my code/script and see if works...<smile>
Also nice to maybe use the actual parameter binding for a change
instead of just building up sql statement strings using sprintf()
etc. - know better practice anyway.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
----- Original Message -----
From: "Pierre Joye" <pierre....@gmail.com>
To: "Jacob Kruger" <ja...@blindza.co.za>
Cc: "php-windows" <php-wind...@lists.php.net>
Sent: Tuesday, August 13, 2013 9:08 AM
Subject: Re: [PHP-WIN] Performance/handling limit on
mysqli_real_escape_string() function?
hi!
On Mon, Aug 12, 2013 at 11:24 PM, Jacob Kruger <ja...@blindza.co.za>
wrote:
What with trying to store image data in mySQL database, I am saving
the results of fread() function carried out using the file handle
returned from fopen(), with the "rb" argument to tell it the file is
for binary reading.
Either way, for example, this specific image file is a 2.1Mb PNG file,
and mySQL server on my local, windows development machine seems to
lock up roundabout when I tell it to carry out the
mysqli_real_escape_string() function on the value of the variable that
now contains the data read from the physically uploaded file, and just
wondering if this could be something like a process overload, etc.,
and whether should just try taking out the string real escaping for
now, or whether that's likely to cause problems, or should I try
something like splitting the file's data into more manageable size
chunks, carry out the string escaping on those chunks one at a time,
with even a possible form of pause inbetween, and then re-append them
together before writing them to the database, or should I maybe just
implement at least a form of file size limit, which might be an issue
if the user will insist on certain image sizes, resolutions, etc.
etc.?
Thoughts/suggestions?
Not really windows specific, php-database could fit better for this
question but here is what you should do:
https://blogs.oracle.com/oswald/entry/php_s_mysqli_extension_storing
Cheers,
--
Pierre
@pierrejoye | http://www.libgd.org
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
hi oli,
i can confirm this if i use following command.
one download one 500
[download.cmd]
"C:\Program Files (x86)\GnuWin32\bin\wget.exe" --limit-rate=40000
http://127.0.0.1/index.php
did you find any solution?
regards
Hi List,
i installed a blank Windows Server 2012 Standard, added Role IIS & Feature CGI
extracted 5.5.1 VC11 x86 Non Thread Safe to c:\Program Files (x86)\php
installed vcredist_x86.exe
added Handler Mappings in IIS
Request path: *.php
Module: FastCgiModule
Executable: c:\Program Files (x86)\php\php-cgi.exe
Name: PHP via FastCgi
Added 2 files to C:\inetpub\wwwroot index.php & movie.mpg (6MB)
Content of index.php
<?php
$track = "movie.mpg";
if (file_exists($track)) {
header("Content-Type: audio/mpeg");
header('Content-Length: ' . filesize($track));
header('Content-Disposition: inline; filename="movie.mpg"');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
readfile($track);
exit;
} else {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
echo "no file";
}
?>
Now every time the index.php is requested i get an error 500 in
Webserver log. But file will be delivered sucessfully.
Is there a problem with mpg files and readfile();
No difference with 5.4.17, 5.3.27 & Windows Server 2008 R2.
I know its very basic, but expected result should be: HTTP-Status: 200 or?
phpinfo() will be delivered succesful.
Thx + regards
oli
--- End Message ---