OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
php-general Digest 8 Jun 2007 00:38:11 -0000 Issue 4835

php-general-digest-helplists.php.net
Date: Thu Jun 07 2007 - 19:38:11 CDT


php-general Digest 8 Jun 2007 00:38:11 -0000 Issue 4835

Topics (messages 256266 through 256334):

Re: php-cli vs python
        256266 by: Man-wai Chang
        256274 by: Daniel Brown
        256276 by: Robert Cummings
        256277 by: Daniel Brown
        256284 by: jose javier parra sanchez
        256287 by: Daniel Brown
        256313 by: Abdullah Ramazanoglu
        256316 by: Abdullah Ramazanoglu
        256317 by: Daniel Brown
        256322 by: Robert Cummings

Re: directories - again
        256267 by: Ross
        256269 by: Dave Goodchild
        256296 by: Al

file permissions
        256268 by: Ross
        256273 by: Daniel Brown

Re: ownership and permissions
        256270 by: Myron Turner

Re: XSLT and DocBook
        256271 by: Myron Turner

fsockopen with proxy?
        256272 by: Tijnema

Re: Parse domain from URL
        256275 by: Daniel Brown
        256327 by: Brad Fuller
        256329 by: Tijnema

File Upload - post_max_size and upload_max_filesize in GBs
        256278 by: Sukhwinder Singh
        256280 by: Stut
        256282 by: Sukhwinder Singh
        256283 by: Jim Moseby
        256285 by: Stut
        256288 by: Sukhwinder Singh
        256291 by: Sukhwinder Singh
        256292 by: Stut
        256293 by: Sukhwinder Singh
        256306 by: Sukhwinder Singh
        256307 by: Jim Moseby
        256320 by: Stut
        256323 by: Sukhwinder Singh
        256328 by: Stut
        256330 by: Sukhwinder Singh
        256332 by: Abdullah Ramazanoglu
        256333 by: Sukhwinder Singh

Re: cannot make directory at remote host
        256279 by: Jim Lucas

PHP process control
        256281 by: Nathan Nobbe
        256304 by: Nathan Nobbe
        256319 by: Stut

Patterns
        256286 by: Steve Marquez
        256290 by: Daniel Brown
        256294 by: Jay Blanchard
        256299 by: Daniel Brown

filesize() and mime_content_type()
        256289 by: Chris Boget
        256295 by: Daniel Brown
        256297 by: Chris Boget
        256298 by: Chris Boget
        256300 by: Daniel Brown
        256301 by: Daniel Brown
        256302 by: Chris Boget
        256303 by: Chris Boget

Re: register_globals and magic_quotes_gpc (again)
        256305 by: Tijnema
        256308 by: Afan Pasalic

logging of sql queries - success/failed
        256309 by: Bosky, Dave
        256310 by: Jim Moseby

file_get_contents
        256311 by: Chris Boget
        256314 by: Robert Cummings
        256315 by: Chris Boget
        256318 by: Robert Cummings

missing openssl
        256312 by: s2j1j1b0

Making your our MVC framework with PHP
        256321 by: Emil Ivanov
        256325 by: Robert Cummings

Re: php-cli vs python OT
        256324 by: Daniel Brown
        256326 by: Robert Cummings
        256331 by: Colin Guthrie

PHP tailing a log
        256334 by: Steve Finkelstein

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


> Otherwise you have to start again from scratch in python code (creating
> more places for bugs to hide and making the whole thing more complicated).
> While they can access the same database, there's nothing else they can
> share.
Micro$oft expressed interest in Python. But I don't know whether it's a
trap or bait... :)

--
   ~ Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
  / v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.04) Linux 2.6.21.3
   ^ ^ 19:46:01 up 11 days 3:19 0 users load average: 0.00 0.00 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

attached mail follows:


On 6/7/07, Man-wai Chang <toylet.toyletgmail.com> wrote:
> > Otherwise you have to start again from scratch in python code (creating
> > more places for bugs to hide and making the whole thing more complicated).
> > While they can access the same database, there's nothing else they can
> > share.
> Micro$oft expressed interest in Python. But I don't know whether it's a
> trap or bait... :)
>
> --
> ~ Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (Xubuntu 7.04) Linux 2.6.21.3
> ^ ^ 19:46:01 up 11 days 3:19 0 users load average: 0.00 0.00 0.00
> news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    Interesting reading:
        http://wiki.w4py.org/python-vs-php.html

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


On Thu, 2007-06-07 at 10:46 -0400, Daniel Brown wrote:
> On 6/7/07, Man-wai Chang <toylet.toyletgmail.com> wrote:
> > > Otherwise you have to start again from scratch in python code (creating
> > > more places for bugs to hide and making the whole thing more complicated).
> > > While they can access the same database, there's nothing else they can
> > > share.
> > Micro$oft expressed interest in Python. But I don't know whether it's a
> > trap or bait... :)
>
> Interesting reading:
> http://wiki.w4py.org/python-vs-php.html

They forgot a PHP pro... speed!

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


On 6/7/07, Robert Cummings <robertinterjinn.com> wrote:
> On Thu, 2007-06-07 at 10:46 -0400, Daniel Brown wrote:
> > On 6/7/07, Man-wai Chang <toylet.toyletgmail.com> wrote:
> > > > Otherwise you have to start again from scratch in python code (creating
> > > > more places for bugs to hide and making the whole thing more complicated).
> > > > While they can access the same database, there's nothing else they can
> > > > share.
> > > Micro$oft expressed interest in Python. But I don't know whether it's a
> > > trap or bait... :)
> >
> > Interesting reading:
> > http://wiki.w4py.org/python-vs-php.html
>
> They forgot a PHP pro... speed!
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
>

    They also don't touch on the extensibility, automation of
expansion with PEAR and PECL, virtually unlimited and
readily-available core modules and scripts, and the vast
implementations the world over.... but who's really paying attention,
anyway? ;-P

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


Hi. One big diferrence is that python can be run interactively, while
php not. That's a really good advantage to debug the scripts. Anyway,
use the one you fell more comfortable.

2007/6/7, Abdullah Ramazanoglu <ar018yahoo.com>:
> Hello,
>
> I'm already (going to) use php for web based development. Shell scripting
> and compiled languages have their own places, but there's also a place for
> a high level scripting language. While people usually use python (for
> higher level and perl for lower level tasks) for this, I really wonder
> whether this would be worthwhile for me.
>
> I have just cursory info about python, and I'm by no means a php expert. So
> I can't reliably compare the two, but my rationale so far is simple: If
> php5, with its enhanced object oriented features and rich libraries is on
> par with python on the command line, then wouldn't it make better sense
> for me to use php for both web and cli/gui development?
>
> Nevertheless, I can't ignore the fact that people do use python almost
> exclusively for high level CLI/GUI scripting. Where's the catch? What's
> the top 3 killer features of python against php (and vice versa)?
>
> Any ideas, pointers, analysis, insights are most welcome. This is a rather
> strategical crossroads for me, and I'd very much like to make an informed
> decision.
>
> Thank you and kind regards.
> --
> Abdullah Ramazanoglu
> aramazan ÄT myrealbox D0T cöm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On 6/7/07, jose javier parra sanchez <jojapasagmail.com> wrote:
> Hi. One big diferrence is that python can be run interactively, while
> php not. That's a really good advantage to debug the scripts. Anyway,
> use the one you fell more comfortable.
>
>
> 2007/6/7, Abdullah Ramazanoglu <ar018yahoo.com>:
> > Hello,
> >
> > I'm already (going to) use php for web based development. Shell scripting
> > and compiled languages have their own places, but there's also a place for
> > a high level scripting language. While people usually use python (for
> > higher level and perl for lower level tasks) for this, I really wonder
> > whether this would be worthwhile for me.
> >
> > I have just cursory info about python, and I'm by no means a php expert. So
> > I can't reliably compare the two, but my rationale so far is simple: If
> > php5, with its enhanced object oriented features and rich libraries is on
> > par with python on the command line, then wouldn't it make better sense
> > for me to use php for both web and cli/gui development?
> >
> > Nevertheless, I can't ignore the fact that people do use python almost
> > exclusively for high level CLI/GUI scripting. Where's the catch? What's
> > the top 3 killer features of python against php (and vice versa)?
> >
> > Any ideas, pointers, analysis, insights are most welcome. This is a rather
> > strategical crossroads for me, and I'd very much like to make an informed
> > decision.
> >
> > Thank you and kind regards.
> > --
> > Abdullah Ramazanoglu
> > aramazan ÄT myrealbox D0T cöm
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    My mistake.... I thought that's what `php -a` did.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


Chris dedi ki:
> Abdullah Ramazanoglu wrote:
 --8<--
 
> Personally I'd stick to one or the other for the whole project, you'll
> save yourself a lot of headaches in the future.

Thank you Chris, for the insight. The more I think about it, the closer I
get to the same conclusion. I've already made up my mind for php in web
based development. Also, I'm still unable to find a dramatic disadvantage
of php against python on the command line. What's more, I'm actually more
of a sysadmin than a dedicated application programmer. So I can't afford
to put more or less similar languages of the same league under my belt.

Kind regards,
--
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

attached mail follows:


Daniel Brown dedi ki:
> On 6/7/07, Man-wai Chang <toylet.toyletgmail.com> wrote:
  --8<--

> Interesting reading:
> http://wiki.w4py.org/python-vs-php.html

Really interesting. It was a relief for me to see that even a somewhat
biased document written by python champions didn't reveal serious
advantages over php enough to consider dual language programming.

However, there's a general perception of php as a "web-only" language, and
all the comparisons I find -this one included- end up comparing the two as
web programming languages. What I really need is a comparison regarding
pure cli or gui projects.

I found one intersting item though: Under the "What does Python have that
PHP doesn't?" header, there's a bullet stating that "support for all major
GUI frameworks". I know that both php and python have support for gtk. Am
I to understand from this statement that python has also support for qt?

Kind regards,
--
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

attached mail follows:


