php-general Digest 4 Aug 2008 01:06:51 -0000 Issue 5605

Topics (messages 277645 through 277653):

Re: Exposing PHP/errors on production vs. dev
        277645 by: tedd

Re: PHP page completly blank
        277646 by: Daniel Brown
        277647 by: Alain Roger

php.ini and pgsql extension issue
        277648 by: Alain Roger

Re: uploading big files with PHP
        277649 by: mike
        277650 by: brian
        277653 by: mike

Re: remembering where the user is on the page??
        277651 by: brian

Re: PHP Memory Management
        277652 by: brian

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 ---
At 1:04 AM -0400 8/3/08, Daniel Brown wrote:
On Sun, Aug 3, 2008 at 12:22 AM, Chacha C <[EMAIL PROTECTED]> wrote:
 > Somehow .. I feel this isn't PHP Related.

    Boy, nothing gets by you, eh?  Welcome to the list, new meat.

Hey, he said he "feels" that it wasn't PHP Related. That's not like "knowing" it wasn't.

Welcome, new dude.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Sun, Aug 3, 2008 at 3:54 AM, Alain Roger <[EMAIL PROTECTED]> wrote:
>
> when under command line i run php -v i get a lot of error messages, like
> those 2 as attached files.
> what can it be ? i've checked those files and they exist. :-(

    Attached files are stripped automatically by mailman before
redistributing messages to the list.

    Please copy and paste the errors into the body of the message instead.

-- 
</Daniel P. Brown>
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.

--- End Message ---
--- Begin Message ---
Ok i "found" where was the problem.
basically when i install php 5.2.6 with installer.msi, i must after copy
over those files, the content of the "php-5.2.6-Win32.zip" file, because
several files and links are not installed / done by the installer.msi :-(
just try to install it with default settings and you will see that in
php.ini there is not section for windows extensions like in previous version
so we can not dynamically add a module. Or for example, even if you select
some module a the installation time, the files are installed but when you
type php -v at command line, you get an error that the file libpq.dll is not
available (whereas it is)... plus some other librairies (dll) files.


On 8/3/08, Daniel Brown <[EMAIL PROTECTED]> wrote:
>
> On Sun, Aug 3, 2008 at 3:54 AM, Alain Roger <[EMAIL PROTECTED]> wrote:
> >
> > when under command line i run php -v i get a lot of error messages, like
> > those 2 as attached files.
> > what can it be ? i've checked those files and they exist. :-(
>
>
>     Attached files are stripped automatically by mailman before
> redistributing messages to the list.
>
>     Please copy and paste the errors into the body of the message instead.
>
>
> --
> </Daniel P. Brown>
> Better prices on dedicated servers:
> Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
> Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
> Dedicated servers, VPS, and hosting from $2.50/mo.
>



-- 
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

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

i found and solved an interesting issue under PHP 5.2.6.

when i use the standard installation file under windows XP
(php-5.2.6-win32-installer.msi), i get several error message in apache
error.log file, something like :
PHP Warning:  PHP Startup: Unable to load dynamic library
'D:\\webserver\\PHP\\ext\\php_mssql.dll' - The specified module could not be
found.\r\n in Unknown on line 0

and this for several extensions even if the files are correctly installed in
the right folder.
I took a previous version of PHP 5.2.3 extension (dll) and i compare the
size:
in PHP 5.2.6, php_pgsql.dll is 96 kb whereas it is 164 kb under PHP 5.2.3.

so i just replace the 96 kb file by the 164 kb and restart apache 2.2.8. now
it works perfectly.
i reproduced the same thing for all dynamic extensions which were generating
the same issue and all works.

it could be interesting that developers of PHP take an eye on it.

-- 
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

--- End Message ---
--- Begin Message ---
On 7/25/08, Angelo Zanetti <[EMAIL PROTECTED]> wrote:
> Hi all
>
> We are pitching to develop a website where the admin has to upload big video
> files but I'm not sure how this can be done as the file upload will most
> probably time out.
>
> How do current websites do it? Is there somehow a way to make use of FTP to
> transfer the files?
>
> Any links, help, advice will be appreciated.
>
> Thanks in advance

Use the PUT method
- requires webserver configuration to support it
- requires PHP to open the stream using php://input
- supports resuming (the client needs to give the script something
like ?offset=1234 and the PHP script needs to fseek() to that position
in the file)

Variety of options for uploading this way:
- anything that can leverage curl/libcurl
- browser plugins - lots of java ones, haven't found a flash one yet

Bonuses:
- Can run over ssl/https - since its just HTTP talking, so proxies are okay
- Can resume
- Doesn't require a two-step process for people to upload things (FTP,
SFTP to server, then go somewhere and associate the file, etc)

We'll be using this method we just wish there were nicer frontends,
most of the java ones are ugly as sin.

