[PHP] source like smorty.com

2007-06-08 Thread Marco Sottana
anybody knows an open source like smorty.com ?

[PHP] new forum

2007-06-08 Thread Marco Sottana
hi i am builing a new forum about pear .. 
www.myflashxml.it

if anyone want to be a moderator of that forum contact me

msn:
[EMAIL PROTECTED]
my icq:
210139517
my skype:
marco xot

Re: [PHP] new forum

2007-06-08 Thread Tijnema

On 6/8/07, Marco Sottana <[EMAIL PROTECTED]> wrote:

hi i am builing a new forum about pear ..
www.myflashxml.it

if anyone want to be a moderator of that forum contact me

msn:
[EMAIL PROTECTED]
my icq:
210139517
my skype:
marco xot


You're site is incredibly slow...
You host it on your local PC?


From my home IP I get ping results of ~170 ms, from a damn fast server

I get ping results of 60 ms, it should be less than 5ms from the
server, and less than 10ms from my home connection...

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] new forum

2007-06-08 Thread Marco Sottana

my server is on www.register.it

at soon will be faster thanks :)

- Original Message - 
From: "Tijnema" <[EMAIL PROTECTED]>

To: "Marco Sottana" <[EMAIL PROTECTED]>
Cc: 
Sent: Friday, June 08, 2007 11:08 AM
Subject: Re: [PHP] new forum



On 6/8/07, Marco Sottana <[EMAIL PROTECTED]> wrote:

hi i am builing a new forum about pear ..
www.myflashxml.it

if anyone want to be a moderator of that forum contact me

msn:
[EMAIL PROTECTED]
my icq:
210139517
my skype:
marco xot


You're site is incredibly slow...
You host it on your local PC?

From my home IP I get ping results of ~170 ms, from a damn fast server
I get ping results of 60 ms, it should be less than 5ms from the
server, and less than 10ms from my home connection...

Tijnema



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Stut

Sukhwinder Singh wrote:
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.


Ok, I think I see where your confusion is coming from. I'm not 
suggesting that the applet I'm describing already exists - it would be 
something you'd have to write or commission someone to write for you.


Every existing file upload applet I've ever come across uses HTTP POST 
to upload the files, but this is not what you need. It will almost 
certainly have to be a bespoke solution.


Another way you might approach it would be to define a naming convention 
for uploaded files and accept them via normal FTP upload. The user then 
visits your website and fills in a form that will tell your PHP script 
where to find the file as well as giving it the other information it 
needs. Setting up a secure write-only FTP server is well documented on 
the net, but is well beyond the scope of this mailing list.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: File Upload - post_max_size and upload_max_filesiz e in GBs

2007-06-08 Thread Jim Moseby
> 
> 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.
> 
I will again suggest http://radinks.com/upload/ .  It does not use POST to
transfer huge files.

JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] need to alter FROM address when sending with PHP forms

2007-06-08 Thread Jim Moseby
> 
> My company has a RH ES4 web server running apache/2.2.2 and PHP 5.1.4.
> Our PHP programmer has developed quite a few PHP email forms and each
> time an email is sent, the FROM: address is
> [EMAIL PROTECTED] I don't know if this is a PHP
> problem or apache problem (or even a sendmail problem for that matter)
> so I am asking both lists for help. I have tried lookup up apache docs
> and PHP docs to alter the FROM: address to no avail. No matter what I
> and my programmer try in PHP or apache the from address stays coming
> from the user apache runs as @webserver.domain.com (obviously I mean
> the FQDN of the server). We would like to be able to alter the FROM:
> address per form as we should be able to do in PHP. If there is a PHP
> fix for this any help would be appreciated. If this is definitely NOT
> a PHP problem, please let me know and I will move on from there. Thank
> you.


You will need to set the From: header.  I use the awesome phpmailer class
that makes sending complex emails really easy.

http://phpmailer.sourceforge.net/

JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php-cli vs python

2007-06-08 Thread Robert Cummings
On Fri, 2007-06-08 at 13:50 +0800, Man-wai Chang wrote:
> > Micro$oft expressed interest in Python. But I don't know whether it's a 
> > trap or bait... :)
> > 
> 
> I said these because of Foxpro. Micro$oft bought it, improved it. But 
> now that Micro$oft wanan go .NET, Visual Foxpro was discontinued.
> 
> Same thing could happen to Python, since it's not a tool invented, 
> designed and patented by the genes of Micro$oft.

Does Microsoft actually invent anything?

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Sukhwinder Singh

I will again suggest http://radinks.com/upload/ .  It does not use POST to
transfer huge files.


Thanks everyone for replying.

I had a look at that. My problem is that along with uploading file I also 
have to post some other information as well. File names are randomly 
generated. Jupload seems to do the work other than that POST problem. Client 
is asking for web based solution. I cannot ask him to do ftp.


PHP's handling of uploaded files is confusing. I have added logging to the 
script to which jupload posts. Logging suggests that php file is only 
accessed after file is completely uploaded by jupload. I also checked apache 
access logs. Entry in apache log appears only after file is completely 
uploaded.


Another thing that came up with this jupload is that as soon as I hit upload 
button, a file named phpxx.tmp (xx is any number) is created in temporary 
directory and its size starts growing as upload happens.


If applet doesn't post to php even at start then how come the temporary file 
is named phpxx.tmp.


I tried to upload file on internet using jupload and it seems to me script 
is timing out even when I have specified 1 hour as timeout.

set_time_limit(216000);

137 MB upload seemed to time out. and the set_time_limit doesn't seem to 
have any affect.


Now the even if I accept php's 1.99 GB limit. What to do about this timeout? 
Do I have to set it in php.ini? Why woudn't it work through the above 
function?


Stut is suggesting it has to be custom made as this kind of solution doesn't 
seem to already exit. A solution where some applet etc. only passes that 
information to php which is needed to move the file and update the database.


Thanks,
Sukhwinder Singh

- Original Message - 
From: "Jim Moseby" <[EMAIL PROTECTED]>
To: "'Sukhwinder Singh'" <[EMAIL PROTECTED]>; "Abdullah Ramazanoglu" 
<[EMAIL PROTECTED]>

Cc: 
Sent: Friday, June 08, 2007 5:40 PM
Subject: RE: [PHP] Re: File Upload - post_max_size and upload_max_filesize 
in GBs





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.


I will again suggest http://radinks.com/upload/ .  It does not use POST to
transfer huge files.

JM

--
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



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Stut

Sukhwinder Singh wrote:
PHP's handling of uploaded files is confusing. I have added logging to 
the script to which jupload posts. Logging suggests that php file is 
only accessed after file is completely uploaded by jupload. I also 
checked apache access logs. Entry in apache log appears only after file 
is completely uploaded.


Absolutely correct - the data sent with an HTTP POST will be completely 
uploaded before the PHP script is started. Likewise, the entry in the 
apache log will only be done once the request is completed otherwise it 
doesn't know all the information it needs.


Another thing that came up with this jupload is that as soon as I hit 
upload button, a file named phpxx.tmp (xx is any number) is created in 
temporary directory and its size starts growing as upload happens.


If applet doesn't post to php even at start then how come the temporary 
file is named phpxx.tmp.


The applet *does* POST to PHP. However, it has the option to upload to 
an FTP server "the choice of using HTTP, HTTPS or FTP connections 
for your transfer" (from the website).


I tried to upload file on internet using jupload and it seems to me 
script is timing out even when I have specified 1 hour as timeout.

set_time_limit(216000);

137 MB upload seemed to time out. and the set_time_limit doesn't seem to 
have any affect.


Now the even if I accept php's 1.99 GB limit. What to do about this 
timeout? Do I have to set it in php.ini? Why woudn't it work through the 
above function?


The timeout is likely coming from Apache. It has a limits similar to PHP.

Stut is suggesting it has to be custom made as this kind of solution 
doesn't seem to already exit. A solution where some applet etc. only 
passes that information to php which is needed to move the file and 
update the database.


Indeed, that is what I'm suggesting. However, I *do* think the solution 
exists, but I've only ever seen it on specific websites. I've never seen 
a product that can do this sort of thing.


If you don't mind me asking, what are people uploading? 4gig is a lot 
for a single file of any type except maybe DVD images. Is there no way 
the user can upload several (read lots) smaller files instead of one big 
one?


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] source like smorty.com

2007-06-08 Thread Jay Blanchard
[snip]
anybody knows an open source like smorty.com ?
[/snip]

No, but if you hum a few bars

Sourceforge
Freshmeat
Google

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php-cli vs python

2007-06-08 Thread Sancar Saran
On Friday 08 June 2007 16:21:04 Robert Cummings wrote:
> On Fri, 2007-06-08 at 13:50 +0800, Man-wai Chang wrote:
> > > Micro$oft expressed interest in Python. But I don't know whether it's a
> > > trap or bait... :)
> >
> > I said these because of Foxpro. Micro$oft bought it, improved it. But
> > now that Micro$oft wanan go .NET, Visual Foxpro was discontinued.
> >
> > Same thing could happen to Python, since it's not a tool invented,
> > designed and patented by the genes of Micro$oft.
>
> Does Microsoft actually invent anything?
>
> Cheers,
> Rob.

Actually chair throwing invented by M$ invetion and the others "INNOVATION"...

:)

Sancar

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] taking a single payment online

2007-06-08 Thread Ross
Hi,


I have a clinet with a small hotel. I want to send a link to customers 
requesting cash similar to paypal. If there total booking is £320 I want to 
send them a link to pay £32 online. Is there an alternative non-paypal way 
to do this? Other gateways with good PHP based API.

thanks,


R. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php-cli vs python

2007-06-08 Thread Robert Cummings
On Fri, 2007-06-08 at 16:42 +0300, Sancar Saran wrote:
> On Friday 08 June 2007 16:21:04 Robert Cummings wrote:
> > On Fri, 2007-06-08 at 13:50 +0800, Man-wai Chang wrote:
> > > > Micro$oft expressed interest in Python. But I don't know whether it's a
> > > > trap or bait... :)
> > >
> > > I said these because of Foxpro. Micro$oft bought it, improved it. But
> > > now that Micro$oft wanan go .NET, Visual Foxpro was discontinued.
> > >
> > > Same thing could happen to Python, since it's not a tool invented,
> > > designed and patented by the genes of Micro$oft.
> >
> > Does Microsoft actually invent anything?
> >
> > Cheers,
> > Rob.
> 
> Actually chair throwing invented by M$ invetion and the others "INNOVATION"...

That's how you know Steve Ballmer is a wuss. Real men throw cabers >:)

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] checking the aspect ratio of an images

2007-06-08 Thread tedd

At 9:33 AM -0400 6/6/07, Robert Cummings wrote:

On Wed, 2007-06-06 at 12:01 +0100, Richard Davey wrote:

 Hi,

 Wednesday, June 6, 2007, 11:41:19 AM, you wrote:

 > I want to force users to insert landscape rather portrait images. I don't
 > want to be too pedantic about it but they do need to have an 
approximate 4x3

 > aspect ratio.


 > You can't really be 'approximate' when coding.

You certainly can be "approximate" when coding. It's called heuristics
and it's an absolute necessity in many areas of software development.

Cheers,
Rob.


Absolutely, and what about fuzzy logic -- that method is based upon 
"approximate" calculations.


Cheers,

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Sukhwinder Singh

Stut, thank you very much for explaining things and trying to help.

The applet *does* POST to PHP. However, it has the option to upload to an 
FTP server "the choice of using HTTP, HTTPS or FTP connections for 
your transfer" (from the website).


So it seems applet posts complete data to that php file handling script 
(rather php engine),*as soon as upload button is clicked*, rather than 
uploading first and then posting to php. That is the reason for name 
phpxx.tmp of temporary file.


As that seems to be the case; there is no real benefit in using applet (in 
case of http) other than that progress bar which is already supported by php 
5.2


It also seems that php engine only hands over control to php file after the 
file is completely uploaded that is why my custom logging doesn't start as 
soon as upload starts. It only starts when file is already uploaded.



The timeout is likely coming from Apache. It has a limits similar to PHP.


Tested on two servers. Both cases it seems to fail if it takes more than 30 
seconds.