On 6/7/07, Abdullah Ramazanoglu <ar018yahoo.com> wrote:
> Daniel Brown dedi ki:
> > On 6/7/07, Man-wai Chang <toylet.toyletgmail.com> wrote:
> --8<--
>
> > Interesting reading:
> > http://wiki.w4py.org/python-vs-php.html
>
> Really interesting. It was a relief for me to see that even a somewhat
> biased document written by python champions didn't reveal serious
> advantages over php enough to consider dual language programming.
>
> However, there's a general perception of php as a "web-only" language, and
> all the comparisons I find -this one included- end up comparing the two as
> web programming languages. What I really need is a comparison regarding
> pure cli or gui projects.
>
> I found one intersting item though: Under the "What does Python have that
> PHP doesn't?" header, there's a bullet stating that "support for all major
> GUI frameworks". I know that both php and python have support for gtk. Am
> I to understand from this statement that python has also support for qt?
>
> Kind regards,
> --
> Abdullah Ramazanoglu
> aramazan ÄT myrealbox D0T cöm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    If I'm not completely mistaken, I think that Python can even
interface with the GNOME libraries. PHP could theoretically do that,
as well, if someone went through and created extensions for it all.

    PHP is an excellent command-line interpreter, in my opinion. I'd
say that, in all of my day-to-day PHP programming, about 60% of the
code is for the web, with 35% being run from the command line, and 5%
magically disappearing, to loud screams of frustration and broken
coffee mugs.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


On Thu, 2007-06-07 at 16:19 -0400, Daniel Brown wrote:
> On 6/7/07, Abdullah Ramazanoglu <ar018yahoo.com> wrote:
>
> If I'm not completely mistaken, I think that Python can even
> interface with the GNOME libraries. PHP could theoretically do that,
> as well, if someone went through and created extensions for it all.
>
> PHP is an excellent command-line interpreter, in my opinion. I'd
> say that, in all of my day-to-day PHP programming, about 60% of the
> code is for the web, with 35% being run from the command line, and 5%
> magically disappearing, to loud screams of frustration and broken
> coffee mugs.

I had one of those little screams yesterday when I started using the
PHP's id3 lib when I realized it's crap because it can't delete or write
version 2 tags. Fortunately I found a nice user comment pointing me to
the PHP implemented getid3 lib. An hour later my mp3 collection (several
thousand ripped from my own CD collection of course :) had nice ID3 tags
based on the directories and filenames I had created a few years ago.

Wasn't an issue when I was using XMMS but I just switched to Amarok and
it makes extensive sensible use of ID3 tags :)

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


No I want it to be 777 when I upload it not upload it nd have to change it.

""itoctopus"" <newsgroupitoctopus.com> wrote in message
news:DB.58.50146.79DE7664pb1.pair.com...
> use the function chmod
>
> chmod($img_url, 0777); //note the leading 0, it should be there
>
> I hope this is what you want:
>
>
> --
> itoctopus - http://www.itoctopus.com
> ""Ross"" <rossaztechost.com> wrote in message
> news:CF.A0.50146.2C7B7664pb1.pair.com...
>> Hi,
>>
>> I can make the files now after setting the permission to my images folder
>> but I cannot delete the folder or images in it. I have tried unlink and
>> rmdir with no success. Even with filezilla cannot delete it
>>
>>
>> The problem seems to be the images that are set to chmod of 600 and
>> cannot
>> be changed. I upload the file with this
>>
>> move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $img_url)
>>
>> is there a way to set the permissions of the images on upload to anything
>> other than 600?
>>
>> R.

attached mail follows:


umask

attached mail follows:


Here is a function you and others may find helpful. It may need some work, I
haven't fully checked it out.

DOC_ROOT is $_SERVER['DOCUMENT_ROOT']
ftp_conn() is a simple ftp connection function.

/**
   * dir_perms()
   *
   * Checks to see who is dir owner and uses ftp or php to change permissions
   *
   * param string $mode; read/execute 755 or read/write/execute 757 Use read or
write 757 required to delete files and remove dir
   * param mixed $dir; can be full or relative to doc root
   * return TRUE or FALSE
   */
function dir_perms($mode='read', $dir){

        if(!isset($mode, $dir))
        die ("dir_perms() did not receive mode or dir. Tech support required.");

          $perms= ($mode== 'write')? 0757 : 0755;

        $pattern= DOC_ROOT;
          $fpdir= preg_match("%$pattern%i", $dir)? $dir : DOC_ROOT . $dir; //full path
                                
          $rpdir= preg_replace("%$pattern%i", '', $dir); //relative to DOC_ROOT for ftp
                                                        
          if(!file_exists($fpdir)) return FALSE;

  //See who is dir owner
          if(fileowner($fpdir) == getmyuid()){ //File is site owner
                  $conn_id= ftp_conn();

                  if(!ftp_chmod($conn_id, $perms, $rpdir)) {
                          ftp_close($conn_id);
                          return FALSE;
                  }

                  ftp_close($conn_id);
                  return TRUE;
          }

          else{
                  if(chmod($fpdir, $perms)) return TRUE;
                  return FALSE;
          }
  }//END FUNCTION

Ross wrote:
> Hi,
>
> I can make the files now after setting the permission to my images folder
> but I cannot delete the folder or images in it. I have tried unlink and
> rmdir with no success. Even with filezilla cannot delete it
>
>
> The problem seems to be the images that are set to chmod of 600 and cannot
> be changed. I upload the file with this
>
> move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $img_url)
>
> is there a way to set the permissions of the images on upload to anything
> other than 600?
>
> R.

attached mail follows:


n relation to my other posts it is not that the folder permission are not
working, when I put an image inside them the image automatically has a 600
chmod and has the owner is 'nobody'. This means I cannot delete the files.

mkdir('images/'.$customer_id, 0755);
chown('images/'.$customer_id, 'ross');

with this I get a

Warning: chown() [function.chown]: Operation not permitted

R.

attached mail follows:


On 6/7/07, Ross <rossaztechost.com> wrote:
>
>
> n relation to my other posts it is not that the folder permission are not
> working, when I put an image inside them the image automatically has a 600
> chmod and has the owner is 'nobody'. This means I cannot delete the files.
>
> mkdir('images/'.$customer_id, 0755);
> chown('images/'.$customer_id, 'ross');
>
> with this I get a
>
> Warning: chown() [function.chown]: Operation not permitted
>
>
> R.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    Ross,

    In order to chown from one user to another, you either have to be
root or in the wheel group. The easiest way to handle this is to
either chmod the script that's uploading the files to 6755 (owner can
read/write/execute, group can read/execute, world can read/execute,
runs with user/group permissions), which should (if the server is
configured properly) then make your images owned by yourself. If not,
or to delete existing data, simply do one of the following:

<?
    exec('rm -fR '.$dir_with_files_to_delete,$ret,$xc);
    $xc == 1 ? $ret : '';
?>

    Or....

<?
    chmod($nobody_owned_dir."/".$nobody_owned_files,0777);
    chmod($nobody_owned_dir,0777);
?>

    Then you should be able to modify and delete the files and
directories from your FTP client.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


blueboy wrote:
> t: 0131 553 3935 | m:07816 996 930 | rossblue-fly.co.uk |
> http://www:blue-fly.co.uk
>
>
> I cannot delete a couple of folders on the server as the have the owner
> 'nobody'. All I am doing is making the folders with
>
> mkdir($customer_id, 0755);
>
>
> Now is there a way to set the ownership when I created the folder. What is
> the appropriate folder levels for securoty (755, 640?)
>
> Thanks,
>
> R.
>
>
If they are set to 600, and they were created by the web server, then
you won't be able to delete them under your own username, using ftp,
which is why filezilla doesn't work. But you should be able to write a
php script which can delete them when it is called from your browser.
Before you can remove the directory, you will first have to delete all
the files it holds:

$dir = "images";
foreach($files as $file) {
   unlink ($dir. '/' .$file);
}

remdir($dir);

--

_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

attached mail follows:


Larry Garfield wrote:
> Hi all. I have a DocBook source[1] that I am processing into XHTML using the
> DocBook XSL[2] toolchain. That is, XSLT. I'm not doing a huge amount of
> customization on top of the default setup, either. Right now, I'm using the
> standard XSLT Java toolchain; Xalan, Xerces, XIncluder, and all of the
> various other Apache projects[3]. The problem is, well, it's Java, which
> means the classpaths and build environment and such break if I so much as
> sneeze at the wrong time. I'd love to be able to replace it with PHP's XSL
> parser[4], since I actually know PHP and its chances of breaking on every
> other Tuesday are slimmer, but I don't know if it has all of the
> functionality I'd need.
>
> Specifically, I need multi-file output and support for <xinclude: />
> directives. Right now I'm using the Xalan multi-file output extensions, but
> I'm happy to switch to something else if it means eliminating the huge gobs
> of touchy Javascript I have.
>
> Does anyone know if that's doable with PHP's XSLT support (circa PHP 5.2, I
> run the server so can install whatever I need)? Has anyone tried doing this
> before? It's all offline processing, so performance isn't a huge issue.
> Thanks.
>
> [1] http://www.docbook.org/tdg/en/html/docbook.html
> [2] http://www.sagehill.net/docbookxsl/
> [3] http://xml.apache.org/
> [4] http://us.php.net/manual/en/ref.xsl.php
>
>
You might get help from comp.text.xml

--

_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

attached mail follows:


Hi,

What I want is to send a complete HTTP request, including special
headers, to another server over a HTTP proxy. Is this possible with
PHP?
I've seen the manual, and it doesn't say anything about proxy. I've
checked the comments on the fsockopen page, and there's a comment
about it for using ICQ status request through proxy, but it seems not
what i need.

Tijnema

attached mail follows:


