Re: Needed: Several short, swift kicks.
| From: | Stuart Dallas | Date: | Wed, 29 May 2002 04:59:59 +0000 |
| Subject: | Re: Needed: Several short, swift kicks. | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-14006@lists.php.net to get a copy of this message | ||
On 29 May 2002 at 0:03, Mark Filipak wrote:
> 1 - Can PHP be used as a batch processor under MS-Windows?
Yes. Just use "php -q c:\path\to\script.php". For the full set of command line options,
type
"php -h" at the command line. The relevant manual page is
http://www.php.net/manual/en/html/features.commandline.html.
> 2 - I downloaded php-4.2.1-installer.exe and php-4.2.1-Win32.zip. I
> ran php-4.2.1-installer.exe to the point where I got this dialog:
>
> Title Bar: "Mail Configuration"
> Query #1: "Please enter the address of your SMTP server."
> Textbox #1: "localhost"
> Query #2: "Please enter the 'from' address for the mail function."
> Textbox #2: "me@localhost.com"
>
> I don't know what is being asked. What do I do now?
If you want to send email from PHP on a Windows box you need to have an SMTP server
available - that's the first value. The second value sets the email address that will be used
as the envelope address for all emails sent (bounced mail will usually be sent to this
address).
> 3 - To run PHP for command line scripting, do I need Apache? I think I
> do, though here: http://www.php.net/manual/en/installation.php,
> is
> found this: "If you are also interested to use PHP for command line
> scripting ... you need no server and no browser", but the installer
> seems to demand a mail server (see question 2, above), so I'm very
> confused.
No you don't need Apache to use PHP from the command line. If you want to send email
from PHP using the mail() function you still need to specify an SMTP server. If you are not
going to be sending email from PHP the values you enter in that installation dialog are
irrelevant.
> 4 - What run time environment does PHP for command line scripting
> expect and how much of it, a, is installed by php-4.2.1-installer.exe,
> and b, is found in php-4.2.1-Win32.zip?
You need php.exe and php4ts.dll (this needs to be on the path) - that's the minimum. That
installation package installs most things you could possibly need including a healthy set of
extensions (none loaded by default IIRC).
> Generally, my experience has not been that there is too little
> documentation, but that there is too much, that it is poorly written,
The PHP manual is extremely comprehensive and (IMHO) quite well-written. However, it is
written as a reference manual, not a beginners guide. There are lots and lots of good PHP-
for-beginners books. A good place to start looking for a suitable book is
http://www.php.net/books.php.
I hope that lot helps.
--
Stuart