PDA

View Full Version : PHP Testing



bozzner
January 27th, 2004, 08:57 PM
Help!
I am newbie. I am trying to setup a web server on my computer at home, with Apache 2.0. My machine is running Windows XP pro. I updated the machine with the lastes service pack.

I installed Apache and it works fine. The test page comes up properly.

I installed PHP and trying to test it. I just get the test code displayed. <? php phpinfo();?>

Any help on what to do?

P.S. I am not sure what directory to save the php tets file in. I save it in several places, in the Apache directory, in the programs directory.


Any help will be appreciated.

Thanks

Yeldarb
January 27th, 2004, 10:30 PM
save in the www directory, then you must type http://(IP)/file.php to see it.

Yeldarb
January 27th, 2004, 10:30 PM
save in the www directory, then you must type http://(IP)/file.php to see it.

Voetsjoeba
January 28th, 2004, 07:11 AM
You don't seem to have the PHP module installed. There a great tutorial on how to do this at http://www.ricocheting.com/server/index.html

norie
January 28th, 2004, 01:00 PM
Originally posted by Yeldarb
save in the www directory, then you must type http://(IP)/file.php to see it.
http://localhost/file.php

works too.

on apache the folder is

directory where you installed\Apache Group\apache2\htdocs\file.php

something like that. :)

bozzner
January 28th, 2004, 09:07 PM
Still Not Working?
I tried everything, suggested. I read and reinstall everthing from scratch. No response.
I did a version check at the dos prompt php-v and i get see below:

C:\PHP>php -v
PHP 4.3.4 (cgi-fcgi) (built: Nov 2 2003 23:47:22)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

C:\PHP>

I know the module is working.

Please any suggestions, will be appreciated.

Thanks

Jubba
January 28th, 2004, 09:14 PM
did you edit the httpd.conf file in the Apache directory?

bozzner
January 28th, 2004, 09:30 PM
Vash,

Yes. I did edit the httpd.conf file. The Apache test installation page come up fine.

Jubba
January 28th, 2004, 09:32 PM
you edited it to tell it where the php.exe file lies and the extensions to recognize?

where is the PHP folder?

bozzner
January 28th, 2004, 09:50 PM
Vash,

The PHP folder is in c:\php\

I am not sure what do you mean by tell it where php.exe is? The instructions, did not say to edit anything about php.exe.

I am using several installation instructions, and they are all basically the same. The automatically assume that this is a very simple process. Somehow I can't get mine to work.

Thanks

Jubba
January 28th, 2004, 09:56 PM
Scroll down to the bottom of the httpd.conf file and add these lines:


ScriptAlias /php/ "__PATH TO PHP FOLDER__"
AddType application/x-httpd-php .php
Action application/x-httpd-php "__PATH TO PHP.EXE__"

for the first part its something like "c:/php/"

and the third line should be "/php/php.exe" or something similar...

bozzner
January 29th, 2004, 07:18 PM
Vash,

Tried what you suggested, did nopt work. I stopped and restarted the Apache server after I edited the httpd.conf file.

Any other suggestions.

Jubba
January 29th, 2004, 08:41 PM
has to be something simple where is your php folder located? where is your apache folder located? and what did you put in the httpd.conf file?

bozzner
January 30th, 2004, 03:11 PM
Vash,

I am sure that you are correct. What confused me more are when to use / and \ and " ". I cannot tell the difference.

I know Apache has two directories,

1) c:\Apache\Apache2
2) c:\programs\apache\apache2

PHP is in C:\php

when I edit the httpd.conf file I am sometimes confused when to use the /, \ and " ".

Thanks

Jubba
January 30th, 2004, 05:56 PM
try putting these three lines at the bottom of the httpd.conf file in the c:\programs\apache subdirectory...


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

that should be what you need... other than that I am not sure... just make those changes... save the file and then restart apache...

sinus_
February 2nd, 2004, 10:08 AM
correct me if im wrong, but is there a space between <? php ???
i always use <?php... (no space)...
if so, try <?php phpinfo(); ?>

try to use <?php ?> with no space between <? and php just <?php than close the tag at the end...

also, when u get the phpinfo() thing up and running, ul know important stuff like where ur php.ini is located

Jubba
February 3rd, 2004, 10:18 PM
technically you don't even need php. just <? will do. He doesn't have PHP running on his server because if he didn't then we would get a parse error and he wasn't experiencing that...