On 6/7/07, Robin Vickery <robinvgmail.com> wrote:
> On 06/06/07, Brad Fuller <bfullercpacampaigns.com> wrote:
> > Daniel Brown wrote:
> > > On 6/6/07, Brad Fuller <bfullercpacampaigns.com> wrote:
> > >>
> > >> I need to strip out a domain name from a URL, and ignore subdomains
> > >> (like www)
> > >>
> > >> I can use parse_url to get the hostname. And my first thought was to
> > >> take the last 2 segments of the hostname to get the domain.
> > > So if the
> > >> URL is http://www.example.com/
> > >> Then the domain is "example.com." If the URL is
> > >> http://example.org/ then the domain is "example.org."
> > >>
> > >> This seemed to work perfectly until I come across a URL like
> > >> http://www.example.co.uk/ My script thinks the domain is "co.uk."
> > >>
> > >> So I added a bit of code to account for this, basically if the 2nd to
> > >> last segment of the hostname is "co" then take the last 3 segments.
> > >>
> > >> Then I stumbled across a URL like http://www.example.com.au/
> > >>
> > >> So it occurred to me that this is not the best solution, unless I
> > >> have a definitive list of all exceptions to go off of.
> > >>
> > >> Does anyone have any suggestions?
> > >>
> > >> Any advice is much appreciated.
> > >
> > > Well, it's not very clean, but if you just need to remove
> > > the subdomain/CNAME from the domain....
> > >
> > > <?
> > > $hostname = parse_url($_SERVER['SERVER_NAME']);
> > > $domsplit = explode('.',$hostname['path']);
> > > for($i=1;$i<count($domsplit);$i++) {
> > > $i == (count($domsplit) - 1) ? $domain .= $domsplit[$i] :
> > > $domain .= $domsplit[$i]."."; }
> > > echo $domain;
> > >>
> > >
> > > There's probably a much better way to do it, but in the
> > > interest of a quick response, that's one way.
> >
> >
> > Yes, that's basically what my code already does.
> >
> > The problem is that what if the url is "http://yahoo.co.uk/" (note the lack
> > of a subdomain)
> >
> > Your script thinks that the domain is "co.uk". Just like my existing code
> > does.
> >
> > So we can't count on taking the last 2 segments. And we can't count on
> > ignoring the first segment. (The subdomain could be anything, not just www)
>
> In that case you can't do it just by parsing alone, you need to use DNS.
>
> <?php
> function get_domain ($hostname) {
> dns_get_record($hostname, DNS_A, $authns, $addt);
> return $authns[0]['host'];
> }
>
> print get_domain("www.google.com") . "\n";
> print get_domain("google.com") . "\n";
> print get_domain("www.google.co.uk") . "\n";
> print get_domain("google.co.uk") . "\n";
> print get_domain("google.co.uk") . "\n";
> print get_domain("google.com.au") . "\n";
> print get_domain("www.google.com.au") . "\n";
>
> /* result
> google.com
> google.com
> google.co.uk
> google.co.uk
> google.co.uk
> google.com.au
> google.com.au
> */
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    Wow.... great job, Robin.... I didn't even know about the
dns_get_record() function myself until just now. I can actually think
of a few places to use that now.... email validation, for one.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


Robin Vickery wrote:
> In that case you can't do it just by parsing alone, you need to use
> DNS.
>
> <?php
> function get_domain ($hostname) {
> dns_get_record($hostname, DNS_A, $authns, $addt); return
> $authns[0]['host']; }
>
> print get_domain("www.google.com") . "\n"; print
> get_domain("google.com") . "\n"; print
> get_domain("www.google.co.uk") . "\n"; print
> get_domain("google.co.uk") . "\n"; print
> get_domain("google.co.uk") . "\n"; print
> get_domain("google.com.au") . "\n"; print
> get_domain("www.google.com.au") . "\n";
>
> /* result
> google.com
> google.com
> google.co.uk
> google.co.uk
> google.co.uk
> google.com.au
> google.com.au
> */
>>

Robin,

This is a very good solution, and I thank you for your response. However I
had been experimenting with dns_get_record() before my original post and it
produces strange results on my machine. And your example, on my machine,
produces no output.

<?
$dns_result = dns_get_record("www.google.com", DNS_A, $authns, $addt);

print_r($dns_result);
print_r($authns);
print_r($addt);

/* result
Array
(
    [0] => Array
        (
            [host] => www.l.google.com
            [type] => A
            [ip] => 64.233.161.99
            [class] => IN
            [ttl] => 136
        )

    [1] => Array
        (
            [host] => www.l.google.com
            [type] => A
            [ip] => 64.233.161.147
            [class] => IN
            [ttl] => 136
        )

    [2] => Array
        (
            [host] => www.l.google.com
            [type] => A
            [ip] => 64.233.161.103
            [class] => IN
            [ttl] => 136
        )

    [3] => Array
        (
            [host] => www.l.google.com
            [type] => A
            [ip] => 64.233.161.104
            [class] => IN
            [ttl] => 136
        )

)
Array
(
)
Array
(
)
*/

?>

Any suggestions??

Thanks,
Brad

attached mail follows:


On 6/7/07, Brad Fuller <bfullercpacampaigns.com> wrote:
> Robin Vickery wrote:
> > In that case you can't do it just by parsing alone, you need to use
> > DNS.
> >
> > <?php
> > function get_domain ($hostname) {
> > dns_get_record($hostname, DNS_A, $authns, $addt); return
> > $authns[0]['host']; }
> >
> > print get_domain("www.google.com") . "\n"; print
> > get_domain("google.com") . "\n"; print
> > get_domain("www.google.co.uk") . "\n"; print
> > get_domain("google.co.uk") . "\n"; print
> > get_domain("google.co.uk") . "\n"; print
> > get_domain("google.com.au") . "\n"; print
> > get_domain("www.google.com.au") . "\n";
> >
> > /* result
> > google.com
> > google.com
> > google.co.uk
> > google.co.uk
> > google.co.uk
> > google.com.au
> > google.com.au
> > */
> >>
>
>
> Robin,
>
> This is a very good solution, and I thank you for your response. However I
> had been experimenting with dns_get_record() before my original post and it
> produces strange results on my machine. And your example, on my machine,
> produces no output.
>
> <?
> $dns_result = dns_get_record("www.google.com", DNS_A, $authns, $addt);
>
> print_r($dns_result);
> print_r($authns);
> print_r($addt);
>
> /* result
> Array
> (
> [0] => Array
> (
> [host] => www.l.google.com
> [type] => A
> [ip] => 64.233.161.99
> [class] => IN
> [ttl] => 136
> )
>
> [1] => Array
> (
> [host] => www.l.google.com
> [type] => A
> [ip] => 64.233.161.147
> [class] => IN
> [ttl] => 136
> )
>
> [2] => Array
> (
> [host] => www.l.google.com
> [type] => A
> [ip] => 64.233.161.103
> [class] => IN
> [ttl] => 136
> )
>
> [3] => Array
> (
> [host] => www.l.google.com
> [type] => A
> [ip] => 64.233.161.104
> [class] => IN
> [ttl] => 136
> )
>
> )
> Array
> (
> )
> Array
> (
> )
> */
>
> ?>
>
> Any suggestions??
>
>
> Thanks,
> Brad

I have same results as you brad,
I have Apache 2.2.3 + PHP 5.2.3RC1, so if you finally get it working,
it's definitely not portable code :P
Maybe it's an option to talk to a whois server?

Tijnema

attached mail follows:


Hello,

I want to allow uploading of huge video files, which may be as big as 4 GB. But when I try to set

post_max_size = 4G
upload_max_filesize = 4G

in php.ini, it doesn't work and everything in post (posted data) is ignored.

I get a warning about size of posted data greater than some negative number.

I read somewhere that php stores this data in integer.

I have tested it on 64 bit system (php 5.1.6 installed on Mandriva 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp sp2).

Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works

We need to allow uploading of 4 GB files. Is there any solution.

Regards,
Sukhwinder Singh

attached mail follows:


Sukhwinder Singh wrote:
> I want to allow uploading of huge video files, which may be as big as 4 GB. But when I try to set
>
> post_max_size = 4G
> upload_max_filesize = 4G
>
> in php.ini, it doesn't work and everything in post (posted data) is ignored.
>
> I get a warning about size of posted data greater than some negative number.
>
> I read somewhere that php stores this data in integer.
>
> I have tested it on 64 bit system (php 5.1.6 installed on Mandriva 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp sp2).
>
> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>
> We need to allow uploading of 4 GB files. Is there any solution.

Yeah, don't use HTTP. Seriously, HTTP is a crappy mechanism for
uploading files, especially large ones. And by large ones I mean >~20MB!!

You need to look into maybe a java applet, or just plain FTP/SFTP/SCP
for files that big. HTTP was never designed to handle uploading files of
that size. For a start there is no facility to restart the upload should
it get interrupted and fail.

-Stut

attached mail follows:


Thanks for your reply.

So you are saying I cannot do it using php. These files have to be uploaded
locally but using web interface and I have to pass some parameters along
with file upload to update the database after upload is successful. Also I
have to rename the file after it is uploaded.

Any utility which allows this?

Thanks,
Sukhwinder Singh

----- Original Message -----
From: "Stut" <stuttlegmail.com>
To: "Sukhwinder Singh" <ssrupraihotmail.com>
Cc: <php-generallists.php.net>
Sent: Thursday, June 07, 2007 8:35 PM
Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
GBs

> Sukhwinder Singh wrote:
>> I want to allow uploading of huge video files, which may be as big as 4
>> GB. But when I try to set post_max_size = 4G
>> upload_max_filesize = 4G
>>
>> in php.ini, it doesn't work and everything in post (posted data) is
>> ignored.
>>
>> I get a warning about size of posted data greater than some negative
>> number.
>>
>> I read somewhere that php stores this data in integer.
>>
>> I have tested it on 64 bit system (php 5.1.6 installed on Mandriva
>> 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp sp2).
>>
>> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>>
>> We need to allow uploading of 4 GB files. Is there any solution.
>
> Yeah, don't use HTTP. Seriously, HTTP is a crappy mechanism for uploading
> files, especially large ones. And by large ones I mean >~20MB!!
>
> You need to look into maybe a java applet, or just plain FTP/SFTP/SCP for
> files that big. HTTP was never designed to handle uploading files of that
> size. For a start there is no facility to restart the upload should it get
> interrupted and fail.
>
> -Stut
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


>
> Hello,
>
> I want to allow uploading of huge video files, which may be
> as big as 4 GB. But when I try to set
>
> post_max_size = 4G
> upload_max_filesize = 4G
>
> in php.ini, it doesn't work and everything in post (posted
> data) is ignored.
>
> I get a warning about size of posted data greater than some
> negative number.
>
> I read somewhere that php stores this data in integer.
>
> I have tested it on 64 bit system (php 5.1.6 installed on
> Mandriva 2007.0) as well as 32 bit system (php 5.2.2
> installed on windows xp sp2).
>
> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>
> We need to allow uploading of 4 GB files. Is there any solution.
>
> Regards,
> Sukhwinder Singh

Rumor has it that uploaded files are stored in memory before being committed
to disk. If so, the amount of free RAM available to PHP would be the limit
to the filesize regardless of the ini file settings.

You should probably use another method of transport for files that large.
FTP immediately comes to mind.

JM

attached mail follows:


Sukhwinder Singh wrote:
> Thanks for your reply.
>
> So you are saying I cannot do it using php. These files have to be
> uploaded locally but using web interface and I have to pass some
> parameters along with file upload to update the database after upload is
> successful. Also I have to rename the file after it is uploaded.
>
> Any utility which allows this?

