php-windows Digest 5 Jan 2005 09:48:41 -0000 Issue 2523
Topics (messages 25227 through 25231):
Re: PHP cgi
25227 by: blulagoon
Re: Making includes easy.... Am I a 'tard?
25228 by: Jason Barnett
25229 by: Patrick Roane
25230 by: Jason Barnett
Sending Emails
25231 by: Hassan Shaikh
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Hi Luis,
You are running PHP as a CGI, which is what I've been doing for about 3 years
now with no problems. Now I am trying to use a
piece of Open Source software which is written entirely in PHP, but the install
bit fails and I was told this was because PHP
has to run as a module.
For me for some reason editing the httpd.conf didn't seem to work, so
eventually I deleted it, took the httpd_default.conf
file saved that as httpd.conf, added the lines from the PHP manaul for a module
and now it all works. More importantly some of
the scripts I've written are quite complex, I've tested the most complex ones
and they are all still working as well.
Thanks to everyone who replied for the help they provided.
Blu
Luis Moreira wrote:
> If you don't have errors, then probably PHP is starting but there is
> some other problem.
> My HTTPD.CONF is as follows, and it runs fine.
>
> Luis
>
> #
> # ScriptAlias: This controls which directories contain server scripts.
> # ScriptAliases are essentially the same as Aliases, except that
> # documents in the realname directory are treated as applications and
> # run by the server when requested rather than as documents sent to the
> client.
> # The same rules about trailing "/" apply to ScriptAlias directives as to
> # Alias.
> #
> # ScriptAlias /cgi-bin/ "d:/program files/Apache Group/Apache/cgi-bin/"
> ScriptAlias /php/ "c:/php/"
> ScriptAlias /php/ "d:/myweb/scripts_php/"
> ScriptAlias /php/ "d:/Songahm_management/"
>
> #
> # AddType allows you to tweak mime.types without actually editing it, or to
> # make certain files to be certain types.
> #
> AddType application/x-tar .tgz
> AddType application/x-httpd-php .php .phtml
> AddType application/x-httpd-php-source .phps
>
> #
> # Action lets you define media types that will execute a script whenever
> # a matching file is called. This eliminates the need for repeated URL
> # pathnames for oft-used CGI file processors.
> # Format: Action media/type /cgi-script/location
> # Format: Action handler-name /cgi-script/location
> #
> Action application/x-httpd-php /php/php.exe
>
>
> blulagoon wrote:
>
> >I've looked in the apache error.log file, but there are no entries logged
> >there when apache fails to start.
> >
> >I think you could make the case either way as to which group is more
> >relevant here, PHP or Apache.
> >
> That's what I meant
>
> > However I'm sure there
> >are lots of people here who use PHP with Apache running under Windows,
> >
> Me, for one
>
> >and hopefully some of them will have switched between
> >cgi and module mode and be able to tell me what I'm doing wrong.
> >
> >
> That, I didn't do.
>
> >Apologies to IIS users to whom this thread is of no interest.
> >
> >Luis Moreira wrote:
> >
> >
> >
> >>This is a PHP list, and there is an Apache one were this problem fits
> >>better.
> >>Go to www.apache.org and subscribe it.
> >>Meanwhile, do you have an error log to look at ?
> >>What does it say ?
> >>
> >>Luis
> >>
> >>blulagoon wrote:
> >>
> >>
> >>
> >>>Thanks Dean. I've commented out the lines that say:
> >>>
> >>>Action application/x-httpd-php /php/php.exe
> >>>ScriptAlias /php/ "C:/php/"
> >>>
> >>>which I think are involved with cgi, but I don't know enough about the
> >>>configuration files to know what else it uses,
> >>>but with those lines '#' out, the two new lines added and all my addtype
> >>>lines together, again Apache refuses to start.
> >>>Do you have any idea if any other lines need to be disabled, the two above
> >>>are the only ones mentioned in the
> >>>install.txt file
> >>>
> >>>Thanks again for your help.
> >>>
> >>>Dean Hayes wrote:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>Yes remove all the lines that relate to running PHP as a CGI u can not run
> >>>>both at the same time
> >>>>
> >>>>Sorry forgot to say this before did not think about it
> >>>>
> >>>>Dean "The Insane Guy" Hayes
> >>>>
> >>>><-- I design and i redesign but still i never designed true beauty like
> >>>>you
> >>>>-->
> >>>>
> >>>>~~~ Call me Insane call me Crazy but there is one thing i know i am That
> >>>>is
> >>>>someone that shall reach peoples hearts with words ~~~
> >>>>
> >>>>~~ PHP seems easy enough but what about this ASP now that looks hard ~~
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >
> >
> >
--- End Message ---
--- Begin Message ---
I haven't bothered to benchmark this, but here is my own solution to
this problem. If you already have a common file that you are including
in every script then the cost should be very low. Feel free to use it
if you prefer.
Apache
htdocs
site1
includes
common.php
test_include.php
testfolder
test2.php
site2
includes
(those four files)
etc...
<!-- common.php -->
<?php
$basedir = dirname(__FILE__) . '/';
?>
<!-- test_include.php -->
<?
include_once common.php;
/** Now you can include files relative to the base directory */
include_once $basedir . 'testfolder/test2.php';
?>
--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
--- End Message ---
--- Begin Message ---
The inludes folder is thrown around as more of a
generic term for a directory that includes important
files. Is this a pretty good definition for the
purpose of an 'includes' folder?
Also, I've seen the following syntax before:
(__FILE__). Why the underscores?
thanks-
--- Jason Barnett <[EMAIL PROTECTED]> wrote:
> I haven't bothered to benchmark this, but here is my
> own solution to
> this problem. If you already have a common file
> that you are including
> in every script then the cost should be very low.
> Feel free to use it
> if you prefer.
>
> Apache
> htdocs
> site1
> includes
> common.php
> test_include.php
> testfolder
> test2.php
> site2
> includes
> (those four files)
> etc...
>
> <!-- common.php -->
> <?php
>
> $basedir = dirname(__FILE__) . '/';
>
> ?>
>
> <!-- test_include.php -->
> <?
>
> include_once common.php;
> /** Now you can include files relative to the base
> directory */
> include_once $basedir . 'testfolder/test2.php';
>
> ?>
>
>
> --
> Teach a person to fish...
>
> Ask smart questions:
> http://www.catb.org/~esr/faqs/smart-questions.html
> PHP Manual: http://php.net/manual/
> php-general archives:
> http://marc.theaimsgroup.com/?l=php-general&w=2
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
=====
----------------
"forget your lust for the rich man's gold. All that you need, is in your soul.
You can do this if you try. All that I want for you my son, is to be satisfied"
~ Lynard Skynard
--- End Message ---
--- Begin Message ---
Patrick Roane wrote:
The inludes folder is thrown around as more of a
generic term for a directory that includes important
files. Is this a pretty good definition for the
purpose of an 'includes' folder?
Sure, that's a fine definition. And the setup that I proposed isn't the
only way to do it, but the basic idea is this: if you have a common file
that gets included with every script then you can use the directory
where this file is located as your "home" directory.
Also, I've seen the following syntax before:
(__FILE__). Why the underscores?
thanks-
__FILE__ is a "magic" constant. There are several "magic" constants:
See the user-contributed notes on this page:
http://php.net/manual/en/language.constants
and see also this page:
http://php.net/manual/en/language.constants.predefined.php
--
Teach a person to fish...
Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2
--- End Message ---
--- Begin Message ---
Hi,
My server is on dynamic IP and I'm using NO-IP.com (or similar service)
to get a boring-weeeird-name.com :) Now, is it possible to send email
via PHP thru that server? Or do I need to use some sort of command-line
MUA / mail client to enable sending EMAILS using PHP?
Using the Apache 1.3.33, PHP5 on Win XP Pro. Please advise.
Thanks.
Hassan
--- End Message ---