Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Problem with php5 testing with Apache2.0 web server |
|
Author |
|
PickOn
Joined: 25 Jun 2007 Posts: 16
|
Posted: Mon 25 Jun '07 13:06 Post subject: Problem with php5 testing with Apache2.0 web server |
|
|
Hello all,
I'm having problem on testing a simply hello.php file script testing which was save on a folder in my Document Folder that look's like this,
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>
I' ve follow almost all the step by step of the php5 manual installation and configuring with Apache2.0 on CGI binary method of system on window XP operating system upgraded from Home Edition, which looks OK and my Apache server also running OK? with follow-up of the (FAQ) on php.net website with also the step on this tutorials site
http://www.educar.pro.br/en/ but still no Joy to see my first page "Hello Word!" I use to work with ActivePerl scripting language which I uninstalled for PHP5, will someone Pls look at the Error file below and give me some help on what I'm missing or to do and see it work and thanks for your help!!!
[Mon Jun 25 07:14:23 2007] [warn] pid file C:/Program Files/Apache Group/Apache2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Jun 25 07:14:23 2007] [notice] Apache/2.0.59 (Win32) configured -- resuming normal operations
[Mon Jun 25 07:14:23 2007] [notice] Server built: Jul 27 2006 15:55:03
[Mon Jun 25 07:14:23 2007] [notice] Parent: Created child process 1872
[Mon Jun 25 07:14:24 2007] [notice] Child 1872: Child process is running
[Mon Jun 25 07:14:25 2007] [notice] Child 1872: Acquired the start mutex.
[Mon Jun 25 07:14:25 2007] [notice] Child 1872: Starting 250 worker threads.
[Mon Jun 25 08:41:48 2007] [notice] Apache/2.0.59 (Win32) configured -- resuming normal operations
[Mon Jun 25 08:41:48 2007] [notice] Server built: Jul 27 2006 15:55:03
[Mon Jun 25 08:41:48 2007] [notice] Parent: Created child process 1576
[Mon Jun 25 08:41:48 2007] [notice] Child 1576: Child process is running
[Mon Jun 25 08:41:48 2007] [notice] Child 1576: Acquired the start mutex.
[Mon Jun 25 08:41:48 2007] [notice] Child 1576: Starting 250 worker threads.
[Mon Jun 25 08:44:36 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/hello.php
[Mon Jun 25 08:53:20 2007] [error] [client 127.0.0.1] Directory index forbidden by rule: C:/Documents and Settings/My Username/My Documents/My Website/ |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 27 Jun '07 9:13 Post subject: |
|
|
Quote: |
[Mon Jun 25 08:44:36 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Group/Apache2/htdocs/hello.php
[Mon Jun 25 08:53:20 2007] [error] [client 127.0.0.1] Directory index forbidden by rule: C:/Documents and Settings/My Username/My Documents/My Website/
|
There are two errors. Did you change the doc root, but not the permission for it? The second error seems that you enabled mod_userdir, don't you?
Windows with default setting does not show known file extensions. Make sure that your file name is not hello.php.txt
How did you enable php in your httpd.conf. Please post that few lines. |
|
Back to top |
|
PickOn
Joined: 25 Jun 2007 Posts: 16
|
Posted: Wed 27 Jun '07 17:05 Post subject: |
|
|
Hi, I'm very please to hear from you thank's!!!
* well yes, I do play with that part or the doc_root and without the Permission for it Cuz I was having some misunderstanding on how to work with the Files and Folders Permission under XP, but after enable it with the un check I can now easily do it with File/Folder Sharing Permission or with the Security tab method!!
** enabled mod_Userdir, I also try to configure with Directive Directory sa well within the httpd.conf, with almost all the step and basic manual method of installing php5 and Apache2.0 with configuring and testing the hello.php within the httpd.conf of the Apache, just to first see if my browse will show the print content of the hello.php File,
I most been mistaking which I do know on the configuring of httpd.conf for whether on the CGI binary method or Apache module DLL, which I do mix-up around a little between the two type of method in my httpd.conf at first and with the php.ini File also?
*** for the File extensions, I do make sure for the Save-As before the Saving of the hello.php file, I clear the .txt, and I select All File before Saving to hello.php extension on a Folder in My Document path? but I don't know if there is also another way for me to verify and make sure File name is not, hello.php.txt, or to cancel the Default setting when using it all together? Cuz I'm using Note Pad only, pls let me know if ther is another way from this of my method also thanks!!
Hmm, this is a new Face of the configuring with enable of php in my httpd.conf, take a look in this new one in all or this bit?
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Be especially careful to use
# proper, forward slashes here. On Windows NT, "Personal/My Website"
# is a more appropriate choice.
#
UserDir "My Documents/My Website"
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
# You must correct the path for the root to match your system's configured
# user directory location, e.g. "C:/WinNT/profiles/*/My Documents/My Website"
# or whichever, as appropriate.
#
# <Directory "C:/Documents and Settings/My Username/My Documents/My Website">
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </LimitExcept>
# </Directory>
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
# The index.html.var file (a type-map) is used to deliver content-
# negotiated documents. The MultiViews Option can be used for the
# same purpose, but it is much slower.
#
DirectoryIndex index.html index.html.var index.php
***********************************************************
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 /php5/ "C:/php"
#
# "C:/Program Files/Apache Group/Apache2/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/Php">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
After all that my new Error File show this, and on the browse for hello.php file you can see the html conten <title> PHP Test</title> but not <?php echo' <p>Hello world</p>'; ?> and I also make a new phpinfo.php file to test, Pls take a look on the new error,
[Tue Jun 26 13:13:34 2007] [notice] Child 3792: Child process is exiting
[Tue Jun 26 13:14:00 2007] [error] [client 127.0.0.1] client denied by server configuration: C:/Documents and Settings/My Username/My Documents/My Website/hello.php
[Tue Jun 26 13:14:25 2007] [error] [client 127.0.0.1] client denied by server configuration: C:/Documents and Settings/My Username/My Documents/My Website/phpinfo.php
[Tue Jun 26 13:14:34 2007] [error] [client 127.0.0.1] client denied by server configuration: C:/Documents and Settings/My Username/My Documents/My Website/phpinfo.php
[Tue Jun 26 13:14:58 2007] [error] [client 127.0.0.1] client denied by server configuration: C:/Documents and Settings/My Username/My Documents/My Website/hello.php
[Tue Jun 26 13:26:54 2007] [error] [client 127.0.0.1] File does not exist: C:/Documents and Settings/My Username/My Documents/My Website/phpinfo.php
***********************************************
Pls on the first two Error doc_root and enabled mod_Userdir?
wil you give me a brief idea with doc_root and the way of setting Permission for it, whether I can still use the same method as I said with permission on File/Folder sharing method permission or using the Security tab way also, if difference with the way to do the doc_root permission and how do I do it??
Thanks!! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 28 Jun '07 9:37 Post subject: |
|
|
in httpd.conf # disables a line! So you have to remove that to enable.
make sure that mod_userdir is loaded
LoadModule userdir_module modules/mod_userdir.so
I think this should work. I tried it out. And here it works fine.
Code: |
UserDir "C:/Documents and Settings/*/My Documents/My Website"
<Directory "C:/Documents and Settings/*/My Documents/My Website">
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</LimitExcept>
</Directory>
|
Than you should be able to call http://localhost/~username e.g http://localhost/~Administrator
No, you don't have to change any windows persmission! Don't do that!
If you change the doc root you have to change the persmission inside httpd.conf
e.g.
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
and than search for
# This should be changed to whatever you set DocumentRoot to.
Code: |
#### here must the same path!!
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
|
How to set up PHP you can read here. Ignore the part of installing apache and go to PHP section
http://www.apachelounge.com/viewtopic.php?t=570 |
|
Back to top |
|
PickOn
Joined: 25 Jun 2007 Posts: 16
|
Posted: Thu 28 Jun '07 14:25 Post subject: |
|
|
Hi, I try to load my browser with http://localhost/~username e.g http://localhost/~Administrator after uncomment #, my userdir and so on when I call it it give me the same Error Forbidden
and I try also to uncomment some of the Loadmodule, when try to Restart my Apache then it give me and Error and stop working, I also try and re-do the changes to get it back working and I even turn off my PC then turn it on back and it still stop with no respond when I check the Test configuration it gives me this Error
[Thu Jun 28 10:41:37 2007] [warn] module userdir_module is already loaded, skipp
ing
Syntax error on line 323 of C:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
<Directory "C:/Documents and Settings/My Username/My Documents/My Website"> p
ath is invalid.
Note the errors or messages above, and press the <ESC> key to exit. 15...
Syntax error on line 148 of C:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
LoadModule takes two arguments, a module name and the name of a shared object fi
le to load it from
Note the errors or messages above, and press the <ESC> key to exit. 18...
Pls any more ideas will be still helpful!!
Thank! |
|
Back to top |
|
PickOn
Joined: 25 Jun 2007 Posts: 16
|
Posted: Fri 29 Jun '07 18:36 Post subject: Apache Still not working? |
|
|
Hi, I still unable to start Apache, it looks so weird now any idea you can think off? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 29 Jun '07 21:50 Post subject: |
|
|
Quote: |
Thu Jun 28 10:41:37 2007] [warn] module userdir_module is already loaded, skipp
|
This means that the module is loaded twice. Watch for that
Quote: |
Syntax error on line 323 of C:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
<Directory "C:/Documents and Settings/My Username/My Documents/My Website"> p
ath is invalid.
Note the errors or messages above, and press the <ESC> key to exit.
Syntax error on line 148 of C:/Program Files/Apache Group/Apache2/conf/httpd.con
f:
LoadModule takes two arguments, a module name and the name of a shared object fi
le to load it from
|
search that line and post it or we can't help!
if fast needed send your whole httpd.conf to my mail JBlond__gmail__com
--------
edit
-------
if you use the mod_userdir config I've postet, keep the " * " it is needed as a wildcard. |
|
Back to top |
|
PickOn
Joined: 25 Jun 2007 Posts: 16
|
Posted: Mon 02 Jul '07 21:23 Post subject: |
|
|
Hi, I was not sure you could have found this, cuz I myself look all over the forum post I couldn't found this my posting, before trying your own access on this way, So I've uninstalled my Apache2.0.59 and php5.2.3 with a clean new install one and it works!! but the problem still remain the same I was still unable to run the php5.2.3 with the Apache2.0.59 on the same CGI binary script, when I try with all the steps I got HTTP 404 ERROR MESSAGE you know I got a little knowledge on this Apache and php programming for I still can't figure out what realy is the problem without it working, whether my .php files show be on My Document Folder or within the Apache2 Folder or is the PHP5.2.3 way of configure is the problem if only I'll get a full working httpd.conf configuration Apache2.0.59 with a php5.2.3 on the first out look to see where this and this gose to show the first setup for a .php script I think that could be a very big help in to my continuous learning whit this CGI binary method?
Pls any idea will be welcome thanks.
I've spam so much and sorry for that! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 03 Jul '07 10:36 Post subject: |
|
|
Use the forum search. search words php fcgi
There are a lot of topics about that. |
|
Back to top |
|
PickOn
Joined: 25 Jun 2007 Posts: 16
|
Posted: Tue 03 Jul '07 13:31 Post subject: |
|
|
Thanks!! |
|
Back to top |
|
|
|
|
|
|