Sounds like you need a Java applet. I have little experience with this,
but I know that quite a few exist. I have no idea if any of them support
sending meta data with the upload. I suggest you start Googling.

-Stut

> ----- Original Message ----- From: "Stut" <stuttlegmail.com>
> To: "Sukhwinder Singh" <ssrupraihotmail.com>
> Cc: <php-generallists.php.net>
> Sent: Thursday, June 07, 2007 8:35 PM
> Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize
> in GBs
>
>
>> Sukhwinder Singh wrote:
>>> I want to allow uploading of huge video files, which may be as big as
>>> 4 GB. But when I try to set post_max_size = 4G
>>> upload_max_filesize = 4G
>>>
>>> in php.ini, it doesn't work and everything in post (posted data) is
>>> ignored.
>>>
>>> I get a warning about size of posted data greater than some negative
>>> number.
>>>
>>> I read somewhere that php stores this data in integer.
>>>
>>> I have tested it on 64 bit system (php 5.1.6 installed on Mandriva
>>> 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp
>>> sp2).
>>>
>>> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>>>
>>> We need to allow uploading of 4 GB files. Is there any solution.
>>
>> Yeah, don't use HTTP. Seriously, HTTP is a crappy mechanism for
>> uploading files, especially large ones. And by large ones I mean >~20MB!!
>>
>> You need to look into maybe a java applet, or just plain FTP/SFTP/SCP
>> for files that big. HTTP was never designed to handle uploading files
>> of that size. For a start there is no facility to restart the upload
>> should it get interrupted and fail.
>>
>> -Stut
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

attached mail follows:


> Rumor has it that uploaded files are stored in memory before being
> committed
> to disk. If so, the amount of free RAM available to PHP would be the limit
> to the filesize regardless of the ini file settings.

I don't think that is the case. File is written to temp directory as it is
uploaded.
And the qeustion is of php having negative values after I specify post size
limit to 4G

> You should probably use another method of transport for files that large.
> FTP immediately comes to mind.

You mean ftp client? Like cute ftp. If yes, the problem is that along with
uploading the file I also have to update database to associate that file
with some user etc. It needs to be web based.

Sukhwinder Singh

----- Original Message -----
From: "Jim Moseby" <JMosebynrbindustries.com>
To: "'Sukhwinder Singh'" <ssrupraihotmail.com>; <php-generallists.php.net>
Sent: Thursday, June 07, 2007 8:52 PM
Subject: RE: [PHP] File Upload - post_max_size and upload_max_filesize in
GBs

>>
>> Hello,
>>
>> I want to allow uploading of huge video files, which may be
>> as big as 4 GB. But when I try to set
>>
>> post_max_size = 4G
>> upload_max_filesize = 4G
>>
>> in php.ini, it doesn't work and everything in post (posted
>> data) is ignored.
>>
>> I get a warning about size of posted data greater than some
>> negative number.
>>
>> I read somewhere that php stores this data in integer.
>>
>> I have tested it on 64 bit system (php 5.1.6 installed on
>> Mandriva 2007.0) as well as 32 bit system (php 5.2.2
>> installed on windows xp sp2).
>>
>> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>>
>> We need to allow uploading of 4 GB files. Is there any solution.
>>
>> Regards,
>> Sukhwinder Singh
>
>
> Rumor has it that uploaded files are stored in memory before being
> committed
> to disk. If so, the amount of free RAM available to PHP would be the limit
> to the filesize regardless of the ini file settings.
>
> You should probably use another method of transport for files that large.
> FTP immediately comes to mind.
>
> JM
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


>A beeter method is to send the file via ftp. I think most browsers
> allow this. And for example store the file in a user specific file.
> Then the user, via a web interface, select the file it has uploaded
> and do the rest of the operations you need.

Along with uploading the file I also have to pass other information to
update the database to associate that file with some user etc.

What kind of ftp method you are suggesting?

Sukhwinder Singh

----- Original Message -----
From: "jose javier parra sanchez" <jojapasagmail.com>
To: "Sukhwinder Singh" <ssrupraihotmail.com>
Sent: Thursday, June 07, 2007 8:59 PM
Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
GBs

>A beeter method is to send the file via ftp. I think most browsers
> allow this. And for example store the file in a user specific file.
> Then the user, via a web interface, select the file it has uploaded
> and do the rest of the operations you need.
>
> 2007/6/7, Sukhwinder Singh <ssrupraihotmail.com>:
>> Thanks for your reply.
>>
>> So you are saying I cannot do it using php. These files have to be
>> uploaded
>> locally but using web interface and I have to pass some parameters along
>> with file upload to update the database after upload is successful. Also
>> I
>> have to rename the file after it is uploaded.
>>
>> Any utility which allows this?
>>
>> Thanks,
>> Sukhwinder Singh
>>
>> ----- Original Message -----
>> From: "Stut" <stuttlegmail.com>
>> To: "Sukhwinder Singh" <ssrupraihotmail.com>
>> Cc: <php-generallists.php.net>
>> Sent: Thursday, June 07, 2007 8:35 PM
>> Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
>> GBs
>>
>>
>> > Sukhwinder Singh wrote:
>> >> I want to allow uploading of huge video files, which may be as big as
>> >> 4
>> >> GB. But when I try to set post_max_size = 4G
>> >> upload_max_filesize = 4G
>> >>
>> >> in php.ini, it doesn't work and everything in post (posted data) is
>> >> ignored.
>> >>
>> >> I get a warning about size of posted data greater than some negative
>> >> number.
>> >>
>> >> I read somewhere that php stores this data in integer.
>> >>
>> >> I have tested it on 64 bit system (php 5.1.6 installed on Mandriva
>> >> 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp
>> >> sp2).
>> >>
>> >> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>> >>
>> >> We need to allow uploading of 4 GB files. Is there any solution.
>> >
>> > Yeah, don't use HTTP. Seriously, HTTP is a crappy mechanism for
>> > uploading
>> > files, especially large ones. And by large ones I mean >~20MB!!
>> >
>> > You need to look into maybe a java applet, or just plain FTP/SFTP/SCP
>> > for
>> > files that big. HTTP was never designed to handle uploading files of
>> > that
>> > size. For a start there is no facility to restart the upload should it
>> > get
>> > interrupted and fail.
>> >
>> > -Stut
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

attached mail follows:


Sukhwinder Singh wrote:
>> Rumor has it that uploaded files are stored in memory before being
>> committed
>> to disk. If so, the amount of free RAM available to PHP would be the
>> limit
>> to the filesize regardless of the ini file settings.
>
> I don't think that is the case. File is written to temp directory as it
> is uploaded.
> And the qeustion is of php having negative values after I specify post
> size limit to 4G

I would hazard a guess that you're overflowing a signed 32-bit int by
specifying 4gig, but I could be wrong. It's certainly not the issue.

-Stut

attached mail follows:


>
> I would hazard a guess that you're overflowing a signed 32-bit int by
> specifying 4gig, but I could be wrong. It's certainly not the issue.
>

Yes you are right. That is what is happening.

Sukhwinder Singh

----- Original Message -----
From: "Stut" <stuttlegmail.com>
To: "Sukhwinder Singh" <ssrupraihotmail.com>
Cc: "Jim Moseby" <JMosebynrbindustries.com>; <php-generallists.php.net>
Sent: Thursday, June 07, 2007 9:16 PM
Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
GBs

> Sukhwinder Singh wrote:
>>> Rumor has it that uploaded files are stored in memory before being
>>> committed
>>> to disk. If so, the amount of free RAM available to PHP would be the
>>> limit
>>> to the filesize regardless of the ini file settings.
>>
>> I don't think that is the case. File is written to temp directory as it
>> is uploaded.
>> And the qeustion is of php having negative values after I specify post
>> size limit to 4G
>
> I would hazard a guess that you're overflowing a signed 32-bit int by
> specifying 4gig, but I could be wrong. It's certainly not the issue.
>
> -Stut
>

attached mail follows:


> Sounds like you need a Java applet. I have little experience with this,
> but I know that quite a few exist. I have no idea if any of them support
> sending meta data with the upload. I suggest you start Googling.
>

Even java applets have to hand over the file to some script, in this case
php and php will get it in $_FILES array it seems (in case of japplet). so
the problem will remain.

----- Original Message -----
From: "Stut" <stuttlegmail.com>
To: "Sukhwinder Singh" <ssrupraihotmail.com>
Cc: <php-generallists.php.net>
Sent: Thursday, June 07, 2007 8:56 PM
Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
GBs

> Sukhwinder Singh wrote:
>> Thanks for your reply.
>>
>> So you are saying I cannot do it using php. These files have to be
>> uploaded locally but using web interface and I have to pass some
>> parameters along with file upload to update the database after upload is
>> successful. Also I have to rename the file after it is uploaded.
>>
>> Any utility which allows this?
>
> Sounds like you need a Java applet. I have little experience with this,
> but I know that quite a few exist. I have no idea if any of them support
> sending meta data with the upload. I suggest you start Googling.
>
> -Stut
>
>> ----- Original Message ----- From: "Stut" <stuttlegmail.com>
>> To: "Sukhwinder Singh" <ssrupraihotmail.com>
>> Cc: <php-generallists.php.net>
>> Sent: Thursday, June 07, 2007 8:35 PM
>> Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
>> GBs
>>
>>
>>> Sukhwinder Singh wrote:
>>>> I want to allow uploading of huge video files, which may be as big as 4
>>>> GB. But when I try to set post_max_size = 4G
>>>> upload_max_filesize = 4G
>>>>
>>>> in php.ini, it doesn't work and everything in post (posted data) is
>>>> ignored.
>>>>
>>>> I get a warning about size of posted data greater than some negative
>>>> number.
>>>>
>>>> I read somewhere that php stores this data in integer.
>>>>
>>>> I have tested it on 64 bit system (php 5.1.6 installed on Mandriva
>>>> 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp
>>>> sp2).
>>>>
>>>> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>>>>
>>>> We need to allow uploading of 4 GB files. Is there any solution.
>>>
>>> Yeah, don't use HTTP. Seriously, HTTP is a crappy mechanism for
>>> uploading files, especially large ones. And by large ones I mean
>>> >~20MB!!
>>>
>>> You need to look into maybe a java applet, or just plain FTP/SFTP/SCP
>>> for files that big. HTTP was never designed to handle uploading files of
>>> that size. For a start there is no facility to restart the upload should
>>> it get interrupted and fail.
>>>
>>> -Stut
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>
>