I get an error:
[08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution time of 30 
seconds exceeded in \handle_upload.php on line 2



If you don't mind me asking, what are people uploading? 4gig is a lot for 
a single file of any type except maybe DVD images. Is there no way the 
user can upload several (read lots) smaller files instead of one big one?


It is not people that are uploading things. It is admin, and admin is local 
to server. I won't want to try uploading 4 GB over internet. And yes these 
are dvd files. They are going to be uploaded for streaming. But along with 
uploading of files som other fields also have to be uploaded. Client is 
showing examples like http://www.attachmore.com/Whysubscribe.aspx which 
claim unlimited upload size. I assume they are using custom activex 
controls.


Looks like I have to post that php's upload limit of 1.99 gb to php internal 
mailing list.


Thanks again,
Sukhwinder Singh




. - Original Message - 
From: "Stut" <[EMAIL PROTECTED]>

To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
Cc: "Jim Moseby" <[EMAIL PROTECTED]>; 
Sent: Friday, June 08, 2007 6:42 PM
Subject: Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize 
in GBs




Sukhwinder Singh wrote:
PHP's handling of uploaded files is confusing. I have added logging to 
the script to which jupload posts. Logging suggests that php file is only 
accessed after file is completely uploaded by jupload. I also checked 
apache access logs. Entry in apache log appears only after file is 
completely uploaded.


Absolutely correct - the data sent with an HTTP POST will be completely 
uploaded before the PHP script is started. Likewise, the entry in the 
apache log will only be done once the request is completed otherwise it 
doesn't know all the information it needs.


Another thing that came up with this jupload is that as soon as I hit 
upload button, a file named phpxx.tmp (xx is any number) is created in 
temporary directory and its size starts growing as upload happens.


If applet doesn't post to php even at start then how come the temporary 
file is named phpxx.tmp.


The applet *does* POST to PHP. However, it has the option to upload to an 
FTP server "the choice of using HTTP, HTTPS or FTP connections for 
your transfer" (from the website).


I tried to upload file on internet using jupload and it seems to me 
script is timing out even when I have specified 1 hour as timeout.

set_time_limit(216000);

137 MB upload seemed to time out. and the set_time_limit doesn't seem to 
have any affect.


Now the even if I accept php's 1.99 GB limit. What to do about this 
timeout? Do I have to set it in php.ini? Why woudn't it work through the 
above function?


The timeout is likely coming from Apache. It has a limits similar to PHP.

Stut is suggesting it has to be custom made as this kind of solution 
doesn't seem to already exit. A solution where some applet etc. only 
passes that information to php which is needed to move the file and 
update the database.


Indeed, that is what I'm suggesting. However, I *do* think the solution 
exists, but I've only ever seen it on specific websites. I've never seen a 
product that can do this sort of thing.


If you don't mind me asking, what are people uploading? 4gig is a lot for 
a single file of any type except maybe DVD images. Is there no way the 
user can upload several (read lots) smaller files instead of one big one?


-Stut



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Parse domain from URL

2007-06-08 Thread Brad Fuller
Tijnema wrote:
> On 6/7/07, Brad Fuller <[EMAIL PROTECTED]> wrote:
>> Robin Vickery wrote:
>>> In that case you can't do it just by parsing alone, you need to use
>>> DNS. 
>>> 
>>> >> 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
>>)
>> 
>>[snip]
>> )
>> 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

Actually I need to get the root domain from the URL as a previous step to a
WHOIS query.  You can't do a WHOIS on "www.example.com".  It has to be
"example.com" only.

dig www.example.com  doesn't always give the information I need either.

I think DNS is the way to go, but need to figure out why dns_get_record()
returns an empty "authns" array for some of us but works properly for Robin
and for the example in the manual.  I haven't found anything yet, but I'll
keep searching.

Thanks,

Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] taking a single payment online

2007-06-08 Thread Miles Thompson

Googling for: online payment services
returns a slew of hits, among them
  www.auctionbytes.com/cab/pages/payment*
*based in the UK.

I don't believe you are going to find a "fully automatic" PHP connection for
most of these services.

HTH - Miles
*
*
On 6/8/07, Ross <[EMAIL PROTECTED]> wrote:


Hi,


I have a clinet with a small hotel. I want to send a link to customers
requesting cash similar to paypal. If there total booking is £320 I want
to
send them a link to pay £32 online. Is there an alternative non-paypal way
to do this? Other gateways with good PHP based API.

thanks,


