Re: [PHP] official statement about PHP file extensions?

2002-04-19 Thread andy thomas



On Fri, 19 Apr 2002 [EMAIL PROTECTED] wrote:

 At 19.04.2002  13:32, you wrote:
 
 Hi,
 
 Is there any official statement (by php.net) about which file extension you
 should use when using PHP (1, 2, 3 or 4)? I know that's server related, but
 isn't there a standard?
 
 http://www.fatcow.com/help/php.shtml states when using PHP4, you should
 use .php4. But I have the feeling that's not true. I can remember the windows
 installation of PHP4 which said .phtml and .php3 were deprecated and .php
 was the only alternative.
 
 Thanks in advance


 This only belongs to the settings your webserver allows.
 f.e. I have configured, to parse every html file, so it looks like there were
 static files, but they are php files. (not recommended on real
 traffic/big sites
 Some ISPĀ“s suggest that you use php3/4 extensions, as they have both versions
 running.

I wonder why they do this? In my experience, php3 code runs fine on a
php4 server and on the servers I manage, the apache configuration passes
both .php3 and .phtml scripts to php4 for execution.

Andy


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




Re: [PHP] Re: Why?

2002-03-30 Thread andy thomas



On Sat, 30 Mar 2002, Michael Kimsal wrote:

 Alberto Wagner wrote:
  Why everyone uses $foo or $foobar as examples?
 
 
 

 Why not?  They are relatively benign words that are simply to
 type and aren't terribly language centric.

 $moo and $moocow would work just as well, or $asdf or $qwerty
 or others.

 As far as I know, they have no specific connotation,
 but they've been used as placement holder names since
 at least the early 80's when I started programming.

Yes, the manual for Microsoft's M80 8080 macro assembler was the first
time I came across foo and bar. This was dated 1979.

Andy


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




Re: [PHP] What is needed to test php mail on a local testserver

2002-03-14 Thread andy thomas



On Thu, 14 Mar 2002, andy wrote:

 Hi there,

 I am wondering, how I could test the mail functions of php on a local
 machine. Do I have to install something like a mailserver, or does this come
 with php?

If you are using a Unix/Linux type server for your local system, sendmail
(or an equivalent such as exim, smail, qmail, etc) will almost certainly
be installed and running. Then you can send mail to your_usernamelocalhost
and assuming your sendmail/exim configuration is reasonably standard, it
should work.

Andy


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




Re: [PHP] CLI through PHP

2002-03-14 Thread andy thomas



On Thu, 14 Mar 2002, Liam wrote:

 14/03/2002 10:51:10 PM

 Hi, I was wondering how I'd go about manipulating some command line
 software through PHP.  For instance, I have an FTP program installed
 that allows you to add users through the command line, but it's in this
 format:

  --

 mailto:root@apathy;root@apathy#:  pure-pw useradd
 joedirt -d /home/jpedirt -u ftpuser

  Enter User's Password:
  Enter User's Password Again:
  User Created

 mailto:root@apathy;root@apathy#:

  --

 How would I go about writing a simple PHP script that will add users for
 me using the data submitted by a form?  Thanks for your help.

Someone else has already posted an example of a form to collect the data
and pass it to a script called adduser.php. In adduser.php you could try
the exec() function to execute the adduser/useradd command, something
like:

  exec(useradd -u $uid -g $gid -d $home_dir -s $shell -c 'comments' $user);


Hope this helps,

Andy


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




[PHP] Running PHP scripts from the shell

2002-03-11 Thread andy thomas

Just wondering but is there any way PHP scripts can be run from the
command line from a standard Unix shell like, for example, perl rather
than being invoked via a browser and running web server, etc?

Such a feature would be very nice as there are a number of things that
can be done better from PHP than from a shell script - MySQL access being
one of them.

Andy


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




Re: [PHP] Running PHP scripts from the shell

2002-03-11 Thread andy thomas



On Mon, 11 Mar 2002, Jason Wong wrote:

 On Monday 11 March 2002 20:18, andy thomas wrote:
  Just wondering but is there any way PHP scripts can be run from the
  command line from a standard Unix shell like, for example, perl rather
  than being invoked via a browser and running web server, etc?
 
  Such a feature would be very nice as there are a number of things that
  can be done better from PHP than from a shell script - MySQL access being
  one of them.

 PHP can be compiled as a stand-alone program (for use as CGI  thus shell
 scripting). See manual, Installation for details.

I will try doing this, thanks a lot for the suggestion.

Andy


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




Re: [PHP] permissions

2002-03-04 Thread andy thomas



On Mon, 4 Mar 2002, John Gurley wrote:

 Can someone pleas tell me if there is something funny when it comes to unix
 permissions and PHP When php creates a file in unix the owner is
 nobodydoes this raise any issues, and if it does could someone please
 tell me a web site where I could read more about this Thanks alot

PHP will always run as the same user as Apache runs as This will often be
something like 'httpd', 'www_run', 'www', 'www-adm', etc but sometimes
user 'nobody' is used for this So if any files are created by Apache
or PHP during normal operation, these will be owned by that user The one
exception is the Apache log files - these are normally owned by root, the
user Apache's parent process runs as initially before it forks child
servers running as user 'nobody', etc

Andy


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] Bizarre mail() problem