attached mail follows:


>
> > Rumor has it that uploaded files are stored in memory before being
> > committed
> > to disk. If so, the amount of free RAM available to PHP
> would be the limit
> > to the filesize regardless of the ini file settings.
>
> I don't think that is the case. File is written to temp
> directory as it is
> uploaded.
> And the qeustion is of php having negative values after I
> specify post size
> limit to 4G
>

There is a comment in the documentation for move_uploaded_file() that
indicates the entire file is saved in memory prior to writing to the
temporary upload area. Maybe this is not true. Read it for yourself. Its
just a comment, so who knows?

Also, there is an indication that you may need to tweak memory_limit in
php.ini.

> > You should probably use another method of transport for
> files that large.
> > FTP immediately comes to mind.
>
> You mean ftp client? Like cute ftp. If yes, the problem is
> that along with
> uploading the file I also have to update database to
> associate that file
> with some user etc. It needs to be web based.
>

After a quick search I found an applet that handles file uploads, and can
use FTP as the transport protocol.

http://radinks.com/upload/

JM

attached mail follows:


Sukhwinder Singh wrote:
>> Sounds like you need a Java applet. I have little experience with
>> this, but I know that quite a few exist. I have no idea if any of them
>> support sending meta data with the upload. I suggest you start Googling.
>>
>
> Even java applets have to hand over the file to some script, in this
> case php and php will get it in $_FILES array it seems (in case of
> japplet). so the problem will remain.

Not at all true. A Java applet can use FTP to handle the upload and
still pass meta data about the file as an HTTP POST request. There is no
requirement to use HTTP to upload the file from a Java applet.

-Stut

> ----- Original Message ----- From: "Stut" <stuttlegmail.com>
> To: "Sukhwinder Singh" <ssrupraihotmail.com>
> Cc: <php-generallists.php.net>
> Sent: Thursday, June 07, 2007 8:56 PM
> Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize
> in GBs
>
>
>> Sukhwinder Singh wrote:
>>> Thanks for your reply.
>>>
>>> So you are saying I cannot do it using php. These files have to be
>>> uploaded locally but using web interface and I have to pass some
>>> parameters along with file upload to update the database after upload
>>> is successful. Also I have to rename the file after it is uploaded.
>>>
>>> Any utility which allows this?
>>
>> Sounds like you need a Java applet. I have little experience with
>> this, but I know that quite a few exist. I have no idea if any of them
>> support sending meta data with the upload. I suggest you start Googling.
>>
>> -Stut
>>
>>> ----- Original Message ----- From: "Stut" <stuttlegmail.com>
>>> To: "Sukhwinder Singh" <ssrupraihotmail.com>
>>> Cc: <php-generallists.php.net>
>>> Sent: Thursday, June 07, 2007 8:35 PM
>>> Subject: Re: [PHP] File Upload - post_max_size and
>>> upload_max_filesize in GBs
>>>
>>>
>>>> Sukhwinder Singh wrote:
>>>>> I want to allow uploading of huge video files, which may be as big
>>>>> as 4 GB. But when I try to set post_max_size = 4G
>>>>> upload_max_filesize = 4G
>>>>>
>>>>> in php.ini, it doesn't work and everything in post (posted data) is
>>>>> ignored.
>>>>>
>>>>> I get a warning about size of posted data greater than some
>>>>> negative number.
>>>>>
>>>>> I read somewhere that php stores this data in integer.
>>>>>
>>>>> I have tested it on 64 bit system (php 5.1.6 installed on Mandriva
>>>>> 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp
>>>>> sp2).
>>>>>
>>>>> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>>>>>
>>>>> We need to allow uploading of 4 GB files. Is there any solution.
>>>>
>>>> Yeah, don't use HTTP. Seriously, HTTP is a crappy mechanism for
>>>> uploading files, especially large ones. And by large ones I mean
>>>> >~20MB!!
>>>>
>>>> You need to look into maybe a java applet, or just plain
>>>> FTP/SFTP/SCP for files that big. HTTP was never designed to handle
>>>> uploading files of that size. For a start there is no facility to
>>>> restart the upload should it get interrupted and fail.
>>>>
>>>> -Stut
>>>>
>>>> --
>>>> PHP General Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>>
>>
>>
>

attached mail follows:


>> Even java applets have to hand over the file to some script, in this case
>> php and php will get it in $_FILES array it seems (in case of japplet).
>> so the problem will remain.
>
> Not at all true. A Java applet can use FTP to handle the upload and still
> pass meta data about the file as an HTTP POST request. There is no
> requirement to use HTTP to upload the file from a Java applet.

It is not about how data is going to be transferred but it is about php
having a limit on what it can accept as POST.
But we'll see how it works out. I'll let everyone know.
I am trying japplet for now.

Thanks for replying.

Sukhwinder Singh

----- Original Message -----
From: "Stut" <stuttlegmail.com>
To: "Sukhwinder Singh" <ssrupraihotmail.com>
Cc: <php-generallists.php.net>
Sent: Friday, June 08, 2007 1:28 AM
Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
GBs

> Sukhwinder Singh wrote:
>>> Sounds like you need a Java applet. I have little experience with this,
>>> but I know that quite a few exist. I have no idea if any of them support
>>> sending meta data with the upload. I suggest you start Googling.
>>>
>>
>> Even java applets have to hand over the file to some script, in this case
>> php and php will get it in $_FILES array it seems (in case of japplet).
>> so the problem will remain.
>
> Not at all true. A Java applet can use FTP to handle the upload and still
> pass meta data about the file as an HTTP POST request. There is no
> requirement to use HTTP to upload the file from a Java applet.
>
> -Stut
>
>> ----- Original Message ----- From: "Stut" <stuttlegmail.com>
>> To: "Sukhwinder Singh" <ssrupraihotmail.com>
>> Cc: <php-generallists.php.net>
>> Sent: Thursday, June 07, 2007 8:56 PM
>> Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
>> GBs
>>
>>
>>> Sukhwinder Singh wrote:
>>>> Thanks for your reply.
>>>>
>>>> So you are saying I cannot do it using php. These files have to be
>>>> uploaded locally but using web interface and I have to pass some
>>>> parameters along with file upload to update the database after upload
>>>> is successful. Also I have to rename the file after it is uploaded.
>>>>
>>>> Any utility which allows this?
>>>
>>> Sounds like you need a Java applet. I have little experience with this,
>>> but I know that quite a few exist. I have no idea if any of them support
>>> sending meta data with the upload. I suggest you start Googling.
>>>
>>> -Stut
>>>
>>>> ----- Original Message ----- From: "Stut" <stuttlegmail.com>
>>>> To: "Sukhwinder Singh" <ssrupraihotmail.com>
>>>> Cc: <php-generallists.php.net>
>>>> Sent: Thursday, June 07, 2007 8:35 PM
>>>> Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize
>>>> in GBs
>>>>
>>>>
>>>>> Sukhwinder Singh wrote:
>>>>>> I want to allow uploading of huge video files, which may be as big as
>>>>>> 4 GB. But when I try to set post_max_size = 4G
>>>>>> upload_max_filesize = 4G
>>>>>>
>>>>>> in php.ini, it doesn't work and everything in post (posted data) is
>>>>>> ignored.
>>>>>>
>>>>>> I get a warning about size of posted data greater than some negative
>>>>>> number.
>>>>>>
>>>>>> I read somewhere that php stores this data in integer.
>>>>>>
>>>>>> I have tested it on 64 bit system (php 5.1.6 installed on Mandriva
>>>>>> 2007.0) as well as 32 bit system (php 5.2.2 installed on windows xp
>>>>>> sp2).
>>>>>>
>>>>>> Value up to, I think, 2147483647 bytes or ( around 1.999.. gb) works
>>>>>>
>>>>>> We need to allow uploading of 4 GB files. Is there any solution.
>>>>>
>>>>> Yeah, don't use HTTP. Seriously, HTTP is a crappy mechanism for
>>>>> uploading files, especially large ones. And by large ones I mean
>>>>> >~20MB!!
>>>>>
>>>>> You need to look into maybe a java applet, or just plain FTP/SFTP/SCP
>>>>> for files that big. HTTP was never designed to handle uploading files
>>>>> of that size. For a start there is no facility to restart the upload
>>>>> should it get interrupted and fail.
>>>>>
>>>>> -Stut
>>>>>
>>>>> --
>>>>> PHP General Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>

attached mail follows:


Sukhwinder Singh wrote:
>>> Even java applets have to hand over the file to some script, in this
>>> case php and php will get it in $_FILES array it seems (in case of
>>> japplet). so the problem will remain.
>>
>> Not at all true. A Java applet can use FTP to handle the upload and
>> still pass meta data about the file as an HTTP POST request. There is
>> no requirement to use HTTP to upload the file from a Java applet.
>
> It is not about how data is going to be transferred but it is about php
> having a limit on what it can accept as POST.
> But we'll see how it works out. I'll let everyone know.
> I am trying japplet for now.

You don't appear to have read what I said. A Java applet can use FTP to
upload the file - PHP does not get involved in that part. Once the
upload is complete the applet can POST to your PHP file giving it
information like where it's put the file and this other information you
need to give it so it can rename the file. This is the only bit PHP gets
involved in and it doesn't involve trying to upload 4 gig over a
machanism that was never designed for it.

-Stut

attached mail follows:


> You don't appear to have read what I said. A Java applet can use FTP to
> upload the file - PHP does not get involved in that part. Once the upload
> is complete the applet can POST to your PHP file giving it information
> like where it's put the file and this other information you need to give
> it so it can rename the file. This is the only bit PHP gets involved in
> and it doesn't involve trying to upload 4 gig over a machanism that was
> never designed for it.

Thanks again for replying.

I have read. I have been trying to find out way for last two days.
I can say about jupload and how it seems to work.
It uploads file to server in a temporary directory.
It has postURL parameter. Then it POSTS the data to php file.
Because it POSTS, the php configuration values comes into question.

Here is an example:

Settings in php.ini are 50M for upload_max_fisesize and 50M for
post_max_size.
I used japplet and uploaded a 51.89 MB file.

This is what is in error log.

[08-Jun-2007 03:06:29] PHP Warning: POST Content-Length of 54414946 bytes
exceeds the limit of 52428800 bytes in Unknown on line 0

[08-Jun-2007 03:06:29] PHP Notice: Undefined index: File0 in
E:\projects\ice\post_test.php on line 13