R.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Brad Fuller
Sukhwinder Singh wrote:
> Stut, thank you very much for explaining things and trying to help.
> 
>> The applet *does* POST to PHP. However, it has the option to upload
>> to an FTP server "the choice of using HTTP, HTTPS or FTP
>> connections for your transfer" (from the website).
> 
> So it seems applet posts complete data to that php file
> handling script (rather php engine),*as soon as upload button
> is clicked*, rather than uploading first and then posting to
> php. That is the reason for name phpxx.tmp of temporary file.
> 
> As that seems to be the case; there is no real benefit in
> using applet (in case of http) other than that progress bar
> which is already supported by php
> 5.2
> 
> It also seems that php engine only hands over control to php
> file after the file is completely uploaded that is why my
> custom logging doesn't start as soon as upload starts. It
> only starts when file is already uploaded.
> 
>> The timeout is likely coming from Apache. It has a limits similar to
>> PHP. 
> 
> Tested on two servers. Both cases it seems to fail if it
> takes more than 30 seconds.
> I get an error:
> [08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution
> time of 30 seconds exceeded in \handle_upload.php on line 2
> 
> 
>> If you don't mind me asking, what are people uploading? 4gig is a lot
>> for a single file of any type except maybe DVD images. Is there no
>> way the user can upload several (read lots) smaller files instead of
>> one big one? 
> 
> It is not people that are uploading things. It is admin, and
> admin is local to server. I won't want to try uploading 4 GB
> over internet. And yes these are dvd files. They are going to
> be uploaded for streaming. But along with uploading of files
> som other fields also have to be uploaded. Client is showing
> examples like http://www.attachmore.com/Whysubscribe.aspx
> which claim unlimited upload size. I assume they are using
> custom activex controls.
> 
> Looks like I have to post that php's upload limit of 1.99 gb
> to php internal mailing list.
> 
> Thanks again,
> Sukhwinder Singh
> 
> 
> 
> 
>  . - Original Message -
> From: "Stut" <[EMAIL PROTECTED]>
> To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
> Cc: "Jim Moseby" <[EMAIL PROTECTED]>;
> 
> Sent: Friday, June 08, 2007 6:42 PM
> Subject: Re: [PHP] Re: File Upload - post_max_size and
> upload_max_filesize in GBs 
> 
> 
>> Sukhwinder Singh wrote:
>>> PHP's handling of uploaded files is confusing. I have added logging
>>> to the script to which jupload posts. Logging suggests that php file
>>> is only accessed after file is completely uploaded by jupload. I
>>> also checked apache access logs. Entry in apache log appears only
>>> after file is completely uploaded.
>> 
>> Absolutely correct - the data sent with an HTTP POST will be
>> completely uploaded before the PHP script is started. Likewise, the
>> entry in the apache log will only be done once the request is
>> completed otherwise it doesn't know all the information it needs.
>> 
>>> Another thing that came up with this jupload is that as soon as I
>>> hit upload button, a file named phpxx.tmp (xx is any number) is
>>> created in temporary directory and its size starts growing as
>>> upload happens. 
>>> 
>>> If applet doesn't post to php even at start then how come the
>>> temporary file is named phpxx.tmp.
>> 
>> The applet *does* POST to PHP. However, it has the option to upload
>> to an FTP server "the choice of using HTTP, HTTPS or FTP
>> connections for your transfer" (from the website).
>> 
>>> I tried to upload file on internet using jupload and it seems to me
>>> script is timing out even when I have specified 1 hour as timeout.
>>> set_time_limit(216000); 
>>> 
>>> 137 MB upload seemed to time out. and the set_time_limit doesn't
>>> seem to have any affect. 
>>> 
>>> Now the even if I accept php's 1.99 GB limit. What to do about this
>>> timeout? Do I have to set it in php.ini? Why woudn't it work through
>>> the above function?
>> 
>> The timeout is likely coming from Apache. It has a limits similar to
>> PHP. 
>> 
>>> Stut is suggesting it has to be custom made as this kind of solution
>>> doesn't seem to already exit. A solution where some applet etc. only
>>> passes that information to php which is needed to move the file and
>>> update the database.
>> 
>> Indeed, that is what I'm suggesting. However, I *do* think the
>> solution exists, but I've only ever seen it on specific websites.
>> I've never seen a product that can do this sort of thing.
>> 
>> If you don't mind me asking, what are people uploading? 4gig is a lot
>> for a single file of any type except maybe DVD images. Is there no
>> way the user can upload several (read lots) smaller files instead of
>> one big one? 
>> 
>> -Stut


Have a look at "Filechucker" http://encodable.com/filechucker/

My company purchased this program for a small project; It's quite
inexpensive ($39 USD) and works well.  It's written in perl and does not
post t

Re: [PHP] customer ids

2007-06-08 Thread tedd

At 3:40 PM +0100 6/6/07, blueboy wrote:

Hi,

I want to create random customer ids. I have an auto incremented coulumn but
I would rather have a 6-8 digit/letter id randomly generated  that can be
used as a unique identifier across 3 tables. Does anyone have a algorithm to
generate such a string and can you give the odds against 2 duplicate stings
being generated?

I know this is a strange ask.

R.



What about this:

http://es2.php.net/manual/en/function.uniqid.php

And if you're really concerned about duplication, then check the dB 
each time to see if it's already there -- that's what I do.


Cheers,

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread tedd

At 4:35 PM +0100 6/7/07, Stut wrote:
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


-Stut:

Would the ftp commands (ftp_login, etc.) in php work for this?

Cheers,

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Stut

Brad Fuller wrote:

Have a look at "Filechucker" http://encodable.com/filechucker/

My company purchased this program for a small project; It's quite
inexpensive ($39 USD) and works well.  It's written in perl and does not
post to PHP, and we've used it to upload large files and it seems to handle
them just fine.


The OP might want to take note of this comment on that page...

If you want to upload files larger than 2 gigabytes, then you can't use 
Apache 1.3.x or 2.0.x.  You need to use Apache 2.2.x, as explained on 
the "New Features in Apache 2.2" page:


Large File Support
httpd is now built with support for files larger than 2GB on modern 
32-bit Unix systems.  Support for handling >2GB request bodies has also 
been added.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Stut

tedd wrote:

At 4:35 PM +0100 6/7/07, Stut wrote:
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


-Stut:

Would the ftp commands (ftp_login, etc.) in php work for this?


Unfortunately not, unless every user needing to upload a file is running 
an FTP server.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Stut

Sukhwinder Singh wrote:

Stut, thank you very much for explaining things and trying to help.


That's no problem, it's what I'm here for (I knew there was a reason).

The applet *does* POST to PHP. However, it has the option to upload to 
an FTP server "the choice of using HTTP, HTTPS or FTP connections 
for your transfer" (from the website).


So it seems applet posts complete data to that php file handling script 
(rather php engine),*as soon as upload button is clicked*, rather than 
uploading first and then posting to php. That is the reason for name 
phpxx.tmp of temporary file.


As that seems to be the case; there is no real benefit in using applet 
(in case of http) other than that progress bar which is already 
supported by php 5.2


It also seems that php engine only hands over control to php file after 
the file is completely uploaded that is why my custom logging doesn't 
start as soon as upload starts. It only starts when file is already 
uploaded.


I think you need to read up on how an HTTP POST request works when it's 
handled by PHP because some of what you've written there indicates that 
you don't quite have it. When you hit the upload button the browser 
makes a connection to the server and the PHP engine gets invoked to 
handle the request.


The engine then reads the entire HTTP request, including the file data 
that is being uploaded. That temporary file is created by the PHP engine 
to temporarily store the incoming data. Only when the entire request has 
been read does the PHP engine start running your PHP script.



The timeout is likely coming from Apache. It has a limits similar to PHP.


Tested on two servers. Both cases it seems to fail if it takes more than 
30 seconds.

I get an error:
[08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution time of 30 
seconds exceeded in \handle_upload.php on line 2


That's the PHP timeout kicking in. There is another setting in php.ini 
(I forget what it's called) that tells it how long it is allowed to wait 
for the request to be read, but looking at that error I'm not convinced 
that's what's causing that timeout. It's very difficult to tell without 
seeing your script.


If you don't mind me asking, what are people uploading? 4gig is a lot 
for a single file of any type except maybe DVD images. Is there no way 
the user can upload several (read lots) smaller files instead of one 
big one?


It is not people that are uploading things. It is admin, and admin is 
local to server. I won't want to try uploading 4 GB over internet. And 
yes these are dvd files. They are going to be uploaded for streaming. 
But along with uploading of files som other fields also have to be 
uploaded. Client is showing examples like 
http://www.attachmore.com/Whysubscribe.aspx which claim unlimited upload 
size. I assume they are using custom activex controls.


If you look at the screenshots on that site you will see that they 
install something on your machine that provides the upload capability. 
Look specifically at the screenshot that shows the user right-clicking 
on a file in Windows and selecting to upload it. That's not a 
"web-based" solution, and if your client is pointing to it as such then 
they don't really know what they've talking about (like most clients in 
my experience).


Looks like I have to post that php's upload limit of 1.99 gb to php 
internal mailing list.


Definitely worth doing, but don't be surprised if you get the same reaction.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Robert Cummings
On Fri, 2007-06-08 at 10:53 -0400, tedd wrote:
> At 4:35 PM +0100 6/7/07, Stut wrote:
> >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
> 
> -Stut:
> 
> Would the ftp commands (ftp_login, etc.) in php work for this?

No, those are for initiating an FTP connection from the server on which
PHP is hosted.

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Zoltán Németh
2007. 06. 8, péntek keltezéssel 20.17-kor Sukhwinder Singh ezt írta:
> Stut, thank you very much for explaining things and trying to help.
> 
> > The applet *does* POST to PHP. However, it has the option to upload to an 
> > FTP server "the choice of using HTTP, HTTPS or FTP connections for 
> > your transfer" (from the website).
> 
> So it seems applet posts complete data to that php file handling script 
> (rather php engine),*as soon as upload button is clicked*, rather than 
> uploading first and then posting to php. That is the reason for name 
> phpxx.tmp of temporary file.

The applet you use currently might be doing that, yes. So you should
write another applet, which transfers the file by ftp and posts other
data and file location to php after the file transfer is complete.

I think that's what Stut and others are telling you for a while now...

greets
Zoltán Németh

> 
> As that seems to be the case; there is no real benefit in using applet (in 
> case of http) other than that progress bar which is already supported by php 
> 5.2
> 
> It also seems that php engine only hands over control to php file after the 
> file is completely uploaded that is why my custom logging doesn't start as 
> soon as upload starts. It only starts when file is already uploaded.
> 
> > The timeout is likely coming from Apache. It has a limits similar to PHP.
> 
> Tested on two servers. Both cases it seems to fail if it takes more than 30 
> seconds.
> I get an error:
> [08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution time of 30 
> seconds exceeded in \handle_upload.php on line 2
> 
> 
> > If you don't mind me asking, what are people uploading? 4gig is a lot for 
> > a single file of any type except maybe DVD images. Is there no way the 
> > user can upload several (read lots) smaller files instead of one big one?
> 
> It is not people that are uploading things. It is admin, and admin is local 
> to server. I won't want to try uploading 4 GB over internet. And yes these 
> are dvd files. They are going to be uploaded for streaming. But along with 
> uploading of files som other fields also have to be uploaded. Client is 
> showing examples like http://www.attachmore.com/Whysubscribe.aspx which 
> claim unlimited upload size. I assume they are using custom activex 
> controls.
> 
> Looks like I have to post that php's upload limit of 1.99 gb to php internal 
> mailing list.
> 
> Thanks again,
> Sukhwinder Singh
> 
> 
> 
> 
>  . - Original Message - 
> From: "Stut" <[EMAIL PROTECTED]>
> To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
> Cc: "Jim Moseby" <[EMAIL PROTECTED]>; 
> Sent: Friday, June 08, 2007 6:42 PM
> Subject: Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize 
> in GBs
> 
> 
> > Sukhwinder Singh wrote:
> >> PHP's handling of uploaded files is confusing. I have added logging to 
> >> the script to which jupload posts. Logging suggests that php file is only 
> >> accessed after file is completely uploaded by jupload. I also checked 
> >> apache access logs. Entry in apache log appears only after file is 
> >> completely uploaded.
> >
> > Absolutely correct - the data sent with an HTTP POST will be completely 
> > uploaded before the PHP script is started. Likewise, the entry in the 
> > apache log will only be done once the request is completed otherwise it 
> > doesn't know all the information it needs.
> >
> >> Another thing that came up with this jupload is that as soon as I hit 
> >> upload button, a file named phpxx.tmp (xx is any number) is created in 
> >> temporary directory and its size starts growing as upload happens.
> >>
> >> If applet doesn't post to php even at start then how come the temporary 
> >> file is named phpxx.tmp.
> >
> > The applet *does* POST to PHP. However, it has the option to upload to an 
> > FTP server "the choice of using HTTP, HTTPS or FTP connections for 
> > your transfer" (from the website).
> >
> >> I tried to upload file on internet using jupload and it seems to me 
> >> script is timing out even when I have specified 1 hour as timeout.
> >> set_time_limit(216000);
> >>
> >> 137 MB upload seemed to time out. and the set_time_limit doesn't seem to 
> >> have any affect.
> >>
> >> Now the even if I accept php's 1.99 GB limit. What to do about this 
> >> timeout? Do I have to set it in php.ini? Why woudn't it work through the 
> >> above function?
> >
> > The timeout is likely coming from Apache. It has a limits similar to PHP.
> >
> >> Stut is suggesting it has to be custom made as this kind of solution 
> >> doesn't seem to already exit. A solution where some applet etc. only 
> >> passes that information to php which is needed to move the file and 
> >> update the database.
> >
> > Indeed, that is what I'm suggesting. However, I *do* think the solution 
> > exists, but I've only ever seen it on specific websites. I've never seen a 
> > product that can do this sort of thing.
> >
> > If you don't mind me asking, what are people uplo

Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Sukhwinder Singh
I think you need to read up on how an HTTP POST request works when it's 
handled by PHP because some of what you've written there indicates that 
you don't quite have it. When you hit the upload button the browser makes 
a connection to the server and the PHP engine gets invoked to handle the 
request.
The engine then reads the entire HTTP request, including the file data 
that is being uploaded. That temporary file is created by the PHP engine 
to temporarily store the incoming data. Only when the entire request has 
been read does the PHP engine start running your PHP script.


Yes I didn't know. But I learned by actully experimenting with it and 
discussing on this mailing list.

It is not everyday that you have to deal with such issues.

Sites like these calim that you can use your web browser to upload 10 gb 
files. http://www.sendyourfiles.com/features/?web-mail

But clients forget that they are using some kind of plugins.

That's the PHP timeout kicking in. There is another setting in php.ini (I 
forget what it's called) that tells it how long it is allowed to wait for 
the request to be read, but looking at that error I'm not convinced that's 
what's causing that timeout.


I think what you wanted to write was max_input_time.


It's very difficult to tell without seeing your script.


My script does nothing more than get the file information, move it and 
update the database.


Looks like I have to post that php's upload limit of 1.99 gb to php 
internal mailing list.


Definitely worth doing, but don't be surprised if you get the same 
reaction.


Yes I expect the same response :-). "Don't upload 4 gb files over http"

Thank you very much Stut!

- Original Message - 
From: "Stut" <[EMAIL PROTECTED]>

To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
Cc: "Jim Moseby" <[EMAIL PROTECTED]>; 
Sent: Friday, June 08, 2007 8:01 PM
Subject: Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize 
in GBs




Sukhwinder Singh wrote:

Stut, thank you very much for explaining things and trying to help.


That's no problem, it's what I'm here for (I knew there was a reason).

The applet *does* POST to PHP. However, it has the option to upload to 
an FTP server "the choice of using HTTP, HTTPS or FTP connections 
for your transfer" (from the website).


So it seems applet posts complete data to that php file handling script 
(rather php engine),*as soon as upload button is clicked*, rather than 
uploading first and then posting to php. That is the reason for name 
phpxx.tmp of temporary file.


As that seems to be the case; there is no real benefit in using applet 
(in case of http) other than that progress bar which is already supported 
by php 5.2


It also seems that php engine only hands over control to php file after 
the file is completely uploaded that is why my custom logging doesn't 
start as soon as upload starts. It only starts when file is already 
uploaded.


I think you need to read up on how an HTTP POST request works when it's 
handled by PHP because some of what you've written there indicates that 
you don't quite have it. When you hit the upload button the browser makes 
a connection to the server and the PHP engine gets invoked to handle the 
request.


The engine then reads the entire HTTP request, including the file data 
that is being uploaded. That temporary file is created by the PHP engine 
to temporarily store the incoming data. Only when the entire request has 
been read does the PHP engine start running your PHP script.


The timeout is likely coming from Apache. It has a limits similar to 
PHP.


Tested on two servers. Both cases it seems to fail if it takes more than 
30 seconds.

I get an error:
[08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution time of 30 
seconds exceeded in \handle_upload.php on line 2


That's the PHP timeout kicking in. There is another setting in php.ini (I 
forget what it's called) that tells it how long it is allowed to wait for 
the request to be read, but looking at that error I'm not convinced that's 
what's causing that timeout. It's very difficult to tell without seeing 
your script.


If you don't mind me asking, what are people uploading? 4gig is a lot 
for a single file of any type except maybe DVD images. Is there no way 
the user can upload several (read lots) smaller files instead of one big 
one?


It is not people that are uploading things. It is admin, and admin is 
local to server. I won't want to try uploading 4 GB over internet. And 
yes these are dvd files. They are going to be uploaded for streaming. But 
along with uploading of files som other fields also have to be uploaded. 
Client is showing examples like 
http://www.attachmore.com/Whysubscribe.aspx which claim unlimited upload 
size. I assume they are using custom activex controls.


If you look at the screenshots on that site you will see that they install 
something on your machine that provides the upload capability. Look 
specifically at the screenshot 

Re: [PHP] Re: php-cli vs python

2007-06-08 Thread Crayon Shin Chan
On Friday 08 June 2007 13:50, Man-wai Chang wrote:
> > Micro$oft expressed interest in Python. But I don't know whether it's
> > a trap or bait... :)
>
> I said these because of Foxpro. Micro$oft bought it, improved it. But
> now that Micro$oft wanan go .NET, Visual Foxpro was discontinued.
>
> Same thing could happen to Python, since it's not a tool invented,
> designed and patented by the genes of Micro$oft.

The only thing M$ designed is "obsolescence builtin". But they do have a 
habit of patenting things invented by others.

As with most open source projects it is simply not possible for M$ 
to "buy" them. Sure, they may be able to "buy" or hire the main 
contributors to a particular project and influence which direction it 
takes. But if interested people don't like the direction in which M$ is 
taking the project they can simply fork it. IOW there is no way M$ can 
embrace and extinguish an open source project. This is something that M$ 
has to learn. In the past they were able to destroy _really_ innovative 
products by buying the company and squatting on its technology (ie kill 
off all development and let it die off). For _merely_ innovative 
products, M$ just stole what it needed and if its lawyers couldn't get 
the owners of the stolen technology to back down, they just paid the 
token fine that the courts usually imposed.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Re: php-cli vs python

2007-06-08 Thread Daniel Brown

On 6/8/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:

On Friday 08 June 2007 04:10, Abdullah Ramazanoglu wrote:

> 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?

Yes, it's called PyQT. For purely non-web work Python beats PHP hands
down. Plus it runs on more platforms.

--
Crayon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




   I actually haven't found a platform yet that I couldn't port PHP
to, if it wasn't already native.  We're talking Windows, Linux, BSD,
true *nix, MacOS, SunOS, Amiga, et cetera.  I doubt it would run on my
old Commodore 64 with the 1541 5.25" floppy drive (LOAD "*",8,1), but
you can emulate a C64 in PHP (http://phpc64.extra.hu). ;-P

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Richard Davey
Hi Crayon,

Friday, June 8, 2007, 6:08:30 PM, you wrote:

> On Friday 08 June 2007 22:17, tedd wrote:

>> >>  Wednesday, June 6, 2007, 11:41:19 AM, you wrote:
>> >>  > I want to force users to insert landscape rather portrait images.
>> >>  > I don't want to be too pedantic about it but they do need to have
>> >>  > an
>> >>
>> >>approximate 4x3
>> >>
>> >>  > aspect ratio.
>> >  >
>> >  > You can't really be 'approximate' when coding.
>> >
>> >You certainly can be "approximate" when coding. It's called heuristics
>> >and it's an absolute necessity in many areas of software development.

>> Absolutely, and what about fuzzy logic -- that method is based upon
>> "approximate" calculations.

> But somewhere in the guts of the approximate calculations there are 
> _precisely_ defined limits. Anyhow, please illustrate how you would use
> approximate calculations in determining or defining the aspect ratio of
> an image.

This I'd love to see. Don't hold your breath for a decent code based
response though.

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Crayon Shin Chan
On Friday 08 June 2007 22:17, tedd wrote:

> >>  Wednesday, June 6, 2007, 11:41:19 AM, you wrote:
> >>  > I want to force users to insert landscape rather portrait images.
> >>  > I don't want to be too pedantic about it but they do need to have
> >>  > an
> >>
> >>approximate 4x3
> >>
> >>  > aspect ratio.
> >  >
> >  > You can't really be 'approximate' when coding.
> >
> >You certainly can be "approximate" when coding. It's called heuristics
> >and it's an absolute necessity in many areas of software development.

> Absolutely, and what about fuzzy logic -- that method is based upon
> "approximate" calculations.

But somewhere in the guts of the approximate calculations there are 
_precisely_ defined limits. Anyhow, please illustrate how you would use 
approximate calculations in determining or defining the aspect ratio of 
an image.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php-cli vs python OT

2007-06-08 Thread Daniel Brown

On 6/7/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Thu, 2007-06-07 at 23:33 +0100, Colin Guthrie wrote:
> 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!

I guess I should never say never :) Maybe I'll give it a spin in VMWare
when I have some spare time.

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.  |
`'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




   Yeah, like I've said in other posts, I've been using Mandrive
since before Connectiva got in the mix, and it was Mandrake.  The
first version I jumped on was Mandrake 7.2 (Odyssey) back in 2000,
after jumping off of Redhat 7 (Guinness).  I usually upgrade about
once every year or so, going to 8.1 (Vitamin), 8.2 (Bluebird), and 9.2
(FiveStar), but used FiveStar from 2003 until last year when I made
the huge leap to 2006.0 Community.  Freaking amazing.  So since 2000,
I've been using it at home, in my vehicles, and even used it as a
requirement for hire when a new company wanted to bring me on (which
is from where I'm typing right now, in fact).  I haven't bumped up
versions yet on any of my machines, so 2006.0 is my most recent
installation, and I rarely use it for a production server (though
almost always for my local test and development environments), but as
long as Mandriva keeps everything in the spirit of the original
Mandrakelinux project, I don't see myself jumping ship completely.
I'll add a CentOS server or play with an Ubuntu distro here and there,
but Mandrake will always be home to me.

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Re: php-cli vs python

2007-06-08 Thread Crayon Shin Chan
On Friday 08 June 2007 04:10, Abdullah Ramazanoglu wrote:

> 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?

Yes, it's called PyQT. For purely non-web work Python beats PHP hands 
down. Plus it runs on more platforms.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Re: php-cli vs python

2007-06-08 Thread Crayon Shin Chan
On Saturday 09 June 2007 01:22, Daniel Brown wrote:

> I actually haven't found a platform yet that I couldn't port PHP
> to, if it wasn't already native.  We're talking Windows, Linux, BSD,
> true *nix, MacOS, SunOS, Amiga, et cetera.  I doubt it would run on my
> old Commodore 64 with the 1541 5.25" floppy drive (LOAD "*",8,1), but
> you can emulate a C64 in PHP (http://phpc64.extra.hu). ;-P

Perhaps it would've been better to say "it is _available_ on more 
platforms". No doubt given enough dedication you can probably get both 
Python and PHP to _run_ on most platforms. However as an example, Python 
(albeit an older version) is running happily on Nokia S60 phones, whereas 
AFAIK there are no PHP running on said phones.

Also Python supports all the major GUI bindings whereas PHP only supports 
GTK (AFAIK).

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] high-bit characters

2007-06-08 Thread WeberSites LTD
I'm trying to validate an RSS feed and getting errors about "high-bit
characters".
How can I check if a string contains any high-bit characters?
 
thanks
berber


Re: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Robert Cummings
On Sat, 2007-06-09 at 01:08 +0800, Crayon Shin Chan wrote:
> On Friday 08 June 2007 22:17, tedd wrote:
> 
> > >>  Wednesday, June 6, 2007, 11:41:19 AM, you wrote:
> > >>  > I want to force users to insert landscape rather portrait images.
> > >>  > I don't want to be too pedantic about it but they do need to have
> > >>  > an
> > >>
> > >>approximate 4x3
> > >>
> > >>  > aspect ratio.
> > >  >
> > >  > You can't really be 'approximate' when coding.
> > >
> > >You certainly can be "approximate" when coding. It's called heuristics
> > >and it's an absolute necessity in many areas of software development.
> 
> > Absolutely, and what about fuzzy logic -- that method is based upon
> > "approximate" calculations.
> 
> But somewhere in the guts of the approximate calculations there are 
> _precisely_ defined limits. Anyhow, please illustrate how you would use 
> approximate calculations in determining or defining the aspect ratio of 
> an image.

Precisely defined limits are not the same as precisely defined values. I
might precisely define the amount of entropy on a random value as being
some formula based on the current temperature of my CPU. The formula is
quite precise, but the value is only precisely known after I take the
temperature... and even then it probably doesn't serve me to know it
explicitly unless I'm verifying results. If I then take that random
value and use it to make other decisions then the end result isn't
exactly precise.

Taking this to a world of expansion... everything we do as humans
probably comes down to a precise formula, all our thoughts and all our
actions based on those thoughts. But what isn't so precise, is knowing
all the variables that impose themselves upon the decision making
process at the atomic/sub-atomic level.

As for how this affects the aspect ratio of an image... it doesn't
really, but the person who said that "You can't really be 'approximate'
when coding" didn't exactly confine it to the question about aspect
ratio and an image.

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Richard Davey
Hi Robert,

Friday, June 8, 2007, 7:21:39 PM, you wrote:

> Precisely defined limits are not the same as precisely defined values. I
> might precisely define the amount of entropy on a random value as being
> some formula based on the current temperature of my CPU. The formula is
> quite precise, but the value is only precisely known after I take the
> temperature... and even then it probably doesn't serve me to know it
> explicitly unless I'm verifying results. If I then take that random
> value and use it to make other decisions then the end result isn't
> exactly precise.

The end result isn't "precise", but it will always exist between some
very real and very price possible values, those controlled by the min
and max temp of your CPU.

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Richard Lynch
On Fri, June 8, 2007 8:58 am, Sukhwinder Singh wrote:
> I had a look at that. My problem is that along with uploading file I
> also
> have to post some other information as well. File names are randomly
> generated. Jupload seems to do the work other than that POST problem.
> Client
> is asking for web based solution. I cannot ask him to do ftp.

You are never going to be happy with such large uploads over HTTP, imho.

Nor are your users, for several reasons:
  No way to continue aborted/failed upload, unlike FTP
  Browser timeout completely outside your control
  Too many users will think they have to sit and wait to finish

> PHP's handling of uploaded files is confusing. I have added logging to
> the
> script to which jupload posts. Logging suggests that php file is only
> accessed after file is completely uploaded by jupload. I also checked
> apache
> access logs. Entry in apache log appears only after file is completely
> uploaded.

Sort of...

You'd have to read Apache and PHP sources to see how it all works for
sure, but...

> Another thing that came up with this jupload is that as soon as I hit
> upload
> button, a file named phpxx.tmp (xx is any number) is created in
> temporary
> directory and its size starts growing as upload happens.

It's entirely possible that Apache and PHP conspire to handle the
upload, and do things about the upload, but you won't have any access
in php script to it, most likely, until it's all finished.

That said, check out Rasmus' recent patch to PHP which allows for an
upload progress meter -- It's entirely possible you could glean
something useful from that...

> If applet doesn't post to php even at start then how come the
> temporary file
> is named phpxx.tmp.

It's posting to Apache which is talking to PHP to handle the upload,
but it's a "team" process, and your PHP script has zero access until
it's done.

> I tried to upload file on internet using jupload and it seems to me
> script
> is timing out even when I have specified 1 hour as timeout.
> set_time_limit(216000);

You have to define "timing out" more clearly...

Often-times, a browser will give up, even if the upload is proceeding
normally.  We cannot fix broken web browsers.  No matter how much we'd
like to. :-)

> 137 MB upload seemed to time out. and the set_time_limit doesn't seem
> to
> have any affect.

Then the timeout isn't coming from PHP, but from another source.

Apache may be timing out, a buggy browser may be timing out, the
Internet connection may simply not be stable enough for a sustained
transfer...

> Now the even if I accept php's 1.99 GB limit. What to do about this
> timeout?

A 1.99 G limit is probably file-system based...

> Do I have to set it in php.ini? Why woudn't it work through the above
> function?

You cannot affect file upload in a PHP script, because the upload
occurs (or fails to occur) long before your PHP script begins to run
-- You can only do it in php.ini or in .htaccess

> Stut is suggesting it has to be custom made as this kind of solution
> doesn't
> seem to already exit. A solution where some applet etc. only passes
> that
> information to php which is needed to move the file and update the
> database.

Perhaps you should look at Flikr's application that they implemented
for this purpose, or read "Building Scalable Web Sites" by Cal
Henderson (of Flikr)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Robert Cummings
On Fri, 2007-06-08 at 19:35 +0100, Richard Davey wrote:
> Hi Robert,
> 
> Friday, June 8, 2007, 7:21:39 PM, you wrote:
> 
> > Precisely defined limits are not the same as precisely defined values. I
> > might precisely define the amount of entropy on a random value as being
> > some formula based on the current temperature of my CPU. The formula is
> > quite precise, but the value is only precisely known after I take the
> > temperature... and even then it probably doesn't serve me to know it
> > explicitly unless I'm verifying results. If I then take that random
> > value and use it to make other decisions then the end result isn't
> > exactly precise.
> 
> The end result isn't "precise", but it will always exist between some
> very real and very price possible values, those controlled by the min
> and max temp of your CPU.

... and the resolution at which the temperature can be measured. But we
digress, this is merely a specific example, there are many more metrics
that can be sampled to give an extremely large range of values.

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Richard Lynch
On Fri, June 8, 2007 10:17 am, Sukhwinder Singh wrote:
> Stut, thank you very much for explaining things and trying to help.
>
>> The applet *does* POST to PHP. However, it has the option to upload
>> to an
>> FTP server "the choice of using HTTP, HTTPS or FTP connections
>> for
>> your transfer" (from the website).
>
> So it seems applet posts complete data to that php file handling
> script
> (rather php engine),*as soon as upload button is clicked*, rather than
> uploading first and then posting to php. That is the reason for name
> phpxx.tmp of temporary file.

If it tried to upload and then do a separate POST, then you'd have no
way to connect the two events, as HTTP is stateless.

Or, rather, you'd need to overlay some kind of protocol on top of HTTP
that would maintain the state to tie the upload to the POST.

It's not "impossible" but nobody has bothered to do it because HTTP
file upload works "okay" for normal uses, and if you have ginormous
files, you'll be better off using FTP anyway.

But do feel free to write and release an Open Source solution to this
problem.

> Tested on two servers. Both cases it seems to fail if it takes more
> than 30
> seconds.
> I get an error:
> [08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution time of 30
> seconds exceeded in \handle_upload.php on line 2

That's php timeout message. You have NOT set the tmeout as you think.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Faulting module php4ts.dll

2007-06-08 Thread Chris Boget
We are running PHP 4.3.11 in a Windows Server 2003 environment using 
ApacheSSL v1.3.  Starting just the other day, we starting seeing the 
following error pop up in the windows eventvwr:


"Faulting application Apache.exe, version 0.0.0.0, faulting module 
php4ts.dll, version 4.3.11.11, fault address 0x000c3d28."


I've been searching Google all day and haven't been able to come up with a 
definitive cause (or even better, a solution) as to why this might be 
occuring.  Has anyone else experienced anything like this?  If so, were you 
able to fix it?  If so, how?


thnx,
Chris 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Sukhwinder Singh


- Original Message - 
From: "Richard Lynch" <[EMAIL PROTECTED]>

To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
Cc: "Jim Moseby" <[EMAIL PROTECTED]>; ; 
"Stut" <[EMAIL PROTECTED]>

Sent: Friday, June 08, 2007 11:32 PM
Subject: Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize 
in GBs




On Fri, June 8, 2007 8:58 am, Sukhwinder Singh wrote:

I had a look at that. My problem is that along with uploading file I
also
have to post some other information as well. File names are randomly
generated. Jupload seems to do the work other than that POST problem.
Client
is asking for web based solution. I cannot ask him to do ftp.


You are never going to be happy with such large uploads over HTTP, imho.

Nor are your users, for several reasons:
 No way to continue aborted/failed upload, unlike FTP
 Browser timeout completely outside your control
 Too many users will think they have to sit and wait to finish



Actually only admin will upload files and that to locally. That is why I am 
not worried about wasting 15 minutes to upload it through browser.





PHP's handling of uploaded files is confusing. I have added logging to
the
script to which jupload posts. Logging suggests that php file is only
accessed after file is completely uploaded by jupload. I also checked
apache
access logs. Entry in apache log appears only after file is completely
uploaded.


Sort of...

You'd have to read Apache and PHP sources to see how it all works for
sure, but...



Only if I was a C programmer :-). Not even java programmer anymore.





Another thing that came up with this jupload is that as soon as I hit
upload
button, a file named phpxx.tmp (xx is any number) is created in
temporary
directory and its size starts growing as upload happens.


It's entirely possible that Apache and PHP conspire to handle the
upload, and do things about the upload, but you won't have any access
in php script to it, most likely, until it's all finished.



Yes, that is what is happening.




That said, check out Rasmus' recent patch to PHP which allows for an
upload progress meter -- It's entirely possible you could glean
something useful from that...


I have my own ajax script. which uses php 5.2 to monitor progress. The 
problem is php's limit of around 1.99 GB. You have missed few posts.

http://www.nabble.com/RE:-File-Upload---post_max_size-and-upload_max_filesize-in--GBs-t3884697.html

In my first email I had specified that when I set php limit to 4G it starts 
complaining about maximum post  length (as it becomes negative). It seems to 
store values in integer or something.


Also even apache 2.0 complains about invalid content length when I try to 
post 4 gb file. I have checked logs. May be apache 2.2 solves this problem.






If applet doesn't post to php even at start then how come the
temporary file
is named phpxx.tmp.


It's posting to Apache which is talking to PHP to handle the upload,
but it's a "team" process, and your PHP script has zero access until
it's done.


I tried to upload file on internet using jupload and it seems to me
script
is timing out even when I have specified 1 hour as timeout.
set_time_limit(216000);


You have to define "timing out" more clearly...

Often-times, a browser will give up, even if the upload is proceeding
normally.  We cannot fix broken web browsers.  No matter how much we'd
like to. :-)


137 MB upload seemed to time out. and the set_time_limit doesn't seem
to
have any affect.


Then the timeout isn't coming from PHP, but from another source.

Apache may be timing out, a buggy browser may be timing out, the
Internet connection may simply not be stable enough for a sustained
transfer...


Now the even if I accept php's 1.99 GB limit. What to do about this
timeout?


A 1.99 G limit is probably file-system based...



Not file system. I have tried on linux, windows (NTFS). As I explain above 
about negative numbers of post_max_size.






Do I have to set it in php.ini? Why woudn't it work through the above
function?


You cannot affect file upload in a PHP script, because the upload
occurs (or fails to occur) long before your PHP script begins to run
-- You can only do it in php.ini or in .htaccess


Stut is suggesting it has to be custom made as this kind of solution
doesn't
seem to already exit. A solution where some applet etc. only passes
that
information to php which is needed to move the file and update the
database.


Perhaps you should look at Flikr's application that they implemented
for this purpose, or read "Building Scalable Web Sites" by Cal
Henderson (of Flikr)


Right.





--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Sukhwinder Singh

Tested on two servers. Both cases it seems to fail if it takes more
than 30
seconds.
I get an error:
[08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution time of 30
seconds exceeded in \handle_upload.php on line 2


That's php timeout message. You have NOT set the tmeout as you think.


Yes it is.
I had tried setting it using ini_set and also set_time_limit didn't take 
into consideration any.

ini_set('max_execution_time ', 216000);
set_time_limit(216000);

I had to change in php.ini and it seems to work.

Sukhwinder Singh

- Original Message - 
From: "Richard Lynch" <[EMAIL PROTECTED]>

To: "Sukhwinder Singh" <[EMAIL PROTECTED]>
Cc: "Stut" <[EMAIL PROTECTED]>; "Jim Moseby" <[EMAIL PROTECTED]>; 


Sent: Friday, June 08, 2007 11:39 PM
Subject: Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize 
in GBs




On Fri, June 8, 2007 10:17 am, Sukhwinder Singh wrote:

Stut, thank you very much for explaining things and trying to help.


The applet *does* POST to PHP. However, it has the option to upload
to an
FTP server "the choice of using HTTP, HTTPS or FTP connections
for
your transfer" (from the website).


So it seems applet posts complete data to that php file handling
script
(rather php engine),*as soon as upload button is clicked*, rather than
uploading first and then posting to php. That is the reason for name
phpxx.tmp of temporary file.


If it tried to upload and then do a separate POST, then you'd have no
way to connect the two events, as HTTP is stateless.

Or, rather, you'd need to overlay some kind of protocol on top of HTTP
that would maintain the state to tie the upload to the POST.

It's not "impossible" but nobody has bothered to do it because HTTP
file upload works "okay" for normal uses, and if you have ginormous
files, you'll be better off using FTP anyway.

But do feel free to write and release an Open Source solution to this
problem.


Tested on two servers. Both cases it seems to fail if it takes more
than 30
seconds.
I get an error:
[08-Jun-2007 20:15:06] PHP Fatal error:  Maximum execution time of 30
seconds exceeded in \handle_upload.php on line 2


That's php timeout message. You have NOT set the tmeout as you think.






--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--
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



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Stut

Richard Lynch wrote:

On Fri, June 8, 2007 10:17 am, Sukhwinder Singh wrote:

Stut, thank you very much for explaining things and trying to help.


The applet *does* POST to PHP. However, it has the option to upload
to an
FTP server "the choice of using HTTP, HTTPS or FTP connections
for
your transfer" (from the website).

So it seems applet posts complete data to that php file handling
script
(rather php engine),*as soon as upload button is clicked*, rather than
uploading first and then posting to php. That is the reason for name
phpxx.tmp of temporary file.


If it tried to upload and then do a separate POST, then you'd have no
way to connect the two events, as HTTP is stateless.


The name of the uploaded file is all it would need to connect the two 
events.



Or, rather, you'd need to overlay some kind of protocol on top of HTTP
that would maintain the state to tie the upload to the POST.


If by protocol you mean pass an identifier in the POST to tell it what 
file it relates to, then yes. And that identifier would be the filename.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Faulting module php4ts.dll

2007-06-08 Thread Stut

Chris Boget wrote:
We are running PHP 4.3.11 in a Windows Server 2003 environment using 
ApacheSSL v1.3.  Starting just the other day, we starting seeing the 
following error pop up in the windows eventvwr:


"Faulting application Apache.exe, version 0.0.0.0, faulting module 
php4ts.dll, version 4.3.11.11, fault address 0x000c3d28."


I've been searching Google all day and haven't been able to come up with 
a definitive cause (or even better, a solution) as to why this might be 
occuring.  Has anyone else experienced anything like this?  If so, were 
you able to fix it?  If so, how?


There really is no definitive cause of this type of problem. It 
basically means PHP crashed. To find out why you'll need to work out 
which script is doing it, under what circumstances and debug it.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Faulting module php4ts.dll

2007-06-08 Thread M. Sokolewicz

zerof wrote:

Chris Boget escreveu:
We are running PHP 4.3.11 in a Windows Server 2003 environment using 
ApacheSSL v1.3.  Starting just the other day, we starting seeing the 
following error pop up in the windows eventvwr:


"Faulting application Apache.exe, version 0.0.0.0, faulting module 
php4ts.dll, version 4.3.11.11, fault address 0x000c3d28."


I've been searching Google all day and haven't been able to come up 
with a definitive cause (or even better, a solution) as to why this 
might be occuring.  Has anyone else experienced anything like this?  
If so, were you able to fix it?  If so, how?


thnx,
Chris


Try this:

01 )download the full version (.zip package) of php 4.3.11, unzip it in 
a temporary folder, search into the unpacked folder for: php4ts.dll;


02) make a backup copy of your php4ts.dll, and execute copy/paste this 
new php4ts.dll in the same place.


You've got a fair chance that it won't crash anymore once you upgrade to 
anything newer. 4.3.* is not being maintained anymore, 4.4.* would 
probably fit better for you, though PHP 5.2 would obviously be best if 
you don't have any problems with BC between php 4 and 5.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Faulting module php4ts.dll

2007-06-08 Thread zerof

Chris Boget escreveu:
We are running PHP 4.3.11 in a Windows Server 2003 environment using 
ApacheSSL v1.3.  Starting just the other day, we starting seeing the 
following error pop up in the windows eventvwr:


"Faulting application Apache.exe, version 0.0.0.0, faulting module 
php4ts.dll, version 4.3.11.11, fault address 0x000c3d28."


I've been searching Google all day and haven't been able to come up with 
a definitive cause (or even better, a solution) as to why this might be 
occuring.  Has anyone else experienced anything like this?  If so, were 
you able to fix it?  If so, how?


thnx,
Chris


Try this:

01 )download the full version (.zip package) of php 4.3.11, unzip it in 
a temporary folder, search into the unpacked folder for: php4ts.dll;


02) make a backup copy of your php4ts.dll, and execute copy/paste this 
new php4ts.dll in the same place.


--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
--
Você deve, sempre, consultar uma segunda opinião!
--
Deixe todos saberem se esta informação foi-lhe útil.
--  
You must hear, always, one second opinion! In all cases.
--
Let the people know if this info was useful for you!
--

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Determing Content-type from request header when Apache installed as CGI

2007-06-08 Thread Chris Sommers
I read many notes on apache_request_headers() about simulating this function
when Apache is configured with PHP as a CGI. In looking at the $_SERVER
variable definition, I do not see the Content-Type variable listed. Does
someone know how to extract this in an Apache PHP CGI configuration?

+-+--- +
| Chris Sommers   | web site: www.morningwoodacres.com |
| 6193 La Porte Rd.   | e-mail: [EMAIL PROTECTED] |
| Bangor, CA 95914-9701   | phone:(530) 679-0145   |
| cell ph:  (530) 559-0603| fax:  (530) 679-0434   |
+-++

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[4]: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Richard Davey
Hi Robert,

Friday, June 8, 2007, 7:47:17 PM, you wrote:

> On Fri, 2007-06-08 at 19:35 +0100, Richard Davey wrote:
>> Hi Robert,
>> 
>> Friday, June 8, 2007, 7:21:39 PM, you wrote:
>> 
>> > Precisely defined limits are not the same as precisely defined values. I
>> > might precisely define the amount of entropy on a random value as being
>> > some formula based on the current temperature of my CPU. The formula is
>> > quite precise, but the value is only precisely known after I take the
>> > temperature... and even then it probably doesn't serve me to know it
>> > explicitly unless I'm verifying results. If I then take that random
>> > value and use it to make other decisions then the end result isn't
>> > exactly precise.
>> 
>> The end result isn't "precise", but it will always exist between some
>> very real and very price possible values, those controlled by the min
>> and max temp of your CPU.

> ... and the resolution at which the temperature can be measured. But we
> digress, this is merely a specific example, there are many more metrics
> that can be sampled to give an extremely large range of values.

And I'd wager those values too have precise minimums and maximums. You
can pluck an "approximate" value from between them however you like,
but I'm still waiting for evidence that that value will never lie
between some very tangible limits, and still be of any kind of
real-world value in your code. Due to the very nature and way in which
CPUs work, and the effect this passes up through to any language that
cares sit on it, at the end of the day if the architecture itself
cannot deal with 'approximate' values, anything that happens on the
higher level will always be reduced to a value that exists between two
very solidly set limits. If you don't impose those in your code, what
happens beneath will impose it for you regardless. I'd be happy to
read some papers or code that you feel demonstrates what you're trying
to get across if you have any links.

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Crayon Shin Chan
On Saturday 09 June 2007 02:21, Robert Cummings wrote:

> As for how this affects the aspect ratio of an image... it doesn't
> really, but the person who said that "You can't really be 'approximate'
> when coding" didn't exactly confine it to the question about aspect
> ratio and an image.

Taking that statement literally, it apparent that code has to be precise. 
You cannot have "sort of a while loop here" and "kind of an if statement 
there" :) 

So whilst the algorithm that you use may rely on imprecise (fuzzy) values, 
the way you code that algorithm has to be precise. I think that about 
sums it up.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Corrupts URLs

2007-06-08 Thread Nathan Corvino
I have a php script that gets a url from a GET query parameter.  I have 
been running this script on PHP 5.2.2 on Ubuntu Linux, and everything 
works as expected.  I have just installed PHP 5.2.3 on OS X via 
MacPorts, and the same query parameter url has any single quote 
characters escaped with a backslash when I retrieve it from $_REQUEST.


$url = $_REQUEST['url'];
print($url);

For the Query Parameter:

http://localhost/drones/serp.php?def=planetrealtor.com.xml&url=http%3A%2F%2Fwebapp
s2.planetrealtor.com%2Fidx%2Fpkg_IDX.pr_ListOfIDXProperties%3FsStateID%3DFL%26sRealtorID%3D%26sUserType%3DS%26sTrackNum%3D%26sSear
chType%3D%26sPropertyTypeCode%3DS%26sSQLPreBuiltWhere%3DL.PROPERTY_STATE_ID%2520%3D%2520%27FL%27%2520AND%2520L.NODISPLAY_IDX%2520I
S%2520NULL%2520%2520AND%2520L.NODISPLAY_OWNER%2520IS%2520NULL%2520%2520AND%2520L.VOW_ENABLED_LIST_FIRM_ONLY%2520IS%2520NULL%2520%2
520AND%2520L.STATUS_CODE%2520%3D%2520%27A%27%2520AND%2520L.STATEPROP_ENABLED%2520IS%2520NOT%2520NULL%2520%2520AND%2520%2520L.MLS_I
D%2520IN%2520%28%27flagler%27%2C%27miamimls%27%2C%27spacecoast%27%2C%27staug%27%2C%27neflmlsinc%27%2C%27navarre%27%2C%27sanibel%27
%2C%27sarasota%27%2C%27pensacola%27%2C%27highlands%27%2C%27hernando%27%2C%27franklin%27%2C%27naples%27%2C%27southbrow%27%2C%27indi
an%27%2C%27manatee%27%2C%27baycounty%27%2C%27regional%27%2C%27palmbeach%27%2C%27emerald%27%2C%27citrus%27%2C%27ocala%27%2C%27dixie
%27%2C%27fortlaud%27%2C%27gaines%27%2C%27englewood%27%2C%27westpasco%27%2C%27okee%27%2C%27bonita%27%2C%27capecoral%27%2C%27ftmyers
%27%2C%27venice%27%2C%27talla%27%2C%27chipola%27%2C%27marathon%27%2C%27midfl%27%2C%27miamidade%27%2C%27marco%27%2C%27martin%27%2C%
27puntagorda%27%2C%27keywest%27%2C%27amelia%27%2C%27lakecity%27%2C%27pinellas%27%29%2520AND%2520L.ZIP_CODE%2520IN%2520%28%2734211%
27%29%2520AND%2520L.PROPERTY_TYPE_CODE%2520%3D%2520%27S%27%2520AND%2520L.SALE_PRICE%2520%253E%3D%25200%2520AND%2520L.SALE_PRICE%25
20%253C%3D%2520999%26sSQLPreBuiltOrderBy%3D%26sDisplayPhoto%3DT%26sSearchSource%3DX%26sOnlyCities%3DF%26sRunSearch%3DF%26s
SearchID%3D%26sClientID%3D%26sSavedSearchType%3D%26sLangCode%3DENGLISH%26sSubSystemCode%3D%26nPgNum%3D1%26nNum%3D1 



In Linux becomes:

http://webapps2.planetrealtor.com/idx/pkg_IDX.pr_ListOfIDXProperties?sStateID=FL&sRealtorID=&sUserType=S&sTrackNum=&sSearchType=&sPropertyTypeCode=S&sSQLPreBuiltWhere=L.PROPERTY_STATE_ID%20=%20'FL'%20AND%20L.NODISPLAY_IDX%20IS%20NULL%20%20AND%20L.NODISPLAY_OWNER%20IS%20NULL%20%20AND%20L.VOW_ENABLED_LIST_FIRM_ONLY%20IS%20NULL%20%20AND%20L.STATUS_CODE%20=%20'A'%20AND%20L.STATEPROP_ENABLED%20IS%20NOT%20NULL%20%20AND%20%20L.MLS_ID%20IN%20('flagler','miamimls','spacecoast','staug','neflmlsinc','navarre','sanibel','sarasota','pensacola','highlands','hernando','franklin','naples','southbrow','indian','manatee','baycounty','regional','palmbeach','emerald','citrus','ocala','dixie','fortlaud','gaines','englewood','westpasco','okee','bonita','capecoral','ftmyers','venice','talla','chipola','marathon','midfl','miamidade','marco','martin','puntagorda','keywest','amelia','lakecity','pinellas')%20AND%20L.ZIP_CODE%20IN%20('32714')%20AND%20L.PROPERTY_TYPE_CODE%20=%20'S'%20AND%20L.SALE_PRICE%2
0%3E=%200%20AND%20L.SALE_PRICE%20%3C=%20999&sSQLPreBuiltOrderBy=&sDisplayPhoto=T&sSearchSource=X&sOnlyCities=F&sRunSearch=F&sSearchID=&sClientID=&sSavedSearchType=&sLangCode=ENGLISH&sSubSystemCode=&nPgNum=1&nNum=1

But in OS X becomes:

http://webapps2.planetrealtor.com/idx/pkg_IDX.pr_ListOfIDXProperties?sStateID=FL&sRealtorID=&sUserType=S&sTrackNum=&sSearchType=&sPropertyTypeCode=S&sSQLPreBuiltWhere=L.PROPERTY_STATE_ID%20=%20\'FL\'%20AND%20L.NODISPLAY_IDX%20IS%20NULL%20%20AND%20L.NODISPLAY_OWNER%20IS%20NULL%20%20AND%20L.VOW_ENABLED_LIST_FIRM_ONLY%20IS%20NULL%20%20AND%20L.STATUS_CODE%20=%20\'A\'%20AND%20L.STATEPROP_ENABLED%20IS%20NOT%20NULL%20%20AND%20%20L.MLS_ID%20IN%20(\'flagler\',\'miamimls\',\'spacecoast\',\'staug\',\'neflmlsinc\',\'navarre\',\'sanibel\',\'sarasota\',\'pensacola\',\'highlands\',\'hernando\',\'franklin\',\'naples\',\'southbrow\',\'indian\',\'manatee\',\'baycounty\',\'regional\',\'palmbeach\',\'emerald\',\'citrus\',\'ocala\',\'dixie\',\'fortlaud\',\'gaines\',\'englewood\',\'westpasco\',\'okee\',\'bonita\',\'capecoral\',\'ftmyers\',\'venice\',\'talla\',\'chipola\',\'marathon\',\'midfl\',\'miamidade\',\'marco\',\'martin\',\'puntagorda\',\'keywest\',\'amelia\',\'lakecity\',\'pinellas\')%20AND
%20L.ZIP_CODE%20IN%20(\'32714\')%20AND%20L.PROPERTY_TYPE_CODE%20=%20\'S\'%20AND%20L.SALE_PRICE%20%3E=%200%20AND%20L.SALE_PRICE%20%3C=%20999&sSQLPreBuiltOrderBy=&sDisplayPhoto=T&sSearchSource=X&sOnlyCities=F&sRunSearch=F&sSearchID=&sClientID=&sSavedSearchType=&sLangCode=ENGLISH&sSubSystemCode=&nPgNum=1&nNum=1

As you can see, in OS X the url acquires a the backslashes, which I 
would like to avoid.


I am not much of a PHP programmer at this point--it is a brand new 
language for me, so I don't really now how to investigate this.  Is 
there a PHP configu

Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Jim Lucas

Sukhwinder Singh wrote:
I will again suggest http://radinks.com/upload/ .  It does not use 
POST to

transfer huge files.


Thanks everyone for replying.

I had a look at that. My problem is that along with uploading file I 
also have to post some other information as well. File names are 
randomly generated. Jupload seems to do the work other than that POST 
problem. Client is asking for web based solution. I cannot ask him to do 
ftp.


PHP's handling of uploaded files is confusing. I have added logging to 
the script to which jupload posts. Logging suggests that php file is 
only accessed after file is completely uploaded by jupload. I also 
checked apache access logs. Entry in apache log appears only after file 
is completely uploaded.


Another thing that came up with this jupload is that as soon as I hit 
upload button, a file named phpxx.tmp (xx is any number) is created in 
temporary directory and its size starts growing as upload happens.


If applet doesn't post to php even at start then how come the temporary 
file is named phpxx.tmp.


I tried to upload file on internet using jupload and it seems to me 
script is timing out even when I have specified 1 hour as timeout.

set_time_limit(216000);


The php script that you are posting to does not get parsed until PHP has 
control of the upload.

There for, you cannot override the timeout with uploads.

afaik, you are using the stock php.ini setting while you are uploading.

look here

http://us.php.net/set_time_limit#33462
and this
http://us.php.net/set_time_limit#54765

I think you are running into an Apache time limit, not php



137 MB upload seemed to time out. and the set_time_limit doesn't seem to 
have any affect.


Now the even if I accept php's 1.99 GB limit. What to do about this 
timeout? Do I have to set it in php.ini? Why woudn't it work through the 
above function?


Stut is suggesting it has to be custom made as this kind of solution 
doesn't seem to already exit. A solution where some applet etc. only 
passes that information to php which is needed to move the file and 
update the database.


Thanks,
Sukhwinder Singh

- Original Message - From: "Jim Moseby" <[EMAIL PROTECTED]>
To: "'Sukhwinder Singh'" <[EMAIL PROTECTED]>; "Abdullah Ramazanoglu" 
<[EMAIL PROTECTED]>

Cc: 
Sent: Friday, June 08, 2007 5:40 PM
Subject: RE: [PHP] Re: File Upload - post_max_size and 
upload_max_filesize in GBs





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.

I will again suggest http://radinks.com/upload/ .  It does not use 
POST to

transfer huge files.

JM

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







--
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Robert Cummings
On Sat, 2007-06-09 at 04:55 +0800, Crayon Shin Chan wrote:
> On Saturday 09 June 2007 02:21, Robert Cummings wrote:
> 
> > As for how this affects the aspect ratio of an image... it doesn't
> > really, but the person who said that "You can't really be 'approximate'
> > when coding" didn't exactly confine it to the question about aspect
> > ratio and an image.
> 
> Taking that statement literally, it apparent that code has to be precise. 
> You cannot have "sort of a while loop here" and "kind of an if statement 
> there" :) 
> 
> So whilst the algorithm that you use may rely on imprecise (fuzzy) values, 
> the way you code that algorithm has to be precise. I think that about 
> sums it up.

Thanks for repeating what I already said.

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Corrupts URLs

2007-06-08 Thread Richard Davey
Hi Nathan,

Friday, June 8, 2007, 9:47:22 PM, you wrote:

> I have a php script that gets a url from a GET query parameter.  I have
> been running this script on PHP 5.2.2 on Ubuntu Linux, and everything 
> works as expected.  I have just installed PHP 5.2.3 on OS X via 
> MacPorts, and the same query parameter url has any single quote 
> characters escaped with a backslash when I retrieve it from $_REQUEST.

[snip]

> As you can see, in OS X the url acquires a the backslashes, which I 
> would like to avoid.

> I am not much of a PHP programmer at this point--it is a brand new 
> language for me, so I don't really now how to investigate this.  Is 
> there a PHP configuration option I can look at?

Sure.. look at the magic_quotes_gpc setting:

http://uk.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] source like smorty.com

2007-06-08 Thread Tijnema

On 6/8/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
anybody knows an open source like smorty.com ?
[/snip]

No, but if you hum a few bars

Sourceforge
Freshmeat
Google


Why don't you list the rest of the search engines?
Yahoo! search
Live search


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: high-bit characters

2007-06-08 Thread Abdullah Ramazanoglu
WeberSites LTD dedi ki:

> I'm trying to validate an RSS feed and getting errors about "high-bit
> characters".
> How can I check if a string contains any high-bit characters?

if (preg_match("/[\x80-\xff]/", $string)) {
# high-bit char found
} else {
# no high-bit char
}

-- 
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



RE: [PHP] source like smorty.com

2007-06-08 Thread Jay Blanchard
[snip]
Why don't you list the rest of the search engines?
[/snip]

Because he can search for search engines using that search engine.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] source like smorty.com

2007-06-08 Thread Tijnema

On 6/8/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
Why don't you list the rest of the search engines?
[/snip]

Because he can search for search engines using that search engine.


Oh, you should have noted that ;)




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[4]: [PHP] checking the aspect ratio of an images

2007-06-08 Thread Robert Cummings
On Fri, 2007-06-08 at 21:36 +0100, Richard Davey wrote:
> Hi Robert,
> 
> Friday, June 8, 2007, 7:47:17 PM, you wrote:
> 
> > On Fri, 2007-06-08 at 19:35 +0100, Richard Davey wrote:
> >> Hi Robert,
> >> 
> >> Friday, June 8, 2007, 7:21:39 PM, you wrote:
> >> 
> >> > Precisely defined limits are not the same as precisely defined values. I
> >> > might precisely define the amount of entropy on a random value as being
> >> > some formula based on the current temperature of my CPU. The formula is
> >> > quite precise, but the value is only precisely known after I take the
> >> > temperature... and even then it probably doesn't serve me to know it
> >> > explicitly unless I'm verifying results. If I then take that random
> >> > value and use it to make other decisions then the end result isn't
> >> > exactly precise.
> >> 
> >> The end result isn't "precise", but it will always exist between some
> >> very real and very price possible values, those controlled by the min
> >> and max temp of your CPU.
> 
> > ... and the resolution at which the temperature can be measured. But we
> > digress, this is merely a specific example, there are many more metrics
> > that can be sampled to give an extremely large range of values.
> 
> And I'd wager those values too have precise minimums and maximums. You
> can pluck an "approximate" value from between them however you like,
> but I'm still waiting for evidence that that value will never lie
> between some very tangible limits, and still be of any kind of
> real-world value in your code. Due to the very nature and way in which
> CPUs work, and the effect this passes up through to any language that
> cares sit on it, at the end of the day if the architecture itself
> cannot deal with 'approximate' values, anything that happens on the
> higher level will always be reduced to a value that exists between two
> very solidly set limits. If you don't impose those in your code, what
> happens beneath will impose it for you regardless. I'd be happy to
> read some papers or code that you feel demonstrates what you're trying
> to get across if you have any links.

I never said they wouldn't be tangible precise values, but the
likelihood of you computing the complete set of possible outcomes
approaches zero as more range is added.

The very nature of existence and perception relies on the tangible. We
can imagine infinity but we cannot experience it. Since you can't
experience beyond a certain threshold of possible outcomes, the result
set is no longer tangible to your perceptions.

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.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Removing a row from an Array

2007-06-08 Thread Ken Kixmoeller -- reply to [EMAIL PROTECTED]


On Jun 5, 2007, at 5:20 PM, Richard Lynch wrote:


am I missing something (other than a few brain cells)?


http://php.net/unset

As in, unset($array['goner']);


Yup, that's the one. Thanks to you, too.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php-cli vs python

2007-06-08 Thread Tijnema

On 6/8/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Fri, 2007-06-08 at 13:50 +0800, Man-wai Chang wrote:
> > Micro$oft expressed interest in Python. But I don't know whether it's a
> > trap or bait... :)
> >
>
> I said these because of Foxpro. Micro$oft bought it, improved it. But
> now that Micro$oft wanan go .NET, Visual Foxpro was discontinued.
>
> Same thing could happen to Python, since it's not a tool invented,
> designed and patented by the genes of Micro$oft.

Does Microsoft actually invent anything?

Cheers,
Rob.


Uhm,.. no!

It started with MSDOS, which is actually a copied version from QDOS...
And after that they only copied ideas..

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Richard Lynch
On Fri, June 8, 2007 4:03 pm, Jim Lucas wrote:
> afaik, you are using the stock php.ini setting while you are
> uploading.

This should not be taken to mean that if one changes php.ini, that the
change does not affect file upload -- it definitely does matter...

Not sure Jim meant that Sukhwinder was using stock php.ini, or
everybody, but it's definitely not the case that everybody is, like it
or not -- If that were true, upload_max_filesize would be meaningless.

You CANNOT change the file upload time out with set_time_limit,
however, because the file upload happens BEFORE your PHP script begins
execution.

The time limits affecting file upload can only be set:
  a. in http.conf, for various Apache settings, if any (off-topic)
  b. in php.ini or .htaccess
 b1. you'll need to crank up max_input_time, I think
 b2. max_execution_time for sure
 b3. memory_limit while you are at it, probably

You of course have to crank up upload_max_filesise to way beyond what
you expect for an uploaded file.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] OO Problem / Using Singleton Pattern / Extending mysqli

2007-06-08 Thread Lee PHP

Hi guys,

For the life of me I can't figure this out. I have two classes as follows:

1. Config.php (based on the Singleton pattern; gets/sets properties).
2. Database.php (also based on the Singleton pattern; extends mysqli).

-- BEGIN CLASS CONFIG --
 $line) {
if (ereg("^#", $line) || ereg("^[[:space:]]", 
$line)) {
// Ignore the comments and blank lines.
}

else { // Get properties from the file.
$tokens = explode("=", $line);

self::$INSTANCE->setProperty(trim($tokens[0]), trim($tokens[1]));
}
}   
}   

return self::$INSTANCE;
}

/** Set a property. */
public function setProperty($key, $val) {
$this->properties[$key] = $val;
}

/** Get a property. */
public function getProperty($key) {
return $this->properties[$key];
}

}
?>
-- END CLASS CONFIG --

-- BEGIN CLASS DATABASE --
.
*
* Extends PHP's MySQLi.
*/

require_once("Config.php");

class Database extends mysqli {

private static $CONFIG;
private static $INSTANCE;

public function __construct() {

}

public static function getConnection() {
if(empty(self::$INSTANCE)) {
self::$CONFIG = Config::getInstance(); // ERROR HERE
self::$INSTANCE = new Database();
}

return self::$INSTANCE;
}
}
?>
-- END CLASS DATABASE --

Now, in one of my unit tests, I call `$CONN =
Database::getConnection()` and receive an error message, "Fatal error:
Call to undefined method Config::getinstance() in
C:\xampp\htdocs\rsfs\php\classes\core\Database.php on line 23".

Can anyone tell me why the Database class can't see the Config class?
If it's any use, here's my unit test that's breaking:

-- BEGIN UNIT TESTS --
.
*
* Test class for Database class. */

require_once('../../external/SimpleTest/unit_tester.php');
require_once('../../external/SimpleTest/reporter.php');

require_once('../../classes/sys/Database.php');

class DatabaseTest extends UnitTestCase {

private static $CONN;

public function testConstructor() {
$CONN = Database::getConnection();
}
}

$test = &new DatabaseTest();
$test->run(new HtmlReporter());
?>
-- END UNIT TESTS --

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problems connecting to mysql

2007-06-08 Thread Tom Cruickshank
Hello,
   I was using a FAMP (FreeBSD Apache MySQL PHP) server for some web
development I was doing. Then I had to switch over the php pages to a Linux
box, however, the database is still on FreeBSD. Does that make any
difference?

The reason why I ask is because I keep getting this error.

I use "die ('Could not connect: ' . mysql_error());"
Could not connect: Can't connect to MySQL server on xxx.xxx.xxx.xxx (13).

If I use "die ('Could not connect: ' . mysql_errno());"
Could not connect: 2003

I did some research on error 2003 and it appears that I would see this if
communication access was not established.

However, if I try connecting to the mysql database using the command line
I have no problems.

Mysql -u some_user -p -h xxx.xxx.xxx.xxx

This only started after I started using linux as web server and freebsd as
database.

If there is a more appropriate mailing list to ask this questions, please
feel free to direct me towards it.

Tom


 

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date: 27/04/2007
1:39 PM
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Jim Lucas

Richard Lynch wrote:

On Fri, June 8, 2007 4:03 pm, Jim Lucas wrote:

afaik, you are using the stock php.ini setting while you are
uploading.


This should not be taken to mean that if one changes php.ini, that the
change does not affect file upload -- it definitely does matter...

Not sure Jim meant that Sukhwinder was using stock php.ini, or
everybody, but it's definitely not the case that everybody is, like it
or not -- If that were true, upload_max_filesize would be meaningless.

You CANNOT change the file upload time out with set_time_limit,
however, because the file upload happens BEFORE your PHP script begins
execution.

The time limits affecting file upload can only be set:
  a. in http.conf, for various Apache settings, if any (off-topic)
  b. in php.ini or .htaccess
 b1. you'll need to crank up max_input_time, I think
 b2. max_execution_time for sure
 b3. memory_limit while you are at it, probably

You of course have to crank up upload_max_filesise to way beyond what
you expect for an uploaded file.


Don't forget about other php.ini limiters.

These are all that I think one would have to adjust to make things work.

max_execution_time
max_input_time
memory_limit
post_max_size
file_uploads
upload_max_filesize

Granted, you need to take into account limitations outside of php. ie...

available hard drive space
any possible hard disk quota limit
single file size limit of the OS
file size limit of Apache ( mentioned by another replier )
Apache < 2.x is less than 2g
Apache 2.x is greater than 2g

And there might be more that I am not aware of...

--
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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problems connecting to mysql

2007-06-08 Thread Tijnema

On 6/9/07, Tom Cruickshank <[EMAIL PROTECTED]> wrote:

Hello,
  I was using a FAMP (FreeBSD Apache MySQL PHP) server for some web
development I was doing. Then I had to switch over the php pages to a Linux
box, however, the database is still on FreeBSD. Does that make any
difference?

The reason why I ask is because I keep getting this error.

I use "die ('Could not connect: ' . mysql_error());"
Could not connect: Can't connect to MySQL server on xxx.xxx.xxx.xxx (13).

If I use "die ('Could not connect: ' . mysql_errno());"
Could not connect: 2003

I did some research on error 2003 and it appears that I would see this if
communication access was not established.

However, if I try connecting to the mysql database using the command line
I have no problems.

Mysql -u some_user -p -h xxx.xxx.xxx.xxx

This only started after I started using linux as web server and freebsd as
database.

If there is a more appropriate mailing list to ask this questions, please
feel free to direct me towards it.

Tom


Since the database is on FreeBSD, it's a seperate machine?
This probably means that you're not allowed to connect to the machine
by LAN, but only through localhost, and you should take a look at your
mysql config file on the FreeBSD machine.
Where do you run the command line? on your freeBSD machine or your Linux box?

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Tijnema

On 6/9/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Richard Lynch wrote:
available hard drive space
any possible hard disk quota limit
single file size limit of the OS
file size limit of Apache ( mentioned by another replier )
   Apache < 2.x is less than 2g
   Apache 2.x is greater than 2g


Stut pointed out that it is in > 2.2.x , not 2.x
"If you want to upload files larger than 2 gigabytes, then you can't use
Apache 1.3.x or 2.0.x.  You need to use Apache 2.2.x, as explained on
the "New Features in Apache 2.2" page:

Large File Support
   httpd is now built with support for files larger than 2GB on modern
32-bit Unix systems.  Support for handling >2GB request bodies has also
been added."



Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Sukhwinder Singh
I think the problem occurred as I specified size in php.ini using 4096M or 
4G. Then just now I specified as 4294967294 around 4(GB) and I am getting 
the POSTed values. *Locally, on windows xp* this is working but when I set 
these values as as 4294967294 on Mandriva with php 5.1.6 and Apache/2.2.3. I 
get nothing in post as post_max_size turns negative and it won't allow any 
content greater than negative value.


I am still trying. I Installed Apache 2.2.4 on windows. Now file is being 
uploaded properly but file was still not moved. I had added a check


if ($file_details['size'] > 0) // do moving, update databases


and it was being returned negative. The logged it and $_FILES showed this 
for a 3.28 gb file


Array
(
   [File0] => Array
   (
   [name] => FC-6-i386-DVD.iso
   [type] => application/octet-stream
   [tmp_name] => C:\DOCUME~1\ADMINI~1.COM\LOCALS~1\Temp\php77.tmp
   [error] => 0
   [size] => -769771520
   )

)

I have removed this file size check and file *Uploaded Successfully*.

I haven't changed memory limit at all. Script time out I had to specify in 
php.ini file as one hour. Even though time of around 6 minutes should be 
enough to do the move_uploaded_file and update database but set_time_limit 
had no effect.


Any guess upgrading to php 5.2.1 on mandriva will solve problem as it 
already has apache 2.2.3?


Sukhwinder Singh



- Original Message - 
From: "Jim Lucas" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>
Cc: "Sukhwinder Singh" <[EMAIL PROTECTED]>; "Jim Moseby" 
<[EMAIL PROTECTED]>; ; "Stut" 
<[EMAIL PROTECTED]>

Sent: Saturday, June 09, 2007 3:55 AM
Subject: Re: [PHP] Re: File Upload - post_max_size and upload_max_filesize 
in GBs




Richard Lynch wrote:

On Fri, June 8, 2007 4:03 pm, Jim Lucas wrote:

afaik, you are using the stock php.ini setting while you are
uploading.


This should not be taken to mean that if one changes php.ini, that the
change does not affect file upload -- it definitely does matter...

Not sure Jim meant that Sukhwinder was using stock php.ini, or
everybody, but it's definitely not the case that everybody is, like it
or not -- If that were true, upload_max_filesize would be meaningless.

You CANNOT change the file upload time out with set_time_limit,
however, because the file upload happens BEFORE your PHP script begins
execution.

The time limits affecting file upload can only be set:
  a. in http.conf, for various Apache settings, if any (off-topic)
  b. in php.ini or .htaccess
 b1. you'll need to crank up max_input_time, I think
 b2. max_execution_time for sure
 b3. memory_limit while you are at it, probably

You of course have to crank up upload_max_filesise to way beyond what
you expect for an uploaded file.


Don't forget about other php.ini limiters.

These are all that I think one would have to adjust to make things work.

max_execution_time
max_input_time
memory_limit
post_max_size
file_uploads
upload_max_filesize

Granted, you need to take into account limitations outside of php. ie...

available hard drive space
any possible hard disk quota limit
single file size limit of the OS
file size limit of Apache ( mentioned by another replier )
Apache < 2.x is less than 2g
Apache 2.x is greater than 2g

And there might be more that I am not aware of...



--
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

--
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



RE: [PHP] Problems connecting to mysql

2007-06-08 Thread Tom Cruickshank
It is definitely on a separate machine.

I have host as '%' in the user table in the mysql database.
When I used the command line "mysql -u some_user -p -h xxx.xxx.xxx.xxx
It was in a local and remote setting (ie, done in the linux machine and
freebsd machine). 

If it didn't work via command line, it would give me a starting point to
work on, as of right now, I just don't get it. I'm starting to think
something somewhere is not compatible or configured. But in my opinion it
*should* be possible to connect from a linux to bsd box and vice versa.


Hope this Helps.

Tom

-Original Message-
From: Tijnema [mailto:[EMAIL PROTECTED] 
Sent: June 8, 2007 7:00 PM
To: Tom Cruickshank
Cc: php-general@lists.php.net
Subject: Re: [PHP] Problems connecting to mysql

On 6/9/07, Tom Cruickshank <[EMAIL PROTECTED]> wrote:
> Hello,
>   I was using a FAMP (FreeBSD Apache MySQL PHP) server for some web
> development I was doing. Then I had to switch over the php pages to a
Linux
> box, however, the database is still on FreeBSD. Does that make any
> difference?
>
> The reason why I ask is because I keep getting this error.
>
> I use "die ('Could not connect: ' . mysql_error());"
> Could not connect: Can't connect to MySQL server on xxx.xxx.xxx.xxx (13).
>
> If I use "die ('Could not connect: ' . mysql_errno());"
> Could not connect: 2003
>
> I did some research on error 2003 and it appears that I would see this if
> communication access was not established.
>
> However, if I try connecting to the mysql database using the command line
> I have no problems.
>
> Mysql -u some_user -p -h xxx.xxx.xxx.xxx
>
> This only started after I started using linux as web server and freebsd as
> database.
>
> If there is a more appropriate mailing list to ask this questions, please
> feel free to direct me towards it.
>
> Tom
>
Since the database is on FreeBSD, it's a seperate machine?
This probably means that you're not allowed to connect to the machine
by LAN, but only through localhost, and you should take a look at your
mysql config file on the FreeBSD machine.
Where do you run the command line? on your freeBSD machine or your Linux
box?

Tijnema

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date: 27/04/2007
1:39 PM
 

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date: 27/04/2007
1:39 PM
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP process control

2007-06-08 Thread Richard Lynch
I believe that in CGI or CLI process you'd be okay, as the "fork"
happens in its own process, and can only mess up PHP, which is fairly
safe.

In PHP as Module, you risk thread-safety issues in a big way with any
PHP extensions that aren't thread-safe.

And nobody is 100% sure on any of the extensions (or anything else,
really) being thread-safe or not.

I suspect that in FCGI, you're in the same boat as in PHP Module, and
the documentation hasn't quite caught up to FCGI as a paradigm, but I
could be 100% wrong on that...

On Thu, June 7, 2007 10:45 am, 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
> .
> 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
> .
>
> can somebody clear this up for me?
>
> thanks,
>
> ~quickshifin`
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] missing openssl

2007-06-08 Thread Richard Lynch


On Thu, June 7, 2007 2:55 pm, s2j1j1b0 wrote:
>
>
>
> 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

Google for the error message is always a good idea.

You'll probably find suggestions about editing your php.ini and
un-commenting php_openssl.dll or somesuch.

You'll also find issues regarding not actually having that DLL -- You
*must* get the exact DLL that matches your PHP version.  No other will
do.

IIRC, that DLL also relies on a second or third DLL named [mumble]
[something something something] sea.dll

I don't actually use windows, so don't know, but this is my guess,
based on previous posts here.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file_get_contents

2007-06-08 Thread Richard Lynch
On Thu, June 7, 2007 2:39 pm, Chris Boget wrote:
> Does file_get_contents() not work with absolute paths?

Works for me.

In fact, I try to always use absolute paths so that I don't end up
affecting the totally wrong file.

> 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 );

Perhaps a clearstatcache() here is needed???

I wouldn't expect it to be, but maybe...

> 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.

Can you run it in a second script and get the file contents, without
opening and writing the file first?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] file_get_contents

