Re: [PHP] A specific(ish) request

2008-08-06 Thread Richard Heyes
> > Anything else I may have missed
>
> A backup script?  :-)

Lol. Point taken. II hink I may have finally got through to 1and1
though, I'm downloading my site now. Fingers crossed.

-- 
Richard Heyes
http://www.phpguru.org

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



[PHP] iconv utf-8 to ucs-2 the endian not same

2008-08-06 Thread kimshell

Greetings!
I used the iconv function translate UTF-8 to UCS-2 format but the endian of 
results not the same between Linux and Windows.
Is there some way to configure and make the OS environment irrelevant to the 
result.

thanks for your help.
:P
--
get along unaided. 



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



Re: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread V S Rawat

On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:


On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat <[EMAIL PROTECTED]> wrote:

I have put the first php script to hello.php file:


 
  PHP Test
 
 
 Hello World'; ?>
 


I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b

http://localhost/ is E:\wamp\www

I put the hello.php file to E:\wamp\www. drag/dropping it to browser
shows the above source code in ff3/ie6

putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
to browser shows the same source code.

However, putting it to E:\wamp\www\php_ex but giving
http://localhost/hello.php shows a blank screen

I have forgotten some situation where it had appeared as

Hello World

'; ?>

on the browser.

E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
LoadModule php5_module "e:/wamp/bin/php/php5.2.6/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

On double clicking the php file in windows explorer, it opens in notepad
for edit, instead of getting opened in firefox that is my default.

Please give me the starting push.
-- V




If you simply drag-and-drop the file from an explorer window into
Firefox, Firefox will display the page directly from the file system
instead of serving it through your web server. (You can tell this
because your address bar will say file:///E:/wamp/www/hello.php.) Your
browser won't parse the PHP as script; it will just think it is
malformed HTML and it would show the output you listed above.
Double-clicking the file, or dragging it into IE will try to open the
file with whatever program is associated with that extension in
Windows. (If there isn't a file association for *.php files, it will
either prompt you for a program to handle the file or it might do the
same as Firefox. I'm not sure, and I'm not really interested in
changing my file associations to test.)

IF the file is located at E:\wamp\www\hello.php AND PHP is configured
correctly AND your web server's document root is E:\wamp\www\, THEN
opening http://localhost/hello.php should work.

Andrew


Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a 
blank screen. What has gone wrong?


--
V

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



RE: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread Chetan Rane
Hi

You need to check if your Apache is up and running do the following

Right click on My Computer and select "manage"
Next click on Services and Applications
After that Click on Services

And check if Apache is running



Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 2:53 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:

> On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat <[EMAIL PROTECTED]> wrote:
>> I have put the first php script to hello.php file:
>>
>> 
>>  
>>   PHP Test
>>  
>>  
>>  Hello World'; ?>
>>  
>> 
>>
>> I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b
>>
>> http://localhost/ is E:\wamp\www
>>
>> I put the hello.php file to E:\wamp\www. drag/dropping it to browser
>> shows the above source code in ff3/ie6
>>
>> putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
>> to browser shows the same source code.
>>
>> However, putting it to E:\wamp\www\php_ex but giving
>> http://localhost/hello.php shows a blank screen
>>
>> I have forgotten some situation where it had appeared as
>>
>> Hello World
>>
>> '; ?>
>>
>> on the browser.
>>
>> E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
>> LoadModule php5_module "e:/wamp/bin/php/php5.2.6/php5apache2_2.dll"
>> AddType application/x-httpd-php .php
>> AddType application/x-httpd-php .php3
>>
>> On double clicking the php file in windows explorer, it opens in notepad
>> for edit, instead of getting opened in firefox that is my default.
>>
>> Please give me the starting push.
>> -- V
>>
> 
> 
> If you simply drag-and-drop the file from an explorer window into
> Firefox, Firefox will display the page directly from the file system
> instead of serving it through your web server. (You can tell this
> because your address bar will say file:///E:/wamp/www/hello.php.) Your
> browser won't parse the PHP as script; it will just think it is
> malformed HTML and it would show the output you listed above.
> Double-clicking the file, or dragging it into IE will try to open the
> file with whatever program is associated with that extension in
> Windows. (If there isn't a file association for *.php files, it will
> either prompt you for a program to handle the file or it might do the
> same as Firefox. I'm not sure, and I'm not really interested in
> changing my file associations to test.)
> 
> IF the file is located at E:\wamp\www\hello.php AND PHP is configured
> correctly AND your web server's document root is E:\wamp\www\, THEN
> opening http://localhost/hello.php should work.
> 
> Andrew

Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a 
blank screen. What has gone wrong?

-- 
V

-- 
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] A specific(ish) request

2008-08-06 Thread Richard Heyes
Hi,

Well, seems I may have my site after all, so it's just a case of
getting it up and running. My sincere thanks to those who have helped.

-- 
Richard Heyes
http://www.phpguru.org

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



Re: [PHP] A specific(ish) request

2008-08-06 Thread Per Jessen
Richard Heyes wrote:

> Hi,
> 
> Well, seems I may have my site after all, so it's just a case of
> getting it up and running. My sincere thanks to those who have helped.
> 

Ah, that's better.  Good stuff, Richard.  Now, about that
backup-script ... 


/Per Jessen, Zürich


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



Re: [PHP] A specific(ish) request

2008-08-06 Thread Richard Heyes
> Now, about that
> backup-script ...

Yes, think I may be getting me one of those... :-)

-- 
Richard Heyes
http://www.phpguru.org

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



RE: [PHP] Re: An appeal to your better nature

2008-08-06 Thread Chris Haensel