File0 is the first file in $_FILES array, as POST fails I don't get that
array.

I uploaded a 48 MB file and it worked without any problem.

Sukhwinder Singh

----- Original Message -----
From: "Stut" <stuttlegmail.com>
To: "Sukhwinder Singh" <ssrupraihotmail.com>
Cc: <php-generallists.php.net>
Sent: Friday, June 08, 2007 2:10 AM
Subject: Re: [PHP] File Upload - post_max_size and upload_max_filesize in
GBs

> Sukhwinder Singh wrote:
>>>> Even java applets have to hand over the file to some script, in this
>>>> case php and php will get it in $_FILES array it seems (in case of
>>>> japplet). so the problem will remain.
>>>
>>> Not at all true. A Java applet can use FTP to handle the upload and
>>> still pass meta data about the file as an HTTP POST request. There is no
>>> requirement to use HTTP to upload the file from a Java applet.
>>
>> It is not about how data is going to be transferred but it is about php
>> having a limit on what it can accept as POST.
>> But we'll see how it works out. I'll let everyone know.
>> I am trying japplet for now.
>
> You don't appear to have read what I said. A Java applet can use FTP to
> upload the file - PHP does not get involved in that part. Once the upload
> is complete the applet can POST to your PHP file giving it information
> like where it's put the file and this other information you need to give
> it so it can rename the file. This is the only bit PHP gets involved in
> and it doesn't involve trying to upload 4 gig over a machanism that was
> never designed for it.
>
> -Stut
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Sukhwinder Singh dedi ki:
  --8<--

