php-general Digest 31 Jan 2010 03:06:50 -0000 Issue 6567
Topics (messages 301689 through 301701):
Re: File Upload
301689 by: Eric Lee
301691 by: Ali Reza Sajedi
301692 by: Ashley Sheridan
Re: Pointers For Newbies, Reminders For Oldies
301690 by: Ashley Sheridan
Re: how do I use php://memory?
301693 by: Shawn McKenzie
301694 by: Daniel Brown
Re: Creating an Entire .html page with PHP
301695 by: Nisse Engström
301696 by: Ashley Sheridan
301697 by: Robert Cummings
301698 by: Ashley Sheridan
301699 by: Robert Cummings
Re: Good source for sample data?
301700 by: tedd
eAccelerator Loader can't load code. Incorrect Zend Engine
301701 by: Alberto García Gómez
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 ---
On Sat, Jan 30, 2010 at 7:27 PM, Ali Reza Sajedi <[email protected]>wrote:
> Hello,
>
> When uploading a file the variable $_FILES['userfile']['tmp_name'] is not
> set and when debugging I get the following error although /tmp folder exists
> and the permissions are set to 777:
>
> $_FILES['userfile']['error'] = 6
>
> which says
>
> UPLOAD_ERR_NO_TMP_DIR
> Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP
> 5.0.3.
>
> Has anyone encountered such a problem or has a clue as to what the cause
> could be?
>
>
It might be the upload_tmp_dir no pointing to the right dir !
What is the current of it ?
Regards,
Eric,
Thank you.
>
> Kind regards
>
> Ali
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Thank you for your replys.
In php.ini upload_tmp_dir is not set, so that the system should use its
default tmp folder.
It used to work properly. But, after a system update from centos5.3 to
centos5.4 this malfunction is now observed.
Any idea?
Kind regards
Ali
----- Original Message -----
From: Eric Lee
To: Ali Reza Sajedi
Cc: phpList list
Sent: Saturday, January 30, 2010 1:21 PM
Subject: Re: [PHP] File Upload
On Sat, Jan 30, 2010 at 7:27 PM, Ali Reza Sajedi <[email protected]>
wrote:
Hello,
When uploading a file the variable $_FILES['userfile']['tmp_name'] is not
set and when debugging I get the following error although /tmp folder exists
and the permissions are set to 777:
$_FILES['userfile']['error'] = 6
which says
UPLOAD_ERR_NO_TMP_DIR
Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP
5.0.3.
Has anyone encountered such a problem or has a clue as to what the cause
could be?
It might be the upload_tmp_dir no pointing to the right dir !
What is the current of it ?
Regards,
Eric,
Thank you.
Kind regards
Ali
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Sat, 2010-01-30 at 14:40 +0100, Ali Reza Sajedi wrote:
> Thank you for your replys.
>
> In php.ini upload_tmp_dir is not set, so that the system should use its
> default tmp folder.
>
> It used to work properly. But, after a system update from centos5.3 to
> centos5.4 this malfunction is now observed.
>
> Any idea?
>
> Kind regards
>
> Ali
>
>
> ----- Original Message -----
> From: Eric Lee
> To: Ali Reza Sajedi
> Cc: phpList list
> Sent: Saturday, January 30, 2010 1:21 PM
> Subject: Re: [PHP] File Upload
>
>
>
>
>
> On Sat, Jan 30, 2010 at 7:27 PM, Ali Reza Sajedi <[email protected]>
> wrote:
>
> Hello,
>
> When uploading a file the variable $_FILES['userfile']['tmp_name'] is not
> set and when debugging I get the following error although /tmp folder exists
> and the permissions are set to 777:
>
> $_FILES['userfile']['error'] = 6
>
> which says
>
> UPLOAD_ERR_NO_TMP_DIR
> Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP
> 5.0.3.
>
> Has anyone encountered such a problem or has a clue as to what the cause
> could be?
>
>
>
> It might be the upload_tmp_dir no pointing to the right dir !
> What is the current of it ?
>
>
>
> Regards,
> Eric,
>
>
>
>
> Thank you.
>
> Kind regards
>
> Ali
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
The upgrade just changed the setting. If you set this in your php.ini,
it should work again.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Sat, 2010-01-30 at 13:02 +1100, [email protected] wrote:
> On Thu, 28 Jan 2010 10:02:56 -0500, [email protected] (Robert Cummings)
> wrote:
>
>
> >I don't know what you guys are doing wrong but the following should be
> >the correct behaviour:
> >
> ><?php
> >
> >function get_memory( $init=false )
> >{
> > static $base = null;
> > if( $base === null || $init )
> > {
> > $base = memory_get_usage();
> > }
> >
> > return memory_get_usage() - $base;
> >}
> >
> >function simple_access( $data )
> >{
> > $foo = $data[100];
> > echo 'Memory: '.get_memory().' (simple access)'."\n";
> >}
> >
> >function foreach_value_access( $data )
> >{
> > foreach( $data as $value )
> > {
> > $foo = $value;
> > break;
> > }
> > echo 'Memory: '.get_memory().' (foreach value access)'."\n";
> >}
> >
> >function foreach_key_access( $data )
> >{
> > foreach( $data as $key => $value )
> > {
> > $foo = $key;
> > $foo = $value;
> > break;
> > }
> > echo 'Memory: '.get_memory().' (foreach key/value access)'."\n";
> >}
> >
> >function modify_single_access( $data )
> >{
> > $data[100] = str_repeat( '@', 10000 );
> > echo 'Memory: '.get_memory().' (modify single access)'."\n";
> >}
> >
> >function modify_all_access( $data )
> >{
> > for( $i = 0; $i < 1000; $i++ )
> > {
> > $data[$i] = str_repeat( '@', 10000 );
> > }
> >
> > echo 'Memory: '.get_memory().' (modify all access)'."\n";
> >}
> >
> >
> >get_memory( true );
> >
> >$data = array();
> >for( $i = 0; $i < 1000; $i++ )
> >{
> > $data[$i] = str_repeat( '#', 10000 );
> >}
> >
> >echo 'Memory: '.get_memory().' (data initialized)'."\n";
> >
> >simple_access( $data );
> >foreach_value_access( $data );
> >foreach_key_access( $data );
> >modify_single_access( $data );
> >modify_all_access( $data );
> >
> >?>
> >
> >I get the following output (PHP 5.2.11 from command-line):
> >
> > Memory: 10160768 (data initialized)
> > Memory: 10161008 (simple access)
> > Memory: 10161104 (foreach value access)
> > Memory: 10161240 (foreach key/value access)
> > Memory: 10267312 (modify single access)
> > Memory: 20321576 (modify all access)
> >
> >I don't double up on memory consumption until I force the write onto
> >every element... this is expected because internally every array element
> >is individually subject to the Copy-On-Write (COW) principle since each
> >element is internally stored as a zval just like the array itself.
>
> Thanks for this. I was just revising a bit of code to insert some extra
> entries into an
> array. Previously I had opened a new array, copied the data up to the
> insertion point into
> it, put in the new entry, then copied the tail, then renamed the new array.
> After reading
> this, I realise the correct procedure was to copy the existing data into a
> temporary
> array, insert the new entry in the existing array, and then copy the tail
> from the copy
> back into the working data.
>
> This way only the data in the tail actually has to be copied, rather than the
> whole array.
>
Erm, what about array_splice()? You can use that to insert items into an
array at any point you want.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Daniel P. Brown wrote:
> (Typing from the DROID, so forgive the top-posting.)
>
> Shawn, would you take a few moments to submit this as a bug at
> http://bugs.php.net/? I know you well enough that, if you say the docs suck,
> they probably do.
>
> On Jan 29, 2010 10:47 PM, "Shawn McKenzie" <[email protected]> wrote:
>
> Eric Lee wrote:
>> On Sat, Jan 30, 2010 at 9:00 AM, Shawn McKenzie <[email protected]
>> wrote:
>>
>>> ...
> So maybe it only works with an open file/stream resource? Hard to tell
> with no docs.
>
>
> --
>
> Thanks!
> -Shawn
> http://www.spidean.com
>
Done. Thanks Dan. http://bugs.php.net/bug.php?id=50886
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
On Sat, Jan 30, 2010 at 12:18, Shawn McKenzie <[email protected]> wrote:
>
> Done. Thanks Dan. http://bugs.php.net/bug.php?id=50886
Thank you, sir. I thanked you on Facebook when I saw the report
come in, but wanted to thank you properly here as well.
--
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers? Ask me how we can fit your budget!
--- End Message ---
--- Begin Message ---
On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote:
> On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote:
>
>> you can use Apache mod rewrite to create html pages having all programing
>> saved in .php pages. I have never tried generating .html pages with this but
>> have successfully generated .htm pages..
>
> You still have to create .php pages, mod_rewrite just masks what the
> user is requesting through their browser. You can set Apache to
> parse .html pages as PHP, but I wouldn't recommend it, as any html pages
> that don't contain PHP code still have to be parsed as if they did,
> which is slower.
.htaccess:
DirectoryIndex index.php
/Nisse
--- End Message ---
--- Begin Message ---
On Sat, 2010-01-30 at 19:20 +0100, Nisse Engström wrote:
> On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote:
>
> > On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote:
> >
> >> you can use Apache mod rewrite to create html pages having all programing
> >> saved in .php pages. I have never tried generating .html pages with this
> >> but
> >> have successfully generated .htm pages..
> >
> > You still have to create .php pages, mod_rewrite just masks what the
> > user is requesting through their browser. You can set Apache to
> > parse .html pages as PHP, but I wouldn't recommend it, as any html pages
> > that don't contain PHP code still have to be parsed as if they did,
> > which is slower.
>
> .htaccess:
> DirectoryIndex index.php
>
>
> /Nisse
>
That would only set the index for a given directory, it doesn't force
Apache to run that script when something else is called.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
On Sat, 2010-01-30 at 19:20 +0100, Nisse Engström wrote:
On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote:
On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote:
you can use Apache mod rewrite to create html pages having all programing
saved in .php pages. I have never tried generating .html pages with this but
have successfully generated .htm pages..
You still have to create .php pages, mod_rewrite just masks what the
user is requesting through their browser. You can set Apache to
parse .html pages as PHP, but I wouldn't recommend it, as any html pages
that don't contain PHP code still have to be parsed as if they did,
which is slower.
.htaccess:
DirectoryIndex index.php
/Nisse
That would only set the index for a given directory, it doesn't force
Apache to run that script when something else is called.
I answered this issue yesterday with the following:
AddType application/x-httpd-php .php .html .htm
I think tedd also adds .css :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
On Sat, 2010-01-30 at 13:40 -0500, Robert Cummings wrote:
> Ashley Sheridan wrote:
> > On Sat, 2010-01-30 at 19:20 +0100, Nisse Engström wrote:
> >
> >> On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote:
> >>
> >>> On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote:
> >>>
> >>>> you can use Apache mod rewrite to create html pages having all programing
> >>>> saved in .php pages. I have never tried generating .html pages with this
> >>>> but
> >>>> have successfully generated .htm pages..
> >>> You still have to create .php pages, mod_rewrite just masks what the
> >>> user is requesting through their browser. You can set Apache to
> >>> parse .html pages as PHP, but I wouldn't recommend it, as any html pages
> >>> that don't contain PHP code still have to be parsed as if they did,
> >>> which is slower.
> >> .htaccess:
> >> DirectoryIndex index.php
> >>
> >>
> >> /Nisse
> >>
> >
> > That would only set the index for a given directory, it doesn't force
> > Apache to run that script when something else is called.
>
> I answered this issue yesterday with the following:
>
> AddType application/x-httpd-php .php .html .htm
>
> I think tedd also adds .css :)
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
I thought that doing that introduced slowdowns where Apache was parsing
html files that didn't contain PHP code though?
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
On Sat, 2010-01-30 at 13:40 -0500, Robert Cummings wrote:
Ashley Sheridan wrote:
> On Sat, 2010-01-30 at 19:20 +0100, Nisse Engström wrote:
>
>> On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote:
>>
>>> On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote:
>>>
>>>> you can use Apache mod rewrite to create html pages having all programing
>>>> saved in .php pages. I have never tried generating .html pages with this
but
>>>> have successfully generated .htm pages..
>>> You still have to create .php pages, mod_rewrite just masks what the
>>> user is requesting through their browser. You can set Apache to
>>> parse .html pages as PHP, but I wouldn't recommend it, as any html pages
>>> that don't contain PHP code still have to be parsed as if they did,
>>> which is slower.
>> .htaccess:
>> DirectoryIndex index.php
>>
>>
>> /Nisse
>>
>
> That would only set the index for a given directory, it doesn't force
> Apache to run that script when something else is called.
I answered this issue yesterday with the following:
AddType application/x-httpd-php .php .html .htm
I think tedd also adds .css :)
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
I thought that doing that introduced slowdowns where Apache was parsing
html files that didn't contain PHP code though?
It does... if your files don't have PHP. I imagine (but haven't checked)
that you can set this on a virtual host basis. So then it becomes a
question of utility versus wasted cycles. How many PHP sites actually
bother to create .html files when there's no PHP code?
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP
--- End Message ---
--- Begin Message ---
At 3:08 PM -0800 1/29/10, Brian Dunning wrote:
Thanks for the suggestions but I couldn't find any that suited my
needs, so I made my own. Feel free to download if you can use them,
I made files with up to a million unique records.
Name, Company, Address, Phone, Email, etc., all are fake but are
real addresses with correct area codes, zips, exchange, so will work
for mapping, phone or address validation, whatever your needs are.
Hope someone find it useful.
http://www.briandunning.com/sample-data/
Brian:
Thanks -- that was very nice of you.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
After many tries I have this error still persisting in my server. It's a script
that was coded using phpcoder and just request eAccelerator (or e Loader) to
work. I, of course, install both (eAcc better) and then this error cames out.
What I must do??? How can I know what Zend Engine is requesting???
Saludos Fraternales
_____________________________
Atte.
Alberto García Gómez M:.M:.
Administrador de Redes/Webmaster
IPI "Carlos Marx", Matanzas. Cuba.
0145-2887(30-33) ext 124
__________ Información de ESET NOD32 Antivirus, versión de la base de firmas de
virus 4821 (20100130) __________
ESET NOD32 Antivirus ha comprobado este mensaje.
http://www.eset.com
--- End Message ---