2007-06-08 Thread Richard Lynch


On Thu, June 7, 2007 3:09 pm, 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?

I think it was a Windows-bashing joke...

But maybe using Linux style pathnames would work...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] logging of sql queries - success/failed

2007-06-08 Thread Richard Lynch
On Thu, June 7, 2007 2:12 pm, Bosky, Dave wrote:
> 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 don't think so, but MAYBE mysql_affected_rows would return that data...

If any of the rows fail, I'd expect the mysql_error() would have some
kind of error message in it, and your result would be === false, I
think.

Another option would be to do a select count(*) before and after, and
subtract the difference.  You could also compare that to the number of
lines in the file, and "know" if it all went okay.

Wrap it all in a transaction, if there's any chance another process
could be adding/deleting rows at the same time.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] filesize() and mime_content_type()

2007-06-08 Thread Richard Lynch


On Thu, June 7, 2007 12:04 pm, Chris Boget wrote:
>>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.

The fact that filesize is "failing" and stat is "failing" when you
give a specific filename suggests to me that your filename is at
fault.

Try things like:

echo file_exists($filename); // if it's there, it should be TRUE

$path = dirname($filename);
$dir = opendir($path) or die("$path is not there\n");
while (($file = readdir($dir)) !== false){
  echo $file, ": ", filesize("$path/$file"), "\n";
}

