httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pete Nelson" <pete.nel...@ci.stpaul.mn.us>
Subject Re: Getting Apache running locally for test purposes
Date Tue, 14 May 2002 14:33:30 GMT
If you downloaded the PHP installer (as opposed to the zip file) you
probably only have the CGI (executable) version.  The windows zip
package contains the executable and modules for popular web servers
(including Apache 1.3 and 2.0).

To use the module, you'll need to make sure that the proper libraries
are in your system path - see
http://www.php.net/manual/en/install.windows.php for complete
instructions.  Then for setting it up with Apache 1.3.x, you only need
the two lines:

  LoadModule php4_module "C:/My Programs/php/sapi/php4apache.dll"
  AddType application/x-httpd-php .php .phtml

(See
http://www.php.net/manual/en/install.apache.php#install.apache.windows
for more info).

If you attempt to load php4 as a module, and you receive errors about
libraries or dynamic links not being found, take a look again at the
instructions for installing on windows. You probably missed copying a
library into your system directory.

Really, unless you're using session variables or persistant database
connections, the CGI should do you fine for testing purposes.

--
Pete Nelson, Web Developer
<pete.nelson@ci.stpaul.mn.us>
http://www.ci.stpaul.mn.us/

>>> the_radix@hotkey.net.au 05/14/02 09:09AM >>>
hmm

I must be using it as a CGI exec then.. damn..


where can I get the php module from?


or is it already in the apache2 package??



thx for pointing that out..

:::::::::::::::::::::::::::::::::::::::::::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  the_radix@hotkey.net.au 
:  ABN: 64 235 749 494
:  QUT Student #: 04475739
:::::::::::::::::::::::::::::::::::::::::::
----- Original Message ----- 
From: "Pete Nelson" <pete.nelson@ci.stpaul.mn.us>
To: <users@httpd.apache.org>
Sent: Tuesday, May 14, 2002 11:43 PM
Subject: Re: Getting Apache running locally for test purposes


> There are basically two ways to run PHP - as an outside program that
> runs every time a php-request is made (CGI), or as a module that
loads
> with Apache at startup and handles requests.  The configuration
options
> are a little different, and that may be one point of confusion.
> 
> It looks like you're trying to use it as a CGI, which is fine for
> testing php (the module offers faster performance, and is usually
the
> choice for a production environment).  Basically what you need to
tell
> Apache is 1) where the php executable is and 2) what type of files
> should be run through the php executable.
> 
> The ScriptAlias (as you've done in your example) sets up two things
-
> it aliases the directory containg php into your server's path, and
tells
> Apache to 'execute' any requests in that directory:
> 
>   ScriptAlias /php/ "C:/My Programs/PHP/"
> 
> Now, you must let Apache know that .php files should be treated
special
> by setting a special MIME-type:
> 
>   AddType application/x-httpd-php .php .php3 .php4 .phtml
> 
> (Note that you can add as many file extensions as you wish)
> 
> Finally, tell Apache how to handle these special files:
> 
>   Action application/x-httpd-php /php/php.exe
> 
> At this point, (re)start Apache and test.  If you're still having
> trouble, I would do the following to test:
>   
>  - open a command prompt in the php directory.  Copy your
phpinfo.php
> file into that directory and test with "php -f phpinfo.php".  You
should
> either see a lot of HTML code scroll by (success) or a bunch of
errors. 
> This will tell you if php is working or not.
> 
>  - if you think the problem might be Norton, try turning it off to
> test.
> 
>  - if possible, use a browser other than IE.  Especially for
testing,
> I've found that IE often pulls files from it's cache (even when it
> shouldn't).  I've had problems that I've actually fixed but didn't
know
> it because IE was pulling an old error document from it's cache
rather
> than pulling the page from the server.
> 
> --
> Pete Nelson, Web Developer
> <pete.nelson@ci.stpaul.mn.us>
> http://www.ci.stpaul.mn.us/ 
> 
> >>> adriangreeman@pixandwords.freeserve.co.uk 05/14/02 04:11AM >>>
> Excuse a newby asking what might be a stupid question.
> 
> I am trying to learn PHP and to do so need a local server so
> I have downloaded Apache (1.3.24). and PHP 4.2.0 Win32.    I use
> Windows ME on a standalone PC and will run the server just to
> test my PHP knowledge and hopefully eventually develop a website
using
> MySQL.
> 
> Guidance for getting this running seems to vary but I have gone with
> stuff in a couple of places - the book  "MySQL/PHP Databases" and an
> article from thesitewizard.com
> 
> They more or less agree on what you have to write into the Apache
> configuration file to get it going and recognising PHP (recognising
> .php extensions, and entering
> ScriptAlias   /php/  "C:/My Programs/PHP/")
> 
> I have done this and I have written "phpinfo" function in a test php
> file.
> 
> Right. So it should work.
> 
> The Apache server Starts from Windows Start, and I checked the
syntax
> in the file which is correct
> It says it's running - took a while to get that  - and after some
> messing the IE6 browser seems to find it, when I am requesting the
> recommended phpinfo.php file.
> 
> I use http://localhost/phpinfo.php 
> 
> But all I get is a big "forbidden".
> 
> I am not allowed access to the file phpinfo.php  (or misspellings of
> it I also found out).
> 
> FAQs says for this problem check the Apache httpd.conf file looking
> for <Files~>
> but zilch there.
> 
> I am slightly daunted by the deep water of the users discussions and
> manuals but have battled with them to some extent.  May I ask if
> anyone on this list can suggest what I have done wrong - or point me
> at previous discussions or the right manual pages??
> 
> Possibly useful information :
> 
> 1. I am uncertain about where the php.ini file should go -
> in the article and the book and the
> PHP site information the recommentdations seem to vary.
> 
> Suggestions are in:
> 
> same directory as php.exe
> or Windows
> or Windows\System
> or Windows\System32
> 
> I tried each and currently it is in Windows
> 
> 
> One other piece of information is that I have Norton Anti-Virus on
the
> computer and it did try messing with the settings in the config file
-
> could that be the reason?  eg it set the e-mail to admin@norton
> ['scuse that's not the full name]
> 
> and the server name to Norton Antivirus
> 
> - though I have changed that to 127.0.0.1
> 
> 
> Please suggest what else I should try to do.   Or should I start
over?
> 
> 
> 
> Regards from
>     Adrian Greeman
> 
> 52 Salterford Road, Tooting, London, SW17 9TF
> 
> Phone  +44 (0)20 8672 9661
> Mobile  +44 (0)780 329 7447
> 
> Fax:  I can receive these
> on the computer
> but only when present
> - please phone first
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
> For additional commands, e-mail: users-help@httpd.apache.org 
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
> For additional commands, e-mail: users-help@httpd.apache.org 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org 
For additional commands, e-mail: users-help@httpd.apache.org 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message