2002-03-03 Thread andy thomas



On Sun, 3 Mar 2002, andy thomas wrote:



 On Sat, 2 Mar 2002, Andrey Hristov wrote:

  check you php.ini if you need to change sendmail -t -i to something other.

 We are still having problems with this. Doing another mailshot, the script
 crawled at 1 message every 75 seconds. After starting 10 more scripts,
 each script was putting out one message every 75 seconds. Suddenly, after
 about 40 minutes of this, all 11 scripts suddenly accelerated up to full
 speed, load av hit 8+ and the mailshot completed in less than 1 hour!

 I'm now doing another mail blast using just 5 parallel scripts - it's
 crawling at the moment but it will be interesting to see what happens in
 about half an hour's time.

As an update to this, after 90 minutes the first script, which processed
about 600 addresses, completed. After that the remaining four scripts,
mailing 2000 addresses each, ran at full speed.

Now what is going on? It seems the completion of the first script is some
sort of trigger for sendmail to run quicker.

Andy

  - Original Message -
  From: andy thomas [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, March 02, 2002 11:04 AM
  Subject: [PHP] Bizarre mail() problem
 
 
   I have written a script to do some massmailing - it extracts an email
   address from a MySQL database and uses it to send a text file as a mail
   message. It works but there is a 75 second delay between each message
   being sent out!
  
   This is baffling - there are no delays built into the script and nothing
   obvious in our sendmail configuration. As I've got over 38000 addresses to
   mail out to, this is a problem - I've got round it for now by running 10
   scripts simultaneously, each handling 1000 addresses and this has got mail
   moving.
  
   The mail() function seems to call sendmail -t -i. This just sits there for
   75 seconds, then sends a message and then waits for another 75 seconds.
   Surely this should not happen?
  
   Here's the relevant parts of the script - the email address is in column
   15 of the MySQL table, so it just extracts field 14 for the email address
   data:
  
   $msg_txt=message.txt;
  
   mysql_connect(localhost,$mysql_user,$mysql_pwd);
   $query=select * from $table;
   $result=mysql($dbname, $query);
   $rows=mysql_numrows($result);
  
   $r=0;
   $f=14;
   while ($r  $rows ) {
   $address=mysql_result($result,$r,$f);
   mail($address,$subject,$message,From:$MailFromAddress);
   $r++;
   }
  
  
   Any suggestions or pointers to where I'm going wrong will be warmly
   received.
  
   Andy
  
  
   --
   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




[PHP] Bizarre mail() problem

2002-03-02 Thread andy thomas

I have written a script to do some massmailing - it extracts an email
address from a MySQL database and uses it to send a text file as a mail
message It works but there is a 75 second delay between each message
being sent out!

This is baffling - there are no delays built into the script and nothing
obvious in our sendmail configuration As I've got over 38000 addresses to
mail out to, this is a problem - I've got round it for now by running 10
scripts simultaneously, each handling 1000 addresses and this has got mail
moving

The mail() function seems to call sendmail -t -i This just sits there for
75 seconds, then sends a message and then waits for another 75 seconds
Surely this should not happen?

Here's the relevant parts of the script - the email address is in column
15 of the MySQL table, so it just extracts field 14 for the email address
data:

$msg_txt=messagetxt;

mysql_connect(localhost,$mysql_user,$mysql_pwd);
$query=select * from $table;
$result=mysql($dbname, $query);
$rows=mysql_numrows($result);

$r=0;
$f=14;
while ($r  $rows ) {
$address=mysql_result($result,$r,$f);
mail($address,$subject,$message,From:$MailFromAddress);
$r++;
}


Any suggestions or pointers to where I'm going wrong will be warmly
received

Andy


-- 
PHP General Mailing List (http://wwwphpnet/)
To unsubscribe, visit: http://wwwphpnet/unsubphp




Re: [PHP] Bizarre mail() problem

2002-03-02 Thread andy thomas



On Sat, 2 Mar 2002, Andrey Hristov wrote:

 check you php.ini if you need to change sendmail -t -i to something other.

I think the problem's fixed itself now! About 45 minutes after I
started running 10 scripts in parallel, the whole show went berserk and
all the scripts begain sending a message a second, so that sendmail was
handling 10 messages/second and load average hit 3.5. It must have been a
network related problem but it's all running fine now with 1 message a
second going out from the original script.

cheers,

Andy

 - Original Message -
 From: andy thomas [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 02, 2002 11:04 AM
 Subject: [PHP] Bizarre mail() problem


  I have written a script to do some massmailing - it extracts an email
  address from a MySQL database and uses it to send a text file as a mail
  message. It works but there is a 75 second delay between each message
  being sent out!
 
  This is baffling - there are no delays built into the script and nothing
  obvious in our sendmail configuration. As I've got over 38000 addresses to
  mail out to, this is a problem - I've got round it for now by running 10
  scripts simultaneously, each handling 1000 addresses and this has got mail
  moving.
 
  The mail() function seems to call sendmail -t -i. This just sits there for
  75 seconds, then sends a message and then waits for another 75 seconds.
  Surely this should not happen?
 
  Here's the relevant parts of the script - the email address is in column
  15 of the MySQL table, so it just extracts field 14 for the email address
  data:
 
  $msg_txt=message.txt;
 
  mysql_connect(localhost,$mysql_user,$mysql_pwd);
  $query=select * from $table;
  $result=mysql($dbname, $query);
  $rows=mysql_numrows($result);
 
  $r=0;
  $f=14;
  while ($r  $rows ) {
  $address=mysql_result($result,$r,$f);
  mail($address,$subject,$message,From:$MailFromAddress);
  $r++;
  }
 
 
  Any suggestions or pointers to where I'm going wrong will be warmly
  received.
 
  Andy
 
 
  --
  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] Bizarre mail() problem

2002-03-02 Thread andy thomas



On Sat, 2 Mar 2002, Andrey Hristov wrote:

 check you php.ini if you need to change sendmail -t -i to something other.

We are still having problems with this. Doing another mailshot, the script
crawled at 1 message every 75 seconds. After starting 10 more scripts,
each script was putting out one message every 75 seconds. Suddenly, after
about 40 minutes of this, all 11 scripts suddenly accelerated up to full
speed, load av hit 8+ and the mailshot completed in less than 1 hour!

I'm now doing another mail blast using just 5 parallel scripts - it's
crawling at the moment but it will be interesting to see what happens in
about half an hour's time.

Andy

 - Original Message -
 From: andy thomas [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 02, 2002 11:04 AM
 Subject: [PHP] Bizarre mail() problem


  I have written a script to do some massmailing - it extracts an email
  address from a MySQL database and uses it to send a text file as a mail
  message. It works but there is a 75 second delay between each message
  being sent out!
 
  This is baffling - there are no delays built into the script and nothing
  obvious in our sendmail configuration. As I've got over 38000 addresses to
  mail out to, this is a problem - I've got round it for now by running 10
  scripts simultaneously, each handling 1000 addresses and this has got mail
  moving.
 
  The mail() function seems to call sendmail -t -i. This just sits there for
  75 seconds, then sends a message and then waits for another 75 seconds.
  Surely this should not happen?
 
  Here's the relevant parts of the script - the email address is in column
  15 of the MySQL table, so it just extracts field 14 for the email address
  data:
 
  $msg_txt=message.txt;
 
  mysql_connect(localhost,$mysql_user,$mysql_pwd);
  $query=select * from $table;
  $result=mysql($dbname, $query);
  $rows=mysql_numrows($result);
 
  $r=0;
  $f=14;
  while ($r  $rows ) {
  $address=mysql_result($result,$r,$f);
  mail($address,$subject,$message,From:$MailFromAddress);
  $r++;
  }
 
 
  Any suggestions or pointers to where I'm going wrong will be warmly
  received.
 
  Andy
 
 
  --
  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