javauploader.com mentioned does not look like it supports PUT. however
I believe all of these do:

http://www.jfileupload.com/products/jfileupload/
http://www.radinks.com/upload/plus/resume.php
http://upload.thinfile.com/features.php

--- End Message ---
--- Begin Message ---
mike wrote:
On 7/25/08, Angelo Zanetti <[EMAIL PROTECTED]> wrote:
Hi all

We are pitching to develop a website where the admin has to upload big video
files but I'm not sure how this can be done as the file upload will most
probably time out.

How do current websites do it? Is there somehow a way to make use of FTP to
transfer the files?

Any links, help, advice will be appreciated.

Thanks in advance

Use the PUT method
- requires webserver configuration to support it
- requires PHP to open the stream using php://input
- supports resuming (the client needs to give the script something
like ?offset=1234 and the PHP script needs to fseek() to that position
in the file)

Variety of options for uploading this way:
- anything that can leverage curl/libcurl
- browser plugins - lots of java ones, haven't found a flash one yet

Bonuses:
- Can run over ssl/https - since its just HTTP talking, so proxies are okay
- Can resume
- Doesn't require a two-step process for people to upload things (FTP,
SFTP to server, then go somewhere and associate the file, etc)

We'll be using this method we just wish there were nicer frontends,
most of the java ones are ugly as sin.

javauploader.com mentioned does not look like it supports PUT. however
I believe all of these do:

http://www.jfileupload.com/products/jfileupload/
http://www.radinks.com/upload/plus/resume.php
http://upload.thinfile.com/features.php


Also, use set_time_limit(0);


--- End Message ---
--- Begin Message ---
On 8/3/08, brian <[EMAIL PROTECTED]> wrote:

> Also, use set_time_limit(0);

and configure the server and php to accept a decent size, and probably
configure the client to put only chunks at a time right?

otherwise php will hit it's memory limit for the script quite easily i
would assume. so there has to be something that allows it to stream
and keep only so much in the buffer at a time.

--- End Message ---
--- Begin Message ---
Benjamin Hawkes-Lewis wrote:
brian wrote:
A better way to do that is to give some block element--a header, a div, etc.--an ID. That works exactly the same as <a name="...">.

It should work the same. But it doesn't in older user agents or with older assistive technology:

http://stevenclark.com.au/2008/07/11/named-anchors-and-skip-navigation/

I *suspect* that the <a name=""> thing is deprecated, even.

Not in HTML:

http://www.w3.org/TR/REC-html40/struct/links.html#adef-name-A

It's deprecated in XHTML 1.0 (i.e. it's valid to use):

http://www.w3.org/TR/xhtml1/#h-4.10

It's removed in XHTML 1.1 (i.e. it's not valid to use):

http://www.w3.org/TR/xhtml11/changes.html#a_changes

Its removal from XHTML isn't particularly relevant to most web authors, as Trident (and hence both IE and older assistive technology that only supports IE) doesn't support XHTML except when served as text/html (i.e. tag soup), XHTML 1.0 has no advantages when served as tag soup, and XHTML 1.1 must not be served as text/html. ;)

--
Benjamin Hawkes-Lewis

Thanks for the info. I followed the first link to this other site that has a good run-down on some user-agent tests (note the ID i found for myself to provide easy navigation to the table ;-)

http://www.jimthatcher.com/skipnav.htm#skiptests

This table appears to show that there are few problems with using an ID on an existing element. Outside of IE6, that is. But then, we already knew that IE6 is broken.


--- End Message ---
--- Begin Message ---
Waynn Lue wrote:
I've been running the script below:

<?php
  $appIds = getLotsOfAppIds();
  foreach ($appIds as $appId) {
    echo "$appId\n";
    //echo memory_get_usage() . "\n";
    try {
      $getBundles = getBundles($appId);
      $numBundles = count($registeredBundles);
      echo $numBundles . "\n";
      continue;
    }
  }
?>

And I get PHP Fatal Error: Allowed Memory Size Exhausted after it runs for a
bit.  Looking at the memory usage, it's because $getBundles (an array) is
huge, and keeps growing.  What I'm confused by is why setting it to
something else in the next iteration of the foreach loop doesn't free the
previously allocated array, since there shouldn't be any more references to
it.  I've worked around it by explicitly calling unset($getBundles), but
just wanted to understand why it's working the way it does.


Aside from on the 1st iteration, each time getBundles() is called, it creates an array within its own scope. Until PHP assigns the returned array to $getBundles, there are two in memory. Maybe that's the problem.

I don't know how you can stand naming structures or variables the same as functions, btw. That would drive me nuts. Where is this $registeredBundles coming from? Perhaps you meant:

$registeredBundles = getBundles($appId);

b

--- End Message ---

Reply via email to