-Original Message-
From: Daniel Brown [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 06, 2008 1:34 AM
To: Ross McKay
Cc: php-general@lists.php.net
Subject: Re: [PHP] Re: An appeal to your better nature

On Tue, Aug 5, 2008 at 7:28 PM, Ross McKay <[EMAIL PROTECTED]> wrote:
>
> Problems I see with the above:
>
> * good IT professionals use version control AND take backups
> * good IT professionals work on dev servers and migrate to test, prod
> * good IT professionals don't tend to claim "guru" status themselves :)

Addendum:

* Good IT professionals don't usually criticize one another in a
public forum in the above manner, if nothing else than out of
professional courtesy.

--

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

ROFL

I never thought someone seriously would go the whole way from dev, test and
prod servers AND use all the version control stuff.

Honestly: I use dev servers and two backup servers for our company website,
but having  a version control system and everything would, in my opinion,
really make this whole being a developer some kind of ... ugh. Might be good
to do, I don't know. Never tried, and probably never will. And being a "good
IT professional" to me means: know what you're doing, and take the hits you
get. Lost your data? Well, there is a hit to take. But pointing fingers has
never helped anybody.

2 Cents from germany

Chris



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



[PHP] being professional about IT. (was: An appeal to your better nature)

2008-08-06 Thread Per Jessen
Chris Haensel wrote:

> I never thought someone seriously would go the whole way from dev,
> test and prod servers AND use all the version control stuff.

Oh, it's done quite a lot, I can assure you. 

> And being a "good IT professional" to me means: know what 
> you're doing, and take the hits you get. 

When the hits become expensive, your thinking will change.  If every
hour of downtime is EUR100K lost, you don't take the hits you get, you
make sure you don't get hit :-)


/Per Jessen, Zürich


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



RE: [PHP] being professional about IT. (was: An appeal to your better nature)

2008-08-06 Thread Chris Haensel

Chris Haensel wrote:

> I never thought someone seriously would go the whole way from dev,
> test and prod servers AND use all the version control stuff.

Oh, it's done quite a lot, I can assure you.

> And being a "good IT professional" to me means: know what
> you're doing, and take the hits you get.

When the hits become expensive, your thinking will change.  If every
hour of downtime is EUR100K lost, you don't take the hits you get, you
make sure you don't get hit :-)


/Per Jessen, Zürich

Okay, that is a point I can take :o)



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



[PHP] make fails - PHP 5.2.6

2008-08-06 Thread Rees, Chris
Environment

 

AIX 5.3

PHP 5.2.6

 

I'm trying to install PHP (1st time user so bear with me). Here is what
I've done

 

tar -xvf php-5.2.6.tar

cd php-5.2.6

../configure -with-apx2=/usr/local/apache2/bin/apxs

make

 

The make fails after a short time with

 

/bin/sh /home/mmscxr/php-5.2.6/libtool --silent --preserve-dup-deps
--mode=compile cc -Iext/date/lib -Iext/date/
-I/home/mmscxr/php-5.2.6/ext/date/ -DPHP_ATOM_INC
-I/home/mmscxr/php-5.2.6/include -I/home/mmscxr/php-5.2.6/main
-I/home/mmscxr/php-5.2.6 -I/opt/freeware/include/libxml2
-I/home/mmscxr/php-5.2.6/ext/date/lib -I/home/mmscxr/php-5.2.6/TSRM
-I/home/mmscxr/php-5.2.6/Zend-I/usr/include -g  -c
/home/mmscxr/php-5.2.6/ext/date/php_date.c -o ext/date/php_date.lo

"/home/mmscxr/php-5.2.6/ext/date/php_date.c", line 272.37: 1506-046 (S)
Syntax error.

 

I've certainly not changed anything.


Has anyone else seen this ?

Can anyone help??

 

Thanks

 

 

 

 


*
This email is intended solely for the use of the individual to whom
it is addressed and may contain confidential and/or privileged 
material.  Any views or opinions presented are solely those of the 
author and do not necessarily represent those of AGCO.
If you are not the intended recipient, be advised that you have
received this email in error and that any use, dissemination, 
forwarding, printing or copying of this email is strictly prohibited.
 
Neither AGCO nor the sender accepts any responsibility for viruses and it is 
your
responsibility to scan and virus check the e-mail and its attachment(s) (if 
any).
*
AGCO Limited, a limited company, registered in England (registered no.509133) 
with its registered office at Abbey Park Stoneleigh, Kenilworth CV8 2TQ, 
England.



RE: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread Chetan Rane
Can you please check what the Document Root in http.conf

Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 7:22 PM
To: Chetan Rane
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 4:20 PM India Time, _Chetan Rane_ wrote:

> Hi
> 
> You need to check if your Apache is up and running do the following
> 
> Right click on My Computer and select "manage"
> Next click on Services and Applications
> After that Click on Services
> 
> And check if Apache is running

Hi Chetan,

Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local 
system, and

wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the 
following entries in apache_error.log