This will list all the files in the directory -- which may not be the
directory you think you are looking at, ESPECIALLY if you are using
relative directories.

>
> thnx,
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problems connecting to mysql

2007-06-08 Thread Tijnema

On 6/9/07, Tom Cruickshank <[EMAIL PROTECTED]> wrote:

It is definitely on a separate machine.

I have host as '%' in the user table in the mysql database.
When I used the command line "mysql -u some_user -p -h xxx.xxx.xxx.xxx
It was in a local and remote setting (ie, done in the linux machine and
freebsd machine).

If it didn't work via command line, it would give me a starting point to
work on, as of right now, I just don't get it. I'm starting to think
something somewhere is not compatible or configured. But in my opinion it
*should* be possible to connect from a linux to bsd box and vice versa.


Hope this Helps.

Tom


Ok, did you check the logs of Apache if any detailed error is reported?

And what about the logs of your MySQL server on the FreeBSD box?

Oh, and PHP code maybe?

Tijnema



-Original Message-
From: Tijnema [mailto:[EMAIL PROTECTED]
Sent: June 8, 2007 7:00 PM
To: Tom Cruickshank
Cc: php-general@lists.php.net
Subject: Re: [PHP] Problems connecting to mysql

On 6/9/07, Tom Cruickshank <[EMAIL PROTECTED]> wrote:
> Hello,
>   I was using a FAMP (FreeBSD Apache MySQL PHP) server for some web
> development I was doing. Then I had to switch over the php pages to a
Linux
> box, however, the database is still on FreeBSD. Does that make any
> difference?
>
> The reason why I ask is because I keep getting this error.
>
> I use "die ('Could not connect: ' . mysql_error());"
> Could not connect: Can't connect to MySQL server on xxx.xxx.xxx.xxx (13).
>
> If I use "die ('Could not connect: ' . mysql_errno());"
> Could not connect: 2003
>
> I did some research on error 2003 and it appears that I would see this if
> communication access was not established.
>
> However, if I try connecting to the mysql database using the command line
> I have no problems.
>
> Mysql -u some_user -p -h xxx.xxx.xxx.xxx
>
> This only started after I started using linux as web server and freebsd as
> database.
>
> If there is a more appropriate mailing list to ask this questions, please
> feel free to direct me towards it.
>
> Tom
>
Since the database is on FreeBSD, it's a seperate machine?
This probably means that you're not allowed to connect to the machine
by LAN, but only through localhost, and you should take a look at your
mysql config file on the FreeBSD machine.
Where do you run the command line? on your freeBSD machine or your Linux
box?

Tijnema

Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date: 27/04/2007
1:39 PM


Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date: 27/04/2007
1:39 PM





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Patterns

2007-06-08 Thread Richard Lynch


On Thu, June 7, 2007 10:59 am, Steve Marquez 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?

if (isset($_POST['filename')){
  $filename = $_POST['filename'];
  if (preg_match('|^[^/]*\\.php$|', $filename)){
//file ends in .php, unlink it from X
  }
  elseif (preg_match('|^[^/]*\\.html?$|', $filename)){
//file ends in .htm|.html, unlink it from Y
  }
  else{
error_log("Probably hack attempt from $_SERVER[REMOTE_ADDR]");
die("Invalid input");
  }
}


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Richard Lynch
On Thu, June 7, 2007 10:52 am, Jim Moseby 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 think you have to go pretty far back in PHP history (in 'net time)
to find that to be true...

Not 100% sure, mind you, but pretty sure.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Faulting module php4ts.dll

2007-06-08 Thread Richard Lynch
On Fri, June 8, 2007 1:30 pm, Chris Boget wrote:
> We are running PHP 4.3.11 in a Windows Server 2003 environment using
> ApacheSSL v1.3.  Starting just the other day, we starting seeing the
> following error pop up in the windows eventvwr:
>
> "Faulting application Apache.exe, version 0.0.0.0, faulting module
> php4ts.dll, version 4.3.11.11, fault address 0x000c3d28."
>
> I've been searching Google all day and haven't been able to come up
> with a
> definitive cause (or even better, a solution) as to why this might be
> occuring.  Has anyone else experienced anything like this?  If so,
> were you
> able to fix it?  If so, how?
>
> thnx,
> Chris

If it's been running fine for a long time, and just started this, look
to an external cause, such as a recent Windows patch or..

Or, honestly, maybe it's time to just upgrade anyway...

It's even possible that you did an upgrade ages ago when you went to
4.3.11.11, but you didn't re-boot, and a recent re-boot has finally
kicked in your php 4.3.11.11 upgrade, long after you actually THOUGHT
you upgraded. :-v  Done that before...  Always double-check phpinfo()
output after you think you've upgraded.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Determing Content-type from request header when Apache installed as CGI

2007-06-08 Thread Richard Lynch
On Fri, June 8, 2007 2:48 pm, Chris Sommers wrote:
> I read many notes on apache_request_headers() about simulating this
> function
> when Apache is configured with PHP as a CGI. In looking at the
> $_SERVER
> variable definition, I do not see the Content-Type variable listed.
> Does
> someone know how to extract this in an Apache PHP CGI configuration?

A request has a Content-type header?...

I don't think it works like that...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problems connecting to mysql

2007-06-08 Thread Richard Lynch
It's possible that PHP on the Linux box has a different mysql client
driver version than the FreeBSD box...

I would expect a more detailed error message in that base, but maybe
not...

Your command line in Linux could be using yet another different client
version.

Check output from these:

mysql -v

On both boxes in all combinations, and see if the version numbers all
match up.

On Fri, June 8, 2007 5:46 pm, Tom Cruickshank wrote:
> Hello,
>I was using a FAMP (FreeBSD Apache MySQL PHP) server for some web
> development I was doing. Then I had to switch over the php pages to a
> Linux
> box, however, the database is still on FreeBSD. Does that make any
> difference?
>
> The reason why I ask is because I keep getting this error.
>
> I use "die ('Could not connect: ' . mysql_error());"
> Could not connect: Can't connect to MySQL server on xxx.xxx.xxx.xxx
> (13).
>
> If I use "die ('Could not connect: ' . mysql_errno());"
> Could not connect: 2003
>
> I did some research on error 2003 and it appears that I would see this
> if
> communication access was not established.
>
> However, if I try connecting to the mysql database using the command
> line
> I have no problems.
>
> Mysql -u some_user -p -h xxx.xxx.xxx.xxx
>
> This only started after I started using linux as web server and
> freebsd as
> database.
>
> If there is a more appropriate mailing list to ask this questions,
> please
> feel free to direct me towards it.
>
> Tom
>
>
>
>
> Internal Virus Database is out-of-date.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date:
> 27/04/2007
> 1:39 PM
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File Upload - post_max_size and upload_max_filesize in GBs

2007-06-08 Thread Sukhwinder Singh


I think you have to go pretty far back in PHP history (in 'net time)
to find that to be true...

Not 100% sure, mind you, but pretty sure.



I also think that the thing about memory limit is not true these days. I 
have been able to upload 3.28 gb file with memory limit specified as 128 MB. 
I also commened about it earlier but was referred to php manual. The manual 
says that yes, and I head read it myself but didn't increase the memonry and 
it still worked


Sukhwinder Singh

- Original Message - 
From: "Richard Lynch" <[EMAIL PROTECTED]>

To: "Jim Moseby" <[EMAIL PROTECTED]>
Cc: "'Sukhwinder Singh'" <[EMAIL PROTECTED]>; 
Sent: Saturday, June 09, 2007 5:15 AM
Subject: RE: [PHP] File Upload - post_max_size and upload_max_filesize in 
GBs




On Thu, June 7, 2007 10:52 am, Jim Moseby 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 think you have to go pretty far back in PHP history (in 'net time)
to find that to be true...

Not 100% sure, mind you, but pretty sure.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Intercepting fopen, mysql_connect, and similar functions for migration

2007-06-08 Thread Kelly Jones

I'm migrating a website from one server to another, and my file paths
and dbs have changed.

For example /a/b/c/foo.txt on the old machine is at /x/y/z/foo.txt on
the new machine. The MySQL db "foo" on the old machine is "bar" on the
new machine.

Can I intercept fopen() and mysql_connect() so that when PHP does
fopen("/a/b/c/foo.txt"), I magically (using Zend functions or method
overloading or anything else) convert it at runtime to
fopen("/x/y/z/foo.txt").

Same thing so that mysql_connect("foo") becomes mysql_connect("bar").

The code is badly written: doing a search/replace in the code wouldn't
really work. I really want to "hook" fopen()/mysql_connect() and
similar commands so I can tweak their args before they actually
execute. Is there any hope?

Sort of like an LD_PRELOAD for PHP?

--
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP Form isnt emailing me

2007-06-08 Thread Austin C

Hello, I just finished making a PHP contact form for my webite, and I can
run through the whole thing, and get no errors, but it doesnt email me the
form contents.

*Here is th actual form page:*

  Contact
Me
 


   
   
   


Please use this form to contact me:


Name: 
Email Address/Method of Contact: 
Reason for Contact: 
Question
Suggestion
General Comment
Fan Mail
Other

Message: 




*Here is the form page processor:*



Processing your information . . .
  
 
 



 
 
\n";



echo "Collecting information . . . . . . . . . . DONE!";

$mail_sent = @mail($to, $subject, $body, $headers);

echo $mail_sent ? "Sending contact form to webmaster . . . . . . . .
DONE!" : "alert('The mail did not go through')";


echo ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .";

echo "Thank you for contacting us, please expect a reply in anywhere
from 1 to 24 hours. Make sure that our email address, [EMAIL PROTECTED]&
[EMAIL PROTECTED], are not sent to your spam folder.";


include("../footer.php"); ?>

--
Thanks, the webmaster of Galacticneo


[PHP] Re: PHP Form isnt emailing me

2007-06-08 Thread itoctopus
Remove the @ next to the mail function, probably there's a warning 
somewhere. Additionally, are you sure that your mail server is actually 
working?
-- 
itoctopus - http://www.itoctopus.com
""Austin C"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello, I just finished making a PHP contact form for my webite, and I can
> run through the whole thing, and get no errors, but it doesnt email me the
> form contents.
>
> *Here is th actual form page:*
> 
>   Contact
> Me
>  
> 
> 
>
>
>
> 
> 
> Please use this form to contact me:
> 
> 
> Name: 
> Email Address/Method of Contact:  size="30">
> Reason for Contact: 
> Question
> Suggestion
> General Comment
> Fan Mail
> Other
> 
> Message: 
> 
> 
> 
>
> *Here is the form page processor:*
> 
> 
> 
> Processing your information . . .
>   
>  
>  
> 
> 
> 
>  
>  
>  $name = $_POST['name'];
> $email = $_POST['contact'];
> $reason = $_POST['reasonforcontact'];
> $message = $_POST['message1'];
>
> $to = "[EMAIL PROTECTED]";
>
> $subject = "Contact Form Submitted at GWD-Dev";
>
> $body = "Hello Austin,
>
> ".$name." has sent in a contact form at GWD-Dev. The reason he/she
> contacted you was for ".$reason.". Here is the message they submitted with
> their form:
>
>
>
> ".$message."
>
> The contact field of the form contained the following information:
> ".$email."
> Please remember to get back to them ASAP!!";
>
> $headers = "From: ".$name." <".$email.">\n";
>
>
>
> echo "Collecting information . . . . . . . . . . DONE!";
>
> $mail_sent = @mail($to, $subject, $body, $headers);
>
> echo $mail_sent ? "Sending contact form to webmaster . . . . . . . .
> DONE!" : "alert('The mail did not go through')";
>
>
> echo ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
> .
> . . . .";
>
> echo "Thank you for contacting us, please expect a reply in anywhere
> from 1 to 24 hours. Make sure that our email address, 
> [EMAIL PROTECTED]&
> [EMAIL PROTECTED], are not sent to your spam folder.";
>
>
> include("../footer.php"); ?>
>
> -- 
> Thanks, the webmaster of Galacticneo
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Sending mail on OS X

2007-06-08 Thread Christian Cantrell

Hi, all.  I'm sure this question has been asked, but I was not able to
effectively search the forum archives, so I'm having to ask it again.

I'm trying to use the mail function to send email on OS X, but the email
gets rejected by the mail server I'm sending to.  I get messages in
mail.loglike this:

"The IP you're using to send email is not authorized to send email directly
to our servers."

I tried sending mail through another server using the SMTP and smtp_port
settings in my php.ini files, but the settings seem to be ignored (perhaps
they are Windows only?).  Can anyone tell me how I can successfully send
test emails on OS X?

Also, the From header does seem to be getting successfully set.  Is there
anything wrong with this code?

mail('[EMAIL PROTECTED]', 'php test', 'this is the message.\nthis is another
line.', 'From: [EMAIL PROTECTED]'."\n\r");

Thanks,
Christian


Re: [PHP] Sending mail on OS X

2007-06-08 Thread Stut

Christian Cantrell wrote:

Hi, all.  I'm sure this question has been asked, but I was not able to
effectively search the forum archives, so I'm having to ask it again.

I'm trying to use the mail function to send email on OS X, but the email
gets rejected by the mail server I'm sending to.  I get messages in
mail.loglike this:

"The IP you're using to send email is not authorized to send email directly
to our servers."

I tried sending mail through another server using the SMTP and smtp_port
settings in my php.ini files, but the settings seem to be ignored (perhaps
they are Windows only?).  Can anyone tell me how I can successfully send
test emails on OS X?


They are Windows only.


Also, the From header does seem to be getting successfully set.  Is there
anything wrong with this code?

mail('[EMAIL PROTECTED]', 'php test', 'this is the message.\nthis is another
line.', 'From: [EMAIL PROTECTED]'."\n\r");


This is a problem with the destination mail server rejecting mail from 
the machine you're sending it from. It has nothing to do with the 
contents of the email or with PHP. Your best bet is to email 
[EMAIL PROTECTED] (or whatever the real domain you're sending to is) 
and ask them why your IP cannot send mail to their mail server.


-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sending mail on OS X

2007-06-08 Thread Jim Lucas

Christian Cantrell wrote:

Hi, all.  I'm sure this question has been asked, but I was not able to
effectively search the forum archives, so I'm having to ask it again.

I'm trying to use the mail function to send email on OS X, but the email
gets rejected by the mail server I'm sending to.  I get messages in
mail.loglike this:

"The IP you're using to send email is not authorized to send email directly
to our servers."

I tried sending mail through another server using the SMTP and smtp_port
settings in my php.ini files, but the settings seem to be ignored (perhaps
they are Windows only?).  Can anyone tell me how I can successfully send
test emails on OS X?

Also, the From header does seem to be getting successfully set.  Is there
anything wrong with this code?

mail('[EMAIL PROTECTED]', 'php test', 'this is the message.\nthis is another
line.', 'From: [EMAIL PROTECTED]'."\n\r");

Thanks,
Christian



Coming from a mail server admin point of view, this message to me would 
mean that the mail server is using a service like Postini or some other 
3rd party mail filtering system, and mail servers at bar.com are 
allowing mail to come from the relaying servers at the 3rd party mail 
filtering system.


Just a thought.

--
Jim Lucas

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

Unknown

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php