Page 1 of 1

The first try, however failed

Posted: Tue Mar 21, 2006 8:19 pm
by zhshqzyc
I just setup apache2.0,mysql 5.0 and php 5.
My Apache is installed at c:\Programs Files\Apache Group\Apache2
My MySql is installed at c:\MySQL
My Php is installed at c:\php

I save a php file named as a.php at c:\Programs Files\Apache Group\Apache2\htdocs
My web is http://127.0.0.1
We I input http://127.0.0.1/a.php

"The request URL is not on the server"

What is wrong?

Posted: Tue Mar 21, 2006 8:36 pm
by feyd
did you follow the installation instructions for PHP with Apache 2?

Moved to Web Servers.

Posted: Wed Mar 22, 2006 8:01 am
by zhshqzyc
Yes, I did.

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



However, I didn't do :
# configure the path to php.ini
PHPIniDir "C:/php"

because I couldn't find PHPIniDir in php.ini

Is it the cause?

Posted: Wed Mar 22, 2006 8:25 am
by Benjamin
Where did you put a.php?

It's not supposed to go into C:/php, it needs to go in your web document root.

Posted: Wed Mar 22, 2006 8:47 am
by feyd
PHPIniDir is a directive for the httpd.conf file, not in the ini itself. The string details the location of the ini so PHP can find the correct one when it searches for it.

Posted: Wed Mar 22, 2006 9:21 am
by zhshqzyc
a.php
locates at
c:\Programs Files\Apache Group\Apache2\htdocs

Posted: Wed Mar 22, 2006 10:16 am
by RobertGonzalez
Test a few things. First, on your machine, in your browser address bar, enter http://localhost/.

If you have not installed any files in the C:\Program Files\Apache Group\Apache2\htdocs folder you should get the generic Apache index page telling you the server is set up correctly. If that works, then...

Create a "hello world" HTML page and save it as C:\Program Files\Apache Group\Apache2\htdocs\hello.html. Call it using localhost:

Code: Select all

<html><head><title>Test HTML Page</title></head><body>Hello World!</body></html>
http://localhost/hello.html

If that works then...
Open up your httpd.conf file located in C:\Program Files\Apache Group\Apache2\conf folder and make sure there is a LoadModule and AddHandler that tells apache to actually parse PHP though the PHP engine. If they are there then make a phpinfo page and save it as C:\Program Files\Apache Group\Apache2\htdocs\php-info.php.

Code: Select all

<?php
phpinfo();
?>
Call it like this...

http://localhost/php-info.php

If that doesn't work, post back and let us know what is happening.

Posted: Wed Mar 22, 2006 9:18 pm
by zhshqzyc
http://localhost/. doesn't work.
I set
UserDir "My Documents/My Website"
is different the DocumentRoot C:\Program Files\Apache Group\Apache2\htdocs

Is it a problem?

Posted: Wed Mar 22, 2006 9:57 pm
by neophyte
make sure httpd is running in the task manager and make sure IIS is shut off. If you're running xp pro check services running in your system manager.

Posted: Wed Mar 22, 2006 10:07 pm
by neophyte
I'd add at the least make sure you don't have two webservers trying to listen at the same time to port 80....

Posted: Thu Mar 23, 2006 9:35 am
by tasteslikepurple
there's a good apache/php/mysql/just about everything else you need on a webserver package out there called xampp. it's an easy install and it works straight away :)

http://www.apachefriends.org/en/xampp.html

p.s. uninstall all apache and php stuff first