[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal -- 
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled. 
Child process is ending.
[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have 
exited.
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited 
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 
configured -- resuming normal operations
[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said "your port 80 is 
not used" and the following entry got added in error_log:

[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to 
listen on port 80.

Thanks.
-- 
V

> 
> 
> 
> Chetan Dattaram Rane | Software Engineer | Persistent Systems
> [EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
> Innovation in software product design, development and delivery- 
> www.persistentsys.com
> 
> 
> 
> 
> -Original Message-
> From: V S Rawat [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 06, 2008 2:53 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Newbie problem: Php script not running in browser.
> 
> On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:
> 
>> On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat <[EMAIL PROTECTED]> wrote:
>>> I have put the first php script to hello.php file:
>>>
>>> 
>>>  
>>>   PHP Test
>>>  
>>>  
>>>  Hello World'; ?>
>>>  
>>> 
>>>
>>> I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b
>>>
>>> http://localhost/ is E:\wamp\www
>>>
>>> I put the hello.php file to E:\wamp\www. drag/dropping it to browser
>>> shows the above source code in ff3/ie6
>>>
>>> putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
>>> to browser shows the same source code.
>>>
>>> However, putting it to E:\wamp\www\php_ex but giving
>>> http://localhost/hello.php shows a blank screen
>>>
>>> I have forgotten some situation where it had appeared as
>>>
>>> Hello World
>>>
>>> '; ?>
>>>
>>> on the browser.
>>>
>>> E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
>>> LoadModule php5_module "e:/wamp/bin/php/php5.2.6/php5apache2_2.dll"
>>> AddType application/x-httpd-php .php
>>> AddType application/x-httpd-php .php3
>>>
>>> On double clicking the php file in windows explorer, it opens in notepad
>>> for edit, instead of getting opened in firefox that is my default.
>>>
>>> Please give me the starting push.
>>> -- V
>>>
>>
>> If you simply drag-and-drop the file from an explorer window into
>> Firefox, Firefox will display the page directly from the file system
>> instead of serving it through your web server. (You can tell this
>> because your address bar will say file:///E:/wamp/www/hello.php.) Your
>> browser won't parse the PHP as script; it will just think it is
>> malformed HTML and it would show the output you listed above.
>> Double-clicking the file, or dragging it into IE will try to open the
>> file with whatever program is associated with that extension in
>> Windows. (If there isn't a file association for *.php files, it will
>> either prompt you for a program to handle the file or it might do the
>> same as Firefox. I'm not sure, and I'm not really interested in
>> changing my file associations to test.)
>>
>> IF the file is located at E:\wamp\www\hello.php AND PHP is configured
>> correctly AND your web server's document root is E:\wamp\www\, THEN
>> 

Re: [PHP] Re: An appeal to your better nature

2008-08-06 Thread Ross McKay
Chris Haensel wrote:

>I never thought someone seriously would go the whole way from dev, test and
>prod servers [...]

Really? You've never:

* developed locally on your own server
* uploaded to a published site, not the client's live site, for preview
* uploaded the approved changes to the client's live site

thus development, test and production?

Never worked on a project with multiple developers, a few development
environments, integration testing, system testing, user acceptance
testing, and releases to the live system?

>AND use all the version control stuff.

Just one is sufficient :) and it certainly saves time in the long run.
It can be especially useful when clients make their own modifications,
and need you to come in and restore just the bits they broke; version
control and a good diff-and-merge tool (e.g. Subversion and Meld) can
save hours of sorting that out.

>Honestly: I use dev servers and two backup servers for our company website,
>but having  a version control system and everything would, in my opinion,
>really make this whole being a developer some kind of ... ugh. Might be good
>to do, I don't know. Never tried, and probably never will. And being a "good
>IT professional" to me means: know what you're doing, and take the hits you
>get. Lost your data? Well, there is a hit to take. 

That's your prerogative, and presumably your company's too, but maybe
Richard would like to know what some of his options are.

>But pointing fingers has never helped anybody.

Who was pointing fingers? I pointed out that hacking the live site with
no version control and no backups wasn't being a good IT professional,
and then I suggested where to find some of the missing files (Google
cache). I also pointed out that I had changes outstanding and not backed
up too, i.e. I'm hardly claiming to be the good IT professional either.

Maybe if Richard picks up some proven software development procedures
like those simple ones mentioned, he won't be bitten like this again.
Maybe you won't be bitten likewise, unless you'd prefer to take umbrage
at offers of advice you don't like.

Or perhaps you think that good IT professionals do hack their production
environments without backups as a matter of course? And on low-service
hosting environments. :)
-- 
Ross McKay, Toronto, NSW Australia
"Words can only hurt if you try to read them. Don't play their game" - Zoolander

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



[PHP] RSS Feed using PHP/MySQL errors

2008-08-06 Thread Don Mak
Trying to create an articles rss feed for my site and I keep getting an
error that says:

=
A semi colon character was expected.
Line: 7 Character: 60
http://www.chirunning.com/shop/pages.php?pageid=19&id=383
=

I've tried every way imaginable to figure out why I am getting this error,
finally I needed to post it to get some feedback. I put an ARROW at the end
of the line in question below. Thanks in advance for any insight you can
provide.

";

// Set RSS version.
echo " ";

// Start the XML.
echo "

Articles Feed
Latest Articles
http://www.mydomain.com/shop/pages.php?pageid=17";

// Create a connection to your database.
//require("db_connection.php");

@mysql_connect('localhost', 'x', 'x') or die('ERROR--CAN'T CONNECT
TO SERVER');
@mysql_select_db('shop') or die('ERROR--CAN'T CONNECT TO DB');

$masterQuery="SELECT articleid, the_date, title FROM mytable WHERE type = 1
ORDER BY the_date DESC";


// Query database and select the last 10 entries.
$data = mysql_query($masterQuery);
while($row = mysql_fetch_array($data))
{

// Convert database images data into actual image link.
$row[Intro] = str_replace("images/", "http://www.mydomain.com/images/";,
$row[Intro]);

// Continue with the 10 items to be included in the  section of the
XML.
echo "

http://www.mydomain.com/shop/pages.php?pageid=19&id=".$row[articleid].";

Re: [PHP] Re: An appeal to your better nature

2008-08-06 Thread Richard Heyes
> Maybe if Richard picks up some proven software development procedures
> like those simple ones mentioned, he won't be bitten like this again.
> Maybe you won't be bitten likewise, unless you'd prefer to take umbrage
> at offers of advice you don't like.

I just want to point out that I don't need to pick them up. If it was
anyone elses stuff (ie work) then backups are done as a matter of
course (more to protect my own arse if nothing else), but it wasn't.
It was my own personal stuff that I'm not going to get sued over.
Naturally I'd rather not lose it, but life would go on if I did.

-- 
Richard Heyes
http://www.phpguru.org

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



Re: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread V S Rawat

On 8/6/2008 4:20 PM India Time, _Chetan Rane_ wrote:


Hi

You need to check if your Apache is up and running do the following

Right click on My Computer and select "manage"
Next click on Services and Applications
After that Click on Services

And check if Apache is running



Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local
system, and

wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the
following entries in apache_error.log

[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal --
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled.
Child process is ending.
[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have
exited.
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6
configured -- resuming normal operations
[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said "your port 80 is
not used" and the following entry got added in error_log:

[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to
listen on port 80.

Thanks.
--
V




Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 2:53 PM

To: php-general@lists.php.net
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 2:58 AM India Time, _Andrew Ballard_ wrote:


On Tue, Aug 5, 2008 at 3:05 PM, V S Rawat <[EMAIL PROTECTED]> wrote:

I have put the first php script to hello.php file:


 
  PHP Test
 
 
 Hello World'; ?>
 


I am on xpsp3, wampserver 2.0, having apache 2.2.8, php 5.2.6, MySQL 5.0.51b

http://localhost/ is E:\wamp\www

I put the hello.php file to E:\wamp\www. drag/dropping it to browser
shows the above source code in ff3/ie6

putting it to E:\wamp\bin\apache\apache2.2.8\htdocs and drag/dropping it
to browser shows the same source code.

However, putting it to E:\wamp\www\php_ex but giving
http://localhost/hello.php shows a blank screen

I have forgotten some situation where it had appeared as

Hello World

'; ?>

on the browser.

E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf file has the lines:
LoadModule php5_module "e:/wamp/bin/php/php5.2.6/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

On double clicking the php file in windows explorer, it opens in notepad
for edit, instead of getting opened in firefox that is my default.

Please give me the starting push.
-- V



If you simply drag-and-drop the file from an explorer window into
Firefox, Firefox will display the page directly from the file system
instead of serving it through your web server. (You can tell this
because your address bar will say file:///E:/wamp/www/hello.php.) Your
browser won't parse the PHP as script; it will just think it is
malformed HTML and it would show the output you listed above.
Double-clicking the file, or dragging it into IE will try to open the
file with whatever program is associated with that extension in
Windows. (If there isn't a file association for *.php files, it will
either prompt you for a program to handle the file or it might do the
same as Firefox. I'm not sure, and I'm not really interested in
changing my file associations to test.)

IF the file is located at E:\wamp\www\hello.php AND PHP is configured
correctly AND your web server's document root is E:\wamp\www\, THEN
opening http://localhost/hello.php should work.

Andrew


Thanks.

k, I will not drag and drop but would open through firefox localhost.

giving http://localhost/hello.php is not showing anything at all, just a 
blank screen. What has gone wrong?





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



Re: [PHP] Newbie problem: Php script not running in browser.

2008-08-06 Thread V S Rawat

On 8/6/2008 7:28 PM India Time, _Chetan Rane_ wrote:


Can you please check what the Document Root in http.conf


windows explorer search didn't threw any file matching http.conf.

The file E:\wamp\bin\apache\apache2.2.8\conf\httpd.conf has

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "e:/wamp/www/"


thanks.
--
V




Chetan Dattaram Rane | Software Engineer | Persistent Systems
[EMAIL PROTECTED]  | Cell: +91 94033 66714 | Tel: +91 (0832) 30 79014
Innovation in software product design, development and delivery- 
www.persistentsys.com




-Original Message-
From: V S Rawat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 7:22 PM

To: Chetan Rane
Subject: Re: [PHP] Newbie problem: Php script not running in browser.

On 8/6/2008 4:20 PM India Time, _Chetan Rane_ wrote:


Hi

You need to check if your Apache is up and running do the following

Right click on My Computer and select "manage"
Next click on Services and Applications
After that Click on Services

And check if Apache is running


Hi Chetan,

Yeah, that is listing

wampapache, Apache/2.2.8 (Win32) PHP/5.2.6, started, manual, local 
system, and


wampmysqld, started, manual, local system, and

I restarted all services from the wamp systray icon. That gave the 
following entries in apache_error.log


[Wed Aug 06 19:06:57 2008] [notice] Parent: Received shutdown signal -- 
Shutting down the server.
[Wed Aug 06 19:06:57 2008] [notice] Child 3072: Exit event signaled. 
Child process is ending.

[Wed Aug 06 19:06:58 2008] [notice] Child 3072: Released the start mutex
[Wed Aug 06 19:06:59 2008] [notice] Child 3072: All worker threads have 
exited.

[Wed Aug 06 19:06:59 2008] [notice] Child 3072: Child process is exiting
[Wed Aug 06 19:06:59 2008] [notice] Parent: Child process exited 
successfully.
[Wed Aug 06 19:06:59 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 
configured -- resuming normal operations

[Wed Aug 06 19:06:59 2008] [notice] Server built: Jan 18 2008 00:37:19
[Wed Aug 06 19:06:59 2008] [notice] Parent: Created child process 1872
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Child process is running
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Acquired the start mutex.
[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting 64 worker threads.

I gave, check port 80. The dos window that opened said "your port 80 is 
not used" and the following entry got added in error_log:


[Wed Aug 06 19:07:00 2008] [notice] Child 1872: Starting thread to 
listen on port 80.


Thanks.



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



RE: [PHP] Re: An appeal to your better nature

2008-08-06 Thread Robert Cummings
On Wed, 2008-08-06 at 14:59 +0200, Chris Haensel wrote:
> 
> -Original Message-
> From: Daniel Brown [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 06, 2008 1:34 AM
> To: Ross McKay
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Re: An appeal to your better nature
> 
> On Tue, Aug 5, 2008 at 7:28 PM, Ross McKay <[EMAIL PROTECTED]> wrote:
> >
> > Problems I see with the above:
> >
> > * good IT professionals use version control AND take backups
> > * good IT professionals work on dev servers and migrate to test, prod
> > * good IT professionals don't tend to claim "guru" status themselves :)
> 
> Addendum:
> 
> * Good IT professionals don't usually criticize one another in a
> public forum in the above manner, if nothing else than out of
> professional courtesy.
> 
> --
> 
> Better prices on dedicated servers:
> Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
> Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
> Dedicated servers, VPS, and hosting from $2.50/mo.
> 
> ROFL
> 
> I never thought someone seriously would go the whole way from dev, test and
> prod servers AND use all the version control stuff.
> 
> Honestly: I use dev servers and two backup servers for our company website,
> but having  a version control system and everything would, in my opinion,
> really make this whole being a developer some kind of ... ugh. Might be good
> to do, I don't know. Never tried, and probably never will.

I use CVS all the way from dev to production with staging in between
(except personal projects where I skip staging). Here's an approximation
of my update workflow:

dev> modify code
dev> cvs commit -m 'blah blah comments'

dev> ssh staging
staging> cvs update
staging> ./buildSite.php

After feedback from client...

dev> ssh production
production> cvs update
production> ./buildSite.php

I use CVS for all my projects. Be they tiny or large. If something goes
wrong after production is updated, I just grab a snapshot from when we
last had a stable run. Using CVS is well worth the extra 5 minutes I
spend at the beginning of a project setting up the repository. When I
take over some project that didn't use CVS, the first thing I do is put
it in CVS. Usually I find crap like foo.php.bak, foo.php.better.bak,
foo.php.good, foo.php.broken littered all over the source tree. Some
idiot obviously made them because they didn't use a versioning system.
The really sad part is, all these files are usually right there in the
production tree.

As far as backups go, CVS is on another machine, production and staging
are sometimes on the same machine, sometimes on their own machines.
Either way, the source exists in 3 physical locations... cvs, dev,
staging. And I run nightly backups of CVS.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] An appeal to your better nature

2008-08-06 Thread tedd

At 9:11 AM -0400 8/5/08, Daniel Brown wrote:

On Tue, Aug 5, 2008 at 8:53 AM, Aschwin Wesselius
<[EMAIL PROTECTED]> wrote:


 I wouldn't like to loose my stuff, but I can't afford much for the best
 solutions either. It's not that my job depends on it, but personal data is a
 big loss too.


Tell me about it.  One of the sickest feelings in the world comes
when you hear your hard drive start going "click click
choke click"


No question about it.

That's the reason why I have three backup systems. One in my garage 
in a fireproof safe that's in another fireproof safe; One hidden in 
my house in another fireproof safe; And one attached to my main 
computer that I backup everyday, or more often, which is stored (when 
not in use) in a yet another waterproof and fireproof safe. (I'm big 
on fireproof safes) All of which are protected by me and my guns. The 
only way I'm going to lose any data is if my place is stuck by a 
meteor.


Sure it takes a lot of time to backup, but less than the alternative.

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



[PHP] Version Control Software

2008-08-06 Thread Benjamin Darwin
After reading a topic on the list here about someone losing their website,
and having a minor mistake on my own that cost me a week's work on a file
(basically, tested the file, then uploaded to the live site and took the
daily backup off the live site.. only to find the file was messed up.. and
had to go to the weekly backup off cd to recover it, losing a week of
work)..

I'm wondering if anybody knows of a version control software program that
may fit my needs.

Basically, I'm looking for something that runs locally, not on the live
site, that I can edit the files on the dev computer, and store old versions
on the dev computer, and then just publish off of the local onto the live
site whenever I need to.

Anybody have any suggestons/ideas on how this should be done, and what
program is a good fit?

Thanks for any help,
Ben


[PHP] [scalability, performance, DoS] To or not to process images at runtime

2008-08-06 Thread Marcelo de Moraes Serpa
Hello,

My next project will be a kind of online photo viewer. All of these photos
will need to have watermark applied to them. The problem is that, depending
on the picture, different watermarks need to be applied. The easiest
solution would be to process these picture at runtime using GD, apply the
watermark(s) and serve them. The other approach, would be to pre-process
them (maybe using GD) and create different copies on the disk, the obvious
advantage being that it could be served directly via the webserver (apache),
but, it would be much harder to manage (need to fix a watermark error?
Re-process and re-create the images on the disk...) and would take much more
disk space. I would rather process them at runtime, per request, however,
this site will probably have lots of traffic. So, I've reached a deadend.
Could someone share his/her experiences and thoughts and help me decide? :)

FYI, The application would be custom built from the ground up using PHP 5
(Not sure if we will use a framework, if we happen to use, it will be
probably CakePHP). At first, there would be no clusters, proxies or
balancers, just a plain dedicated server with a good CPU, about 4GB RAM and
lots of disk space.

PS: I've put DoS in the subject tagline meaning Denial of Service as I think
that maybe dynamic processing of images X lots of request could result in
DoS.

Thanks in advance,

Marcelo.


Re: [PHP] Version Control Software

2008-08-06 Thread Waynn Lue
Does subversion meet your needs?  You can check out a working copy
that's your dev copy, then check in changes and push to production
whenever you want.

Waynn



On 8/6/08, Benjamin Darwin <[EMAIL PROTECTED]> wrote:
> After reading a topic on the list here about someone losing their website,
> and having a minor mistake on my own that cost me a week's work on a file
> (basically, tested the file, then uploaded to the live site and took the
> daily backup off the live site.. only to find the file was messed up.. and
> had to go to the weekly backup off cd to recover it, losing a week of
> work)..
>
> I'm wondering if anybody knows of a version control software program that
> may fit my needs.
>
> Basically, I'm looking for something that runs locally, not on the live
> site, that I can edit the files on the dev computer, and store old versions
> on the dev computer, and then just publish off of the local onto the live
> site whenever I need to.
>
> Anybody have any suggestons/ideas on how this should be done, and what
> program is a good fit?
>
> Thanks for any help,
> Ben
>

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



[PHP] Re: Variable number of parameters

2008-08-06 Thread Shawn McKenzie

Philip Thompson wrote:
Is it possible to grab a variable number of parameters and send the 
appropriate amount to another function?


db->prepare("SELECT * FROM `table` WHERE (`id`=?)");
$this->db->bind('ii', $id1);

$this->db->prepare("SELECT * FROM `table` WHERE (`id`=? AND 
`other_id`=?)");

$this->db->bind('ii', $id1, $id2);

// DB class
function bind () {
  $args = func_get_args();
  $this->statement->bind_param($args[0], $args[1], ...);
}
?>

Ok, is it possible to send any number of variables to db->bind() in 
order to send those to statement->bind_param()?


Or, if someone else has a better db abstraction method, feel free to 
educate...


Thanks,
~Phil


I'm confused as your code looks like it's already doing what you're 
asking.  It's hard to tell without seeing what bind_param() looks like. 
 But just a thought to use arrays in one of two ways:


// 1.
$this->db->bind('ii', $id1, $id2);

function bind () {
$args = func_get_args();
$this->statement->bind_param($args);
// then bind_param() can count the number of args and use them
}

//2.
$this->db->bind('ii', array($id1, $id2));

function bind ($var, $ids) {
// pass thru to bind_param()
$this->statement->bind_param($var, $ids);
// then bind_param() can use the $ids array
// or count the ids and send individual args to bind_param()
}

As I said, it's kind of hard to tell without knowing exactly what you 
want to achieve.


One of the more elegant ways that I have seen is to pass required args 
and then an array of args that the receiving function can use, like:


$this->db->bind('ii', array('someoption'=>$id1, 'feature'=>$id2, 
'action'=>'doit'));


Need more info on the desired outcome.

-Shawn

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



[PHP] Re: Version Control Software

2008-08-06 Thread Shawn McKenzie

Benjamin Darwin wrote:

After reading a topic on the list here about someone losing their website,
and having a minor mistake on my own that cost me a week's work on a file
(basically, tested the file, then uploaded to the live site and took the
daily backup off the live site.. only to find the file was messed up.. and
had to go to the weekly backup off cd to recover it, losing a week of
work)..

I'm wondering if anybody knows of a version control software program that
may fit my needs.

Basically, I'm looking for something that runs locally, not on the live
site, that I can edit the files on the dev computer, and store old versions
on the dev computer, and then just publish off of the local onto the live
site whenever I need to.

Anybody have any suggestons/ideas on how this should be done, and what
program is a good fit?

Thanks for any help,
Ben

I use SVN for my local development.  It is very easy I think.  I use 
Aptana IDE which has SVN support.  I use linux, but I'm sure there is 
SVN for winbloze.


-Shawn

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



[PHP] Re: PHP Brain Teasers

2008-08-06 Thread tedd

At 12:51 PM -0400 8/5/08, Daniel Brown wrote:

On Tue, Jun 26, 2007 at 1:44 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:


   Try to use some really common phrases that all of us around the
 world should recognize, but feel free to get really elaborate with the

 > code.


function getToDoList($wifeList)
   {  
   list($doWhat, $doWhen) = explode ("/r", $wifeList);

   $anarray1 = split(" ", $doWhat);
   $anarray2 = split(" ", $doWhen);
   $tomorrow = mktime(1, 0, 0, $m, $d + 1, $y);

   for ($i = 0; $i < count($anarray1); $i++)
  {
  if (in_array($anarray2[$i], $tomorrow))
 {
 $putoff = $tomorrow;
 }
  else
 {
 $putoff = rand($excuse);
 }
   return $putoff

   }

Cheers,

tedd

PS: Not guaranteed to work.

--
---
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] An appeal to your better nature

2008-08-06 Thread Børge Holen
On Wednesday 06 August 2008 20:00:50 tedd wrote:
> At 9:11 AM -0400 8/5/08, Daniel Brown wrote:
> >On Tue, Aug 5, 2008 at 8:53 AM, Aschwin Wesselius
> >
> ><[EMAIL PROTECTED]> wrote:
> >>  I wouldn't like to loose my stuff, but I can't afford much for the best
> >>  solutions either. It's not that my job depends on it, but personal data
> >> is a big loss too.
> >
> > Tell me about it.  One of the sickest feelings in the world comes
> >when you hear your hard drive start going "click click
> >choke click"
>
> No question about it.
>
> That's the reason why I have three backup systems. One in my garage
> in a fireproof safe that's in another fireproof safe; One hidden in
> my house in another fireproof safe; And one attached to my main
> computer that I backup everyday, or more often, which is stored (when
> not in use) in a yet another waterproof and fireproof safe. (I'm big
> on fireproof safes) All of which are protected by me and my guns. The
> only way I'm going to lose any data is if my place is stuck by a
> meteor.
>
> Sure it takes a lot of time to backup, but less than the alternative.

I'm just gonna comment some here. Hell, it's a bitch to loose data, but I give 
you this... These "pro's" here, ain't getting things done, no time for it 
between backups.
The time they use each year on backup you can write new code tenfold. ;D  
muhaha
 
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com



-- 
---
Børge Holen
http://www.arivene.net

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



[PHP] Uploading Large Files - Strange Issue

2008-08-06 Thread Anna Vester
Hello group,

I have a very strange issue coming up when uploading large files ( about
30MB). The problem is it works fine on my computer (and two others that I've
tested), but it doesn't work on my client's laptop. It comes up with error
code - 0 (which is upload successful), but the actual file is not on the
server. Here is my error checking code:

if ($sizeOK && $typeOK) {
switch($_FILES['items']['error'][$number]) {
case 0:
if(!file_exists(UPLOAD_DIR.$file)) {
$success =
move_uploaded_file($_FILES['items']['tmp_name'][$number], UPLOAD_DIR.$file);
}
else {
$success = 
move_uploaded_file($_FILES['items']['tmp_name'][$number],
UPLOAD_DIR.$postDate.$file);
$cp = true;

}

if ($success) {
$result[] = "$file uploaded successfully";
} 
else {
$result[] = "Error uploading $file. Please
try again.";
}
break;
case 3:
$result[] = "Error uploading $file. Please try
again.";
default:
$result[] = "System error uploading $file. Contact
Webmaster.";
}
}
elseif ($_FILES['items']['error'][$number] == 4) {
$result[] = 'You chose not to add this file.';
}
else {
$result[] = "$file cannot be uploaded. Maximum size: $max.
Acceptable file types: pdf and mp3.Error number: " .
$_FILES['items']['error'][$number]."";
}
=

So for some reason on his computer it doesn't go to the switch statement
(case 0), but goes to the very last else statement. 

So he always get this message:
>bigfiles.mp3 cannot be uploaded. Maximum size: 51,000.00KB.
>Acceptable file types: pdf and mp3
>Error number: 0

Yet, it always seems to work when I do it on my computer.

Any insight into this issue would be very helpful.

Thank you.

Anna Vester



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



[PHP] Re: Version Control Software

2008-08-06 Thread Colin Guthrie

Benjamin Darwin wrote:

Anybody have any suggestons/ideas on how this should be done, and what
program is a good fit?


Personally I think subversion is best suited for web projects (which can 
have high graphics churn) and git is best suited for code projects 
(which have text differences).


I'm really loving git the more I use it for various projects, but I 
really don't think I'd be bothered with it's complexity if you are new 
to VCS.


Subversion is great. You can can either run a repository locally or 
remotely and check out your "working copy" to do the actual changes, and 
commit back to the repository when you are done. If you keep your 
repository store locally, then make sure you have a good backup policy 
there!


Personally, I keep my subversion repository on a central server in the 
office. It's connected via a standard ADSL but I can SSH in from the 
outside world. Live servers connect directly into it to do their 
checkouts for actually running the site. I do this on demand so it 
doesn't matter if the office server is offline etc. as I just make sure 
it goes online before updating. That way I'll usually have a full local 
checkout on my dev machine, the master repository and of course the live 
servers. This is quite reassuring from a backup perspective :D



If you do go for subversion, I can recommend Trac as an excellent web 
based frontend to the repository to allow you to view it nicely. It also 
has a wiki for keeping notes and a ticketing system; with a few plugins 
I wrote (WorkLogPlugin, ClientsPlugin) it is ideal for tracking time 
spent on various tasks for various clients in order ot issue invoices etc.


As for frontends, on Winblows, Tortoise SVN is the defacto one, but if 
you use Eclipse there are a few options there (Subclipse and Subversive) 
too.


HTHs

Col


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



[PHP] Re: Version Control Software

2008-08-06 Thread Ross McKay
On Wed, 6 Aug 2008 16:42:23 -0400, "Benjamin Darwin" wrote:

>[...]
>I'm wondering if anybody knows of a version control software program that
>may fit my needs.
>
>Basically, I'm looking for something that runs locally, not on the live
>site, that I can edit the files on the dev computer, and store old versions
>on the dev computer, and then just publish off of the local onto the live
>site whenever I need to. [...]

A couple of very easy-to-use ones are Subversion and CVS. Both are very
easy to use from a shell / command line, and both have nice GUIs
available for both Windows and *nix. Many editors and IDEs will work
with CVS directly, and some with Subversion.

I chose Subversion because I was trying to move SWMBO off Windows onto
Linux, and the GUIs for Subversion were similar enough and simple enough
on both (TortoiseSVN on Windows, RapidSVN on Linux). Subversion has some
nice options for setting up network servers if you need to go down that
path too (although you probably would get by nicely using local file
storage).

Under Windows, TortoiseSVN comes with a pretty good diff / merge tool
built-in. Under Linux, you'll want to grab Meld. 

If you're doing website development by yourself with no self-built
common code libraries (or frameworks!) then you probably won't even need
to worry about stuff like branching. If you have set up some common code
libraries, then it's a good idea to look at branching so that you can
support older sites on older versions of the libraries whilst further
developing them for newer sites.

http://subversion.tigris.org/
http://tortoisesvn.tigris.org/
http://rapidsvn.tigris.org/
http://meld.sourceforge.net/

Of course, a good IT professional would probably tell you to use git,
with its 132-odd shell commands... ;)
-- 
Ross McKay, Toronto, NSW Australia
"And don't forget ladies and gentlemen
 you have to buy this new thing that you don't have
 and if you have it
 well actually
 the new better version of the thing that you have
 well it just came out" - Jackson Jackson

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



[PHP] Re: An appeal to your better nature

2008-08-06 Thread Shawn McKenzie

Richard Heyes wrote:

Hi,

Seems my 1and1 server has finally gone kaput taking my website with
it, and in the tradition of all good IT professionals, I have no
backups. :( So this is an appeal to you to ask if you have downloaded
anything from phpguru.org at all, could you please send it to me so I
can try to rebuild my site.

A big thanks.


Wooo, thanks for the reminder.  Off to do my annual backups.

-Shawn

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



Re: [PHP] An appeal to your better nature

2008-08-06 Thread Robert Cummings
On Thu, 2008-08-07 at 00:46 +0200, Børge Holen wrote:
> On Wednesday 06 August 2008 20:00:50 tedd wrote:
> > At 9:11 AM -0400 8/5/08, Daniel Brown wrote:
> > >On Tue, Aug 5, 2008 at 8:53 AM, Aschwin Wesselius
> > >
> > ><[EMAIL PROTECTED]> wrote:
> > >>  I wouldn't like to loose my stuff, but I can't afford much for the best
> > >>  solutions either. It's not that my job depends on it, but personal data
> > >> is a big loss too.
> > >
> > > Tell me about it.  One of the sickest feelings in the world comes
> > >when you hear your hard drive start going "click click
> > >choke click"
> >
> > No question about it.
> >
> > That's the reason why I have three backup systems. One in my garage
> > in a fireproof safe that's in another fireproof safe; One hidden in
> > my house in another fireproof safe; And one attached to my main
> > computer that I backup everyday, or more often, which is stored (when
> > not in use) in a yet another waterproof and fireproof safe. (I'm big
> > on fireproof safes) All of which are protected by me and my guns. The
> > only way I'm going to lose any data is if my place is stuck by a
> > meteor.
> >
> > Sure it takes a lot of time to backup, but less than the alternative.
> 
> I'm just gonna comment some here. Hell, it's a bitch to loose data, but I 
> give 
> you this... These "pro's" here, ain't getting things done, no time for it 
> between backups.
> The time they use each year on backup you can write new code tenfold. ;D  
> muhaha

What are you yammering on about? A simple cron job can do the backup
while I sleep-- "Look ma... I work while I sleep!"

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Re: Version Control Software

2008-08-06 Thread Robert Cummings
On Thu, 2008-08-07 at 09:43 +1000, Ross McKay wrote:
> On Wed, 6 Aug 2008 16:42:23 -0400, "Benjamin Darwin" wrote:
> 
> >[...]
> >I'm wondering if anybody knows of a version control software program that
> >may fit my needs.
> >
> >Basically, I'm looking for something that runs locally, not on the live
> >site, that I can edit the files on the dev computer, and store old versions
> >on the dev computer, and then just publish off of the local onto the live
> >site whenever I need to. [...]
> 
> A couple of very easy-to-use ones are Subversion and CVS. Both are very
> easy to use from a shell / command line, and both have nice GUIs
> available for both Windows and *nix. Many editors and IDEs will work
> with CVS directly, and some with Subversion.

While I currently use CVS, I probably wouldn't choose it going forward
since Subversion solves many of the problems it has... as does GIT if I
recall. I'm still using CVS because it works for me and I haven't
allocated the time yet to switch over.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



RE: [PHP] Uploading Large Files - Strange Issue

2008-08-06 Thread Jay Blanchard
[snip]
I have a very strange issue coming up when uploading large files ( about
30MB). The problem is it works fine on my computer (and two others that
I've
tested), but it doesn't work on my client's laptop. It comes up with
error
code - 0 (which is upload successful), but the actual file is not on the
server. Here is my error checking code:

if ($sizeOK && $typeOK) {
switch($_FILES['items']['error'][$number]) {
case 0:
if(!file_exists(UPLOAD_DIR.$file)) {
$success =
move_uploaded_file($_FILES['items']['tmp_name'][$number],
UPLOAD_DIR.$file);
}
else {
$success = 
move_uploaded_file($_FILES['items']['tmp_name'][$number],
UPLOAD_DIR.$postDate.$file);
$cp = true;

}

if ($success) {
$result[] = "$file uploaded
successfully";
} 
else {
$result[] = "Error uploading $file.
Please
try again.";
}
break;
case 3:
$result[] = "Error uploading $file. Please try
again.";
default:
$result[] = "System error uploading $file.
Contact
Webmaster.";
}
}
elseif ($_FILES['items']['error'][$number] == 4) {
$result[] = 'You chose not to add this file.';
}
else {
$result[] = "$file cannot be uploaded. Maximum size: $max.
Acceptable file types: pdf and mp3.Error number: " .
$_FILES['items']['error'][$number]."";
}
=

So for some reason on his computer it doesn't go to the switch statement
(case 0), but goes to the very last else statement. 

So he always get this message:
>bigfiles.mp3 cannot be uploaded. Maximum size: 51,000.00KB.
>Acceptable file types: pdf and mp3
>Error number: 0

Yet, it always seems to work when I do it on my computer.

Any insight into this issue would be very helpful.
[/snip]

It is likely that it is not PHP causing the issue. What browser is he
using? What are his security settings for the browser? Have you viewed
the source of the upload form on his browser? 

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



RE: [PHP] Uploading Large Files - Strange Issue

2008-08-06 Thread Anna Vester
[snip]
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2008 9:44 PM
To: Anna Vester; php-general@lists.php.net
Subject: RE: [PHP] Uploading Large Files - Strange Issue

It is likely that it is not PHP causing the issue. What browser is he
using? What are his security settings for the browser? Have you viewed
the source of the upload form on his browser? 
[/snip]

He is using IE7 on Vista, he has a number of fishing add-ons (I don't
remember which exactly since I've seen his laptop only once before this
problem arose). Also he's been using "You send it" service just fine. That's
what bums me!

Thanks for such a quick response.

Anna 


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



Re: [PHP] [scalability, performance, DoS] To or not to process images at runtime

2008-08-06 Thread Per Jessen
Marcelo de Moraes Serpa wrote:

> My next project will be a kind of online photo viewer. All of these
> photos will need to have watermark applied to them. The problem is
> that, depending on the picture, different watermarks need to be
> applied. The easiest solution would be to process these picture at
> runtime using GD, apply the watermark(s) and serve them. The other
> approach, would be to pre-process them (maybe using GD) and create
> different copies on the disk, the obvious advantage being that it
> could be served directly via the webserver (apache), but, it would be
> much harder to manage (need to fix a watermark error? Re-process and
> re-create the images on the disk...) and would take much more disk
> space. I would rather process them at runtime, per request, however,
> this site will probably have lots of traffic. So, I've reached a
> deadend. Could someone share his/her experiences and thoughts and help
> me decide? :)

I think it depends on the amount of traffic you expect - 

high - off-line
low-to-medium - on-line, on-demand, but cached.

Disk-space is cheap, especially if you don't need to be worried about
backup etc.  I'm not sure why you think applying watermarks in an
off-line process would any less manageable than doing it on-line.

> FYI, The application would be custom built from the ground up using
> PHP 5 (Not sure if we will use a framework, if we happen to use, it
> will be probably CakePHP). At first, there would be no clusters,
> proxies or balancers, just a plain dedicated server with a good CPU,
> about 4GB RAM and lots of disk space.

Sounds like you are planning to do the processing off-line then.  You
could even do a mix - if you've got a lot of photos (millions and
milloins), applying the watermarks could take a while in itself, so you
could leave that running slowly in the background, but combine it with
an on-line process that does on-demand watermarking (when the photo is
displayed).


/Per Jessen, Zürich


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



Re: [PHP] [scalability, performance, DoS] To or not to process images at runtime

2008-08-06 Thread Nathan Nobbe
On Wed, Aug 6, 2008 at 3:04 PM, Marcelo de Moraes Serpa <[EMAIL PROTECTED]
> wrote:

> Hello,
>
> My next project will be a kind of online photo viewer. All of these photos
> will need to have watermark applied to them. The problem is that, depending
> on the picture, different watermarks need to be applied. The easiest
> solution would be to process these picture at runtime using GD, apply the
> watermark(s) and serve them. The other approach, would be to pre-process
> them (maybe using GD) and create different copies on the disk, the obvious
> advantage being that it could be served directly via the webserver
> (apache),
> but, it would be much harder to manage (need to fix a watermark error?
> Re-process and re-create the images on the disk...) and would take much
> more
> disk space. I would rather process them at runtime, per request, however,
> this site will probably have lots of traffic. So, I've reached a deadend.
> Could someone share his/her experiences and thoughts and help me decide? :)
>
> FYI, The application would be custom built from the ground up using PHP 5
> (Not sure if we will use a framework, if we happen to use, it will be
> probably CakePHP). At first, there would be no clusters, proxies or
> balancers, just a plain dedicated server with a good CPU, about 4GB RAM and
> lots of disk space.
>
> PS: I've put DoS in the subject tagline meaning Denial of Service as I
> think
> that maybe dynamic processing of images X lots of request could result in
> DoS.


for the code that will invoke the watermarking, put it behind another layer,
so that you can easily alter it in the future as the site grows.  for
example, you might use strategy pattern, and your initial strategy will use
the current webserver directly.  however, as the site begins to grow, you
can add additional webservers, dedicated to running gd on top of php.  you
can then write a strategy which will pass the requests off to those boxe(s),
and it will be transparent to your existing code that knows only of the
strategy interface.

also, as you grow, distributed filesystems are key.  for example, your
front-end webserver can handle requests from users on the site, dispatch a
request (restful for instance) to another box, dedicated to gd.  since both
boxes share a common filesystem via nfs (or other) the gd box can create the
watermark, which will then be immediately available to the front-end box,
which it could signal w/ another request to say 'hey, the watermark is
ready'.

-nathan


Re: [PHP] An appeal to your better nature

2008-08-06 Thread Yeti
Backups? What's that?

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



[PHP] php File upload

2008-08-06 Thread Tom
Hi,

on a linux system (Suese 10.2) with 1 GB memory its not possible to upload 
via http a  1 Gb File. Thats no limit problem  on my php config. i can look 
the mem stats when uploading and the growing tmp file. If the temp file has 
900 MB, Main Memory free is 0 and the script aborts and php deletes the tmp 
file.

Why don't php use swap memory ?

Greets Tom 



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



Re: [PHP] [scalability, performance, DoS] To or not to process images at runtime

2008-08-06 Thread Per Jessen
Bernhard Kohl wrote:

> I think it also depends on the size of your images. If they are huge
> megapixel files processing them on the fly might cause severe lag.
> Still adding a watermark to an image with 100-200 thousand pixels is
> done within milliseconds on a modern machine.
> 

(You probably meant to send this to the list)

The OP spoke about "a kind of online photo viewer", so I assumed e.g.
JPEGs at 1024x768 as a typical size, so about 700K pixels.


/Per Jessen, Zürich



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