Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2004, 03:38 PM
Registered User
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using Php4 Apache and windows 98

Hello,

I downloaded php version 4.3.5-win32 and apache 2.0.49.

The beginning php4 does not detail how to configure php4, apache and windows.

Could anyone take me through the steps to setup and configure?

Thank you
Stephen






 
Old March 27th, 2004, 08:08 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hi have a look at the manual page here:
http://www.php.net/manual/en/install.apache2.php

If you're still having problems let us know!

: )
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old March 28th, 2004, 10:17 AM
Registered User
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for replying.

There seems to be many comments on the pages you recommended.

Should I be adding the lines below to httpd-win.conf, and this only?.

The web has many sites which detail the setup for php4 and apache2 in windows98. These include copying php4 *.dll files to windows and windows/system. And creating a php4.ini file in windows/ should I be doing this also?

The sites also refer to httpdocs, but in my apache version there is only a directory docs which includes the directory conf. And file httpd-win.conf.

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"

 
Old March 28th, 2004, 05:36 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Quote:
quote:
Should I be adding the lines below to httpd-win.conf, and this only?.
There should be a file simply titled httpd.conf.. perhaps this is something new since I last downloaded Apache.

If Apache is installed to 'C' then this is where it should be found:
C:\Apache Group\Apache2\conf\httpd.conf

If the 'httpd-win.conf' is the only file resembling this in the directory, rename it to httpd.conf and make the modifications.

Apache has to be restarted after every modification to the configuration file.
If you get an error stating something to the effect of 'requested operation has failed' then you'll know something went wrong.

If you modify the php.ini file and PHP is configurated as an Apache module, Apache has to also be restarted after every modification to that configuration file as well.

Test your PHP install by running the following script...
(Save as test.php or phpinfo.php)

<?php
phpinfo();
?>

This outputs a detailed table of PHP configuration settings.

Apache's default serving directory is 'htdocs'... so this is where you need to save your web-accessible files. I changed mine cause I didn't think that very efficient, you can modify that by finding the DocumentRoot line and appending the file path like this:
DocumentRoot "F:/www"
Now webpages are served from the F:\www directory.

If you want to use an index.php file instead of an index.html file for the default loading page modify this line:
DirectoryIndex index.php index.html index.html.var

You can also tell the PHP interpretter to parse .html files (or whatever other extension) by adding this:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html

I would suggest installing PHP as an Apache Module, instead of as a CGI.. the difference means a huge boost in preformance. Since the php.ini file doesn't have to opened every time a script is executed. And its also more secure. This is also discussed on the manual page I mentioned:

Example 3-8. PHP and Apache 2.0 as Module

; For PHP 4 do something like this:
LoadModule php4_module "c:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php

; For PHP 5 do something like this:
LoadModule php5_module "c:/php/sapi/php5apache2.dll"
AddType application/x-httpd-php .php

BTW: locate the php4apache2.dll file to be sure the file path is correct (I don't think PHP 5 stores this in a sub-directory, if it is PHP 5 you're installing).

PHP installed as an Apache module also requires dropping a .dll in the system32 directory:
 move php4ts.dll for PHP 4, or php5ts.dll for PHP 5 to the C:\Windows\system32\ directory.

These .dll files are in the .zip download of PHP.

All that make sense?
hth,
: )
Rich


::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old March 30th, 2004, 03:06 PM
Registered User
 
Join Date: Mar 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for replying.

I found this link on wroxs beginning php4 support http://www.tanguay.de/wamp2004/ and followed all the instructions. But when I ran http:/localhost/ or http://localhost/test.php

Nothing happens, and there is no error message.

This example setup is for windows xp and I am using windows98. Though I thought it would work the same in both versions.

I wondered if the example setup was correct?

Thank you






Similar Threads
Thread Thread Starter Forum Replies Last Post
.net on Windows 98 sh.rajkumar C# 2005 1 October 23rd, 2006 03:53 AM
all in one, php4/mySQL/phpMyAdmin/Apache server? adamhh PHP How-To 5 September 17th, 2006 05:29 AM
Need help with installing PHP4 on Apache 2 Asix BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 November 28th, 2004 03:59 PM
Config Apache 2.0.49 for PHP4.3.5Win32 Domonsura BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 July 22nd, 2004 04:32 AM
Windows 98 OCX control issues vs Windows XP benoyraj VB How-To 0 May 5th, 2004 08:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.