> I have read. I have been trying to find out way for last two days.
> I can say about jupload and how it seems to work.
> It uploads file to server in a temporary directory.
> It has postURL parameter. Then it POSTS the data to php file.
> Because it POSTS, the php configuration values comes into question.
>
> Here is an example:
>
> Settings in php.ini are 50M for upload_max_fisesize and 50M for
> post_max_size.
> I used japplet and uploaded a 51.89 MB file.
>
> This is what is in error log.
>
> [08-Jun-2007 03:06:29] PHP Warning: POST Content-Length of 54414946
> [bytes
> exceeds the limit of 52428800 bytes in Unknown on line 0

Sorry but I couldn't follow. If I understood correctly, there's 50M (or 4G,
for that matter) data, and there's say 5K metadata. First, java applet
uploads the bulk data over ftp to a temp directory on the server
(employing the ftp service running on the server - not apache/php).
If/when the bulk data transfer completes successfully, then the java
applet needs to POST the 5K metadata over http to php. Up to this point I
can follow. But in your example, the java applet transfers the bulk data
itself -not metadata- a second time, POSTing it to php?

If so, then the applet you use (or the parameters it's been passed) should
be broken, I guess.

Kind regards,
--
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

attached mail follows:


> Sorry but I couldn't follow. If I understood correctly, there's 50M (or
> 4G,
> for that matter) data, and there's say 5K metadata. First, java applet
> uploads the bulk data over ftp to a temp directory on the server
> (employing the ftp service running on the server - not apache/php).
> If/when the bulk data transfer completes successfully, then the java
> applet needs to POST the 5K metadata over http to php. Up to this point I
> can follow. But in your example, the java applet transfers the bulk data
> itself -not metadata- a second time, POSTing it to php?

Yes you are right. I seems to post complete data.
Actually I want 4GB uploads as uploads will be local so it is not going to
take so much time.
The example of 50 MB I provided was to prove that applet was actually
POSTing to php and php's post and upload limits came into effect.
I am using JUpload. http://jupload.sourceforge.net/

And it POSTs the data to a php script after it uploads. PHP doesn't seem to
allow more than 1.99999... GB

>
> If so, then the applet you use (or the parameters it's been passed) should
> be broken, I guess.

Any suggestion to use some other applet. Any freeware etc. Or one not so
expensive and which overcomes this php's 1.99 gb limit.

Sukwhinder Singh

----- Original Message -----
From: "Abdullah Ramazanoglu" <ar018yahoo.com>
To: <php-generallists.php.net>
Sent: Friday, June 08, 2007 3:37 AM
Subject: [PHP] Re: File Upload - post_max_size and upload_max_filesize in
GBs

> Sukhwinder Singh dedi ki:
> --8<--
>
>> I have read. I have been trying to find out way for last two days.
>> I can say about jupload and how it seems to work.
>> It uploads file to server in a temporary directory.
>> It has postURL parameter. Then it POSTS the data to php file.
>> Because it POSTS, the php configuration values comes into question.
>>
>> Here is an example:
>>
>> Settings in php.ini are 50M for upload_max_fisesize and 50M for
>> post_max_size.
>> I used japplet and uploaded a 51.89 MB file.
>>
>> This is what is in error log.
>>
>> [08-Jun-2007 03:06:29] PHP Warning: POST Content-Length of 54414946
>> [bytes
>> exceeds the limit of 52428800 bytes in Unknown on line 0
>
> Sorry but I couldn't follow. If I understood correctly, there's 50M (or
> 4G,
> for that matter) data, and there's say 5K metadata. First, java applet
> uploads the bulk data over ftp to a temp directory on the server
> (employing the ftp service running on the server - not apache/php).
> If/when the bulk data transfer completes successfully, then the java
> applet needs to POST the 5K metadata over http to php. Up to this point I
> can follow. But in your example, the java applet transfers the bulk data
> itself -not metadata- a second time, POSTing it to php?
>
> If so, then the applet you use (or the parameters it's been passed) should
> be broken, I guess.
>
> Kind regards,
> --
> Abdullah Ramazanoglu
> aramazan ÄT myrealbox D0T cöm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


rossaztechost.com wrote:
> Hi,
>
> I can make the files now after setting the permission to my images
> folder but I cannot delete the folder or images in it. I have tried
> unlink and rmdir with no success. Even with filezilla cannot delete it
>
>
> The problem seems to be the images that are set to chmod of 600 and
> cannot be changed. I upload the file with this
>
> move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $img_url)
>
> is there a way to set the permissions of the images on upload to
> anything other than 600?
>
> R.
>
>
>
>
> From: "Chris" <dmagickgmail.com>
> To: "blueboy" <rossaztechost.com>
> Cc: <php-generallists.php.net>
> Sent: Thursday, June 07, 2007 12:08 AM
> Subject: Re: [PHP] cannot make directory at remote host
>
>
>> blueboy wrote:
>>> This work localy but not on my remote host. How can I debug it?
>>>
>>> if(!(is_dir('images/$customer_id')))
>>> {
>>> mkdir("images/$customer_id", 0700);
>>>
>>> }
>>>
>>> The file is in the main public_html folder and there is a images folder.
>>
>> First tip - always use full paths instead of local ones so you know
>> *exactly* where it's going.
>>
>> If it goes under the current folder (and I hope you have some basic
>> checking here somewhere for customer_id):
>>
>> $customer_id = (int)$customer_id;
>> if ($customer_id <= 0) {
>> die("Bad customerid!");
>> }
>>
>> $dir = dirname(__FILE__) . '/images/' . $customer_id;
>>
>> if (!is_dir($dir)) {
>> mkdir($dir, 0700);
>> }
>>
>>> What should the permissions be?
>>
>> Depends on the host (whether they are running php in cgi mode or as an
>> apache module).
>>
>> Check if safe-mode is on or off.
>>
>> Check the parent folder to make sure that the webserver user has write
>> & execute access to be able to get into the base folder.
>>
>> display errors and turn error reporting up to work out why it's not
>> working.
>>
>> --
>> Postgresql & php tutorials
>> http://www.designmagick.com/
>>
>
look into umask()

http://us2.php.net/umask

--
Jim Lucas

    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
     by William Shakespeare

attached mail follows:


I was reading the handbook on the topic of Unix process control. The first
thing it says is:

Process Control support in PHP implements the Unix style of process
creation, program execution, signal handling and process termination. Process
Control should not be enabled within a web server environment and unexpected
results may happen if any Process Control functions are used within a web
server environment.

Does this mean that a machine running PHP to handle HTTP requests should not
also use PHP to implement a Unix style process, or does it mean that these
methods should not be called from the CGI
SAPI<http://www.php.net/manual/en/features.commandline.php>
.
My impression is that a given machine should be able to use the Unix process
control functions and handle HTTP requests as long as the Unix process
control functions are invoked strictly from the CLI
SAPI<http://www.php.net/manual/en/features.commandline.php>
.

can somebody clear this up for me?

thanks,

~quickshifin`

attached mail follows:


I was reading the handbook on the topic of Unix process control. The first
thing it says is:

Process Control support in PHP implements the Unix style of process
creation, program execution, signal handling and process termination. Process
Control should not be enabled within a web server environment and unexpected
results may happen if any Process Control functions are used within a web
server environment.

Does this mean that a machine running PHP to handle HTTP requests should not
also use PHP to implement a Unix style process, or does it mean that these
methods should not be called from the CGI
SAPI<http://www.php.net/manual/en/features.commandline.php>
.
My impression is that a given machine should be able to use the Unix process
control functions and handle HTTP requests as long as the Unix process
control functions are invoked strictly from the CLI
SAPI<http://www.php.net/manual/en/features.commandline.php>
.

can somebody clear this up for me?

thanks,

~quickshifin`

attached mail follows:


Nathan Nobbe wrote:
> I was reading the handbook on the topic of Unix process control. The first
> thing it says is:
>
> Process Control support in PHP implements the Unix style of process
> creation, program execution, signal handling and process termination.
> Process
> Control should not be enabled within a web server environment and
> unexpected
> results may happen if any Process Control functions are used within a web
> server environment.
>
> Does this mean that a machine running PHP to handle HTTP requests should
> not
> also use PHP to implement a Unix style process, or does it mean that these
> methods should not be called from the CGI
> SAPI<http://www.php.net/manual/en/features.commandline.php>
> .
> My impression is that a given machine should be able to use the Unix
> process
> control functions and handle HTTP requests as long as the Unix process
> control functions are invoked strictly from the CLI
> SAPI<http://www.php.net/manual/en/features.commandline.php>
> .
>
> can somebody clear this up for me?

It says that within a web server environment you should not use process
control functions. It does not say that on a machine that's running a
web server you should not use process control functions.

A "web server environment" does not mean the entire machine. Hope that
clears it up.

-Stut

attached mail follows:


Greetings. I just want to say thanks for the help over the past couple of
days.

I am trying to get a form to delete a file.

If the file ends in .php, then I want it to unlink from a certain folder.
However, if the file ends in .html or .htm, I want it to unlink from another
folder.

Is there any way to do this?

Thanks,

--
Steve M.

attached mail follows:


On 6/7/07, Steve Marquez <smarquezmarquez-design.com> wrote:
> Greetings. I just want to say thanks for the help over the past couple of
> days.
>
> I am trying to get a form to delete a file.
>
> If the file ends in .php, then I want it to unlink from a certain folder.
> However, if the file ends in .html or .htm, I want it to unlink from another
> folder.
>
> Is there any way to do this?
>
> Thanks,
>
> --
> Steve M.
>

<?
$extension = str_replace('.','',strtolower(strrchr('installer.php',".")));

if($extension == "php") {
    // Do your unlink() routine for PHP here.
} elseif(strstr($extension,"htm")) {
    // Do your unlink() routine for .htm/.html files here.... will
also do .phtml, etc.
}
?>

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


[snip]
> Is there any way to do this?

<?
$extension =
str_replace('.','',strtolower(strrchr('installer.php',".")));

if($extension == "php") {
    // Do your unlink() routine for PHP here.
} elseif(strstr($extension,"htm")) {
    // Do your unlink() routine for .htm/.html files here.... will
also do .phtml, etc.
}
?>
[/snip]

Damn! I sure miss the good old days when I could have answered "yes".
8^{)}

attached mail follows:


On 6/7/07, Steve Marquez <smarquezmarquez-design.com> wrote:
>
> Thank you very much! That worked.
>
> --
> Steve M.
>
>
> on 6/7/07 11:31 AM Daniel Brown (parasanegmail.com) wrote:
>
>
> On 6/7/07, Steve Marquez <smarquezmarquez-design.com> wrote:
> >
> > Is the "installer.php" my form file?
> >
> > --
> > Steve M.
> >
> > on 6/7/07 11:12 AM Daniel Brown (parasanegmail.com) wrote:
> >
> >
> > On 6/7/07, Steve Marquez <smarquezmarquez-design.com> wrote:
> > > Greetings. I just want to say thanks for the help over the past couple
> of
> > > days.
> > >
> > > I am trying to get a form to delete a file.
> > >
> > > If the file ends in .php, then I want it to unlink from a certain
> folder.
> > > However, if the file ends in .html or .htm, I want it to unlink from
> > another
> > > folder.
> > >
> > > Is there any way to do this?
> > >
> > > Thanks,
> > >
> > > --
> > > Steve M.
> > >
> >
> > <?
> > $extension =
> >
> str_replace('.','',strtolower(strrchr('installer.php',".")));
> >
> > if($extension == "php") {
> > // Do your unlink() routine for PHP here.
> > } elseif(strstr($extension,"htm")) {
> > // Do your unlink() routine for .htm/.html files here.... will
> > also do .phtml, etc.
> > }
> > ?>
> >
> >
> >
>
> It's the file for which you want to check the extension. Sorry
> about that.... I typed the code into the email, then figured I should
> test it, and installer.php was the file I was currently writing in my
> Vim window, so I tested it on that.
>
>

    No problemo. Just remember, only .php files will match the first
case, while anything containing `htm` will be included in the second
case (.htm, .html .phtml, .xhtml, et cetera). So you may need to
modify it a bit if you have certain cases where you want to remove all
.html files, for example, but not .phtml (an archaic PHP file
extension).

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


Is there anything special you need to do to utilize these functions? The
former says it's available in versions 4 and 5 while the latter states that
it's available in versions >= 4.3 and 5 (although is deprecated). I'm
currently running PHP version 4.3.11 on a Windows NT box. Based on both
those pieces of information, it seems like I should be able to make use of
these 2 functions. However, whenever I run the script I wrote doing so, I
get the errors

Fatal error: Call to undefined function: mime_content_type()

and

Fatal error: Call to undefined function: filesize()

Why? They are both internal PHP functions and are both available (or should
be available) in the version of PHP that I am running. What's going on?

thnx,
Chris

attached mail follows:


On 6/7/07, Chris Boget <chris.bogetwild.net> wrote:
> Is there anything special you need to do to utilize these functions? The
> former says it's available in versions 4 and 5 while the latter states that
> it's available in versions >= 4.3 and 5 (although is deprecated). I'm
> currently running PHP version 4.3.11 on a Windows NT box. Based on both
> those pieces of information, it seems like I should be able to make use of
> these 2 functions. However, whenever I run the script I wrote doing so, I
> get the errors
>
> Fatal error: Call to undefined function: mime_content_type()
>
> and
>
> Fatal error: Call to undefined function: filesize()
>
> Why? They are both internal PHP functions and are both available (or should
> be available) in the version of PHP that I am running. What's going on?
>
> thnx,
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

    Sounds like a problem with the installation. However, speaking of
deprecated, the mime_content_type() function is deprecated itself.
It's replaced by the PECL extension Fileinfo.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


> Sounds like a problem with the installation.

What could go wrong with an installation on a Windows machine that uses the
binaries? Why would it be only these functions (that I can tell) that would
be missing? Is there somewhere I can go and check (possibly using
phpinfo()) to find out if these functions should be available?

> However, speaking of deprecated, the mime_content_type() function is
> deprecated itself.
> It's replaced by the PECL extension Fileinfo.

Yes, I saw that in the online docs. Unfortunately, we don't have PECL
installed nor could I get it installed any time soon...

thnx,
Chris

attached mail follows:


>> Sounds like a problem with the installation.
> What could go wrong with an installation on a Windows machine that uses
> the binaries? Why would it be only these functions (that I can tell) that
> would be missing? Is there somewhere I can go and check (possibly using
> phpinfo()) to find out if these functions should be available?

basename() works, dirname() works, filetype() works... all functions
seemingly similar enough to, at least in my mind, filesize() such that I
would think that if filesize() is undefined then those other functions would
be undefined too.

thnx,
Chris

attached mail follows:


On 6/7/07, Chris Boget <chris.bogetwild.net> wrote:
> >> Sounds like a problem with the installation.
> > What could go wrong with an installation on a Windows machine that uses
> > the binaries? Why would it be only these functions (that I can tell) that
> > would be missing? Is there somewhere I can go and check (possibly using
> > phpinfo()) to find out if these functions should be available?
>
> basename() works, dirname() works, filetype() works... all functions
> seemingly similar enough to, at least in my mind, filesize() such that I
> would think that if filesize() is undefined then those other functions would
> be undefined too.
>
> thnx,
> Chris
>
>

    Have you uncommented or added `extension=php_mime_magic.dll` in
your php.ini file for mime_content_type()? What about adding
something like this, as well:

[mime_magic]
mime_magic.debug = On
mime_magic.magicfile = "c:\php\extras\magic.mime"

    Do you have anything in the `disable_functions =` area of your php.ini?

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


On 6/7/07, Daniel Brown <parasanegmail.com> wrote:
> On 6/7/07, Chris Boget <chris.bogetwild.net> wrote:
> > >> Sounds like a problem with the installation.
> > > What could go wrong with an installation on a Windows machine that uses
> > > the binaries? Why would it be only these functions (that I can tell) that
> > > would be missing? Is there somewhere I can go and check (possibly using
> > > phpinfo()) to find out if these functions should be available?
> >
> > basename() works, dirname() works, filetype() works... all functions
> > seemingly similar enough to, at least in my mind, filesize() such that I
> > would think that if filesize() is undefined then those other functions would
> > be undefined too.
> >
> > thnx,
> > Chris
> >
> >
>
> Have you uncommented or added `extension=php_mime_magic.dll` in
> your php.ini file for mime_content_type()? What about adding
> something like this, as well:
>
> [mime_magic]
> mime_magic.debug = On
> mime_magic.magicfile = "c:\php\extras\magic.mime"
>
> Do you have anything in the `disable_functions =` area of your php.ini?
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>

    Oh, I also forgot to ask.... what do you get when you use stat()?

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


> Oh, I also forgot to ask.... what do you get when you use stat()?

stat() works, but not if I pass in the actual name of the file. I have to
use fstat() in order to get the proper data. I'll have to check to see if
there are any functions disabled in the php.ini (I don't believe there are
any) but if fstat()/stat() work, I'm at a loss to explain why filesize()
doesn't... :| or, also, why stat() doesn't work when I use a correct
filename.

thnx,
Chris

attached mail follows:


> Have you uncommented or added `extension=php_mime_magic.dll` in
> your php.ini file for mime_content_type()? What about adding
> something like this, as well:

extension=php_mime_magic.dll is commented out in my php.ini. So that
explains why the mime_content_type() isn't working. That's fine. Is this
DLL also responsible for filesize()?

> Do you have anything in the `disable_functions =` area of your php.ini?

No, there are no disabled functions definined in my php.ini.

thnx,
Chris

attached mail follows:


On 6/7/07, Afan Pasalic <afanafan.net> wrote:
> hi,
> this question is already posted thousand times. but, after I tried for 2
> hours to figure it out, I gave up and posted the question here.
> I'm rebuilding one site. php 4.4.4
> as usual, register_globals on, as well as magic_quotes.
> I tried to turn it off using .htaccess but what ever I change in the
> (already existing) file, I would get 500 Internal Server Error
>
> this is content of the .htaccess file:
>
> # -FrontPage-
>
> IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
>
> <Limit GET POST>
> order deny,allow
> deny from all
> allow from all
> </Limit>
> <Limit PUT DELETE>
> order deny,allow
> deny from all
> </Limit>
> AuthName mkl1332
> AuthUserFile /u/web/afan/_vti_pvt/service.pwd
> AuthGroupFile /u/web/afan/_vti_pvt/service.grp
>
> and I tried to add
> php_flag register_globals Off
> and it doesn't work (500 internal server error)
>
> I tried with register_global 0 - same thing.
>
> could you please point me where to look after?
>
> thanks for any help.
>
> -afan
>

Are you sure the rest of your .htaccess file is correct?
And what does your Apache error log show you? there should be an error...

Tijnema

attached mail follows:


Tijnema wrote:
> On 6/7/07, Afan Pasalic <afanafan.net> wrote:
>> hi,
>> this question is already posted thousand times. but, after I tried for 2
>> hours to figure it out, I gave up and posted the question here.
>> I'm rebuilding one site. php 4.4.4
>> as usual, register_globals on, as well as magic_quotes.
>> I tried to turn it off using .htaccess but what ever I change in the
>> (already existing) file, I would get 500 Internal Server Error
>>
>> this is content of the .htaccess file:
>>
>> # -FrontPage-
>>
>> IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
>>
>> <Limit GET POST>
>> order deny,allow
>> deny from all
>> allow from all
>> </Limit>
>> <Limit PUT DELETE>
>> order deny,allow
>> deny from all
>> </Limit>
>> AuthName mkl1332
>> AuthUserFile /u/web/afan/_vti_pvt/service.pwd
>> AuthGroupFile /u/web/afan/_vti_pvt/service.grp
>>
>> and I tried to add
>> php_flag register_globals Off
>> and it doesn't work (500 internal server error)
>>
>> I tried with register_global 0 - same thing.
>>
>> could you please point me where to look after?
>>
>> thanks for any help.
>>
>> -afan
>>
>
> Are you sure the rest of your .htaccess file is correct?
> And what does your Apache error log show you? there should be an error...
>
> Tijnema
The .htaccess file is "original", from hosting company, pre-installed.
I can't access to apache error log.

-afan

attached mail follows:


I've got a script that imports several CSV files via the Load Data File
command.

I need to know if each import query was successful or failed.

 

Is there a way to log the success/failure of each query including how
many rows were inserted?

 

Thanks,
Dave

 

**********************************************************************
HTC Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.
**********************************************************************

attached mail follows:


> I've got a script that imports several CSV files via the Load
> Data File
> command.
>
> I need to know if each import query was successful or failed.
>
>
>
> Is there a way to log the success/failure of each query including how
> many rows were inserted?
>
>
>

I assum you are using MySQL, since you didn't specify. Typically,
mysql_query() will return false if the query failed, and
mysql_affected_rows() will return the number of rows affected.

JM

attached mail follows:


Does file_get_contents() not work with absolute paths? I'm able to
successfully write data to a file that I create dynamically but when I go
back to actually read the contents of the file, nothing seems to work. Not
file_get_contents(), not file(), not fread() and not fgets();

$mydata = 'joebobbriggs';
$filename = 'c:\\temp\\my_file_name.txt';
$resource = fopen( $filename, 'w+' );
fwrite( $resource, $mydata );
fclose( $resource );

echo 'File data: ' . file_get_contents( $filename );

Nothing gets displayed but I see that the file was created and that it has
the data I defined.

What's going on?

thnx,
Chris

attached mail follows:


On Thu, 2007-06-07 at 15:39 -0400, Chris Boget wrote:
> Does file_get_contents() not work with absolute paths? I'm able to
> successfully write data to a file that I create dynamically but when I go
> back to actually read the contents of the file, nothing seems to work. Not
> file_get_contents(), not file(), not fread() and not fgets();
>
> $mydata = 'joebobbriggs';
> $filename = 'c:\\temp\\my_file_name.txt';
> $resource = fopen( $filename, 'w+' );
> fwrite( $resource, $mydata );
> fclose( $resource );
>
> echo 'File data: ' . file_get_contents( $filename );
>
> Nothing gets displayed but I see that the file was created and that it has
> the data I defined.
>
> What's going on?

That's the strangest absolute path I've ever seen... it seems to have
some kind of non-absolute prefix.

This has been a troll >:)

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


>> What's going on?
> That's the strangest absolute path I've ever seen... it seems to have
> some kind of non-absolute prefix.
> This has been a troll >:)

Pardon? I'm not sure what you mean?

thnx,
Chris

attached mail follows:


On Thu, 2007-06-07 at 16:09 -0400, Chris Boget wrote:
> >> What's going on?
> > That's the strangest absolute path I've ever seen... it seems to have
> > some kind of non-absolute prefix.
> > This has been a troll >:)
>
> Pardon? I'm not sure what you mean?

Just jabbing at windows :)

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


Hello,

I am working off my development machine (my home pc) and I just loaded the
php-sdkfolder in my root directory and than ran php-sdk/install.php and got
this message.

INSTALLATION ERROR: One or more required PHP extensions is missing: openssl

I am not sure where to look for a fix.
Thanks in advance

-Tom-

P.S.

I have new system with Win XP
--
View this message in context: http://www.nabble.com/missing-openssl-tf3886077.html#a11015152
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


Hi,
I just posted something like a how-to about making your very own PHP-based
lightweight MVC framework.
Hope you like it:
http://vladev.blogspot.com/2007/06/implementing-your-very-own-lightweight.html

Regards,
Emil Ivanov

attached mail follows:


On Thu, 2007-06-07 at 23:30 +0300, Emil Ivanov wrote:
> Hi,
> I just posted something like a how-to about making your very own PHP-based
> lightweight MVC framework.
> Hope you like it:
> http://vladev.blogspot.com/2007/06/implementing-your-very-own-lightweight.html

Personally, I hate front-end dispatch systems.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


On 6/7/07, Robert Cummings <robertinterjinn.com> wrote:
> On Thu, 2007-06-07 at 16:19 -0400, Daniel Brown wrote:
> > On 6/7/07, Abdullah Ramazanoglu <ar018yahoo.com> wrote:
> >
> > If I'm not completely mistaken, I think that Python can even
> > interface with the GNOME libraries. PHP could theoretically do that,
> > as well, if someone went through and created extensions for it all.
> >
> > PHP is an excellent command-line interpreter, in my opinion. I'd
> > say that, in all of my day-to-day PHP programming, about 60% of the
> > code is for the web, with 35% being run from the command line, and 5%
> > magically disappearing, to loud screams of frustration and broken
> > coffee mugs.
>
> I had one of those little screams yesterday when I started using the
> PHP's id3 lib when I realized it's crap because it can't delete or write
> version 2 tags. Fortunately I found a nice user comment pointing me to
> the PHP implemented getid3 lib. An hour later my mp3 collection (several
> thousand ripped from my own CD collection of course :) had nice ID3 tags
> based on the directories and filenames I had created a few years ago.
>
> Wasn't an issue when I was using XMMS but I just switched to Amarok and
> it makes extensive sensible use of ID3 tags :)
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
>

    Rob,

    Are you using Amarok on Windows, Linux, or other? I have Amarok
1.3.1 on KDE 3.4.2 on Mandriva 2006.0 Community on 2.6.12-12mdksmp on
an i686 Intel(R) Pentium(R) 4 CPU 2.60GHz w/ 1GB RAM on a desk with a
bunch of crap on it, and all it does is crash for me. I use Totem
instead, occasionally using xine for audio, and usually for video
(different subject). Just wondering how stable Amarok is for you.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


On Thu, 2007-06-07 at 16:36 -0400, Daniel Brown wrote:
> On 6/7/07, Robert Cummings <robertinterjinn.com> wrote:
> > On Thu, 2007-06-07 at 16:19 -0400, Daniel Brown wrote:
> >
> > I had one of those little screams yesterday when I started using the
> > PHP's id3 lib when I realized it's crap because it can't delete or write
> > version 2 tags. Fortunately I found a nice user comment pointing me to
> > the PHP implemented getid3 lib. An hour later my mp3 collection (several
> > thousand ripped from my own CD collection of course :) had nice ID3 tags
> > based on the directories and filenames I had created a few years ago.
> >
> > Wasn't an issue when I was using XMMS but I just switched to Amarok and
> > it makes extensive sensible use of ID3 tags :)
> >
> Rob,
>
> Are you using Amarok on Windows, Linux, or other? I have Amarok
> 1.3.1 on KDE 3.4.2 on Mandriva 2006.0 Community on 2.6.12-12mdksmp on
> an i686 Intel(R) Pentium(R) 4 CPU 2.60GHz w/ 1GB RAM on a desk with a
> bunch of crap on it, and all it does is crash for me. I use Totem
> instead, occasionally using xine for audio, and usually for video
> (different subject). Just wondering how stable Amarok is for you.

I'm running Amarok 1.4.3 (using KDE 3.5.5) on Ubuntu 6.10 (I'm actually
a Gnome user). I used Mandrake up till 10.0, I'll never go back. My
desktop is an Athlon 2400 with 2 gigs of memory (though consumption
rarely goes past half gig unless I'm running several VMWare OSes at the
same time). I started using it about 3 days ago, I've had a few crashes,
but mostly when doing something major like re-scanning my collection
(8000+). Had no trouble grabbing covers, creating playlists, editing
100s of tags within Amarok, etc. Only complaint really is that it's pig
slow when switching to or sorting columns on large playlists (well the
whole 8000 heheh).

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


Robert Cummings wrote:
> On Thu, 2007-06-07 at 16:36 -0400, Daniel Brown wrote:
>> Are you using Amarok on Windows, Linux, or other? I have Amarok
>> 1.3.1 on KDE 3.4.2 on Mandriva 2006.0 Community on 2.6.12-12mdksmp on
>> an i686 Intel(R) Pentium(R) 4 CPU 2.60GHz w/ 1GB RAM on a desk with a
>> bunch of crap on it, and all it does is crash for me. I use Totem
>> instead, occasionally using xine for audio, and usually for video
>> (different subject). Just wondering how stable Amarok is for you.
>
> I'm running Amarok 1.4.3 (using KDE 3.5.5) on Ubuntu 6.10 (I'm actually
> a Gnome user). I used Mandrake up till 10.0, I'll never go back. My
> desktop is an Athlon 2400 with 2 gigs of memory (though consumption
> rarely goes past half gig unless I'm running several VMWare OSes at the
> same time). I started using it about 3 days ago, I've had a few crashes,
> but mostly when doing something major like re-scanning my collection
> (8000+). Had no trouble grabbing covers, creating playlists, editing
> 100s of tags within Amarok, etc. Only complaint really is that it's pig
> slow when switching to or sorting columns on large playlists (well the
> whole 8000 heheh).

I'm a Mandriva dev and would have to say that if you've not used it for
a while I think you'll be pleasently surprised these days. It's come a
long, long way since 10.0!

Also the older Amarok run by Daniel is faily unstable (I'm also a bit of
a KDE dev when I get a mo'!) is fairly old and bug ridden. Whatever your
distro, I'd upgrade your Amarok to the latest stable for the best
experience. FWIW, if you add your sources correctly you can just urpmi
your 2006.0 machine to 2007.1 relatively easily. I've done it on several
machines now (a couple of them remotely!).

Col

attached mail follows:


Hi all,

Does PHP happen to have something similar to Perl's File::Tail ->
http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm?

I'm looking to be able to tail a file on the server side and somehow
figure out how to use AJAX to keep the file consistently updated through
to the client.

Any suggestions would be appreciated.

Thanks,

- sf