PHP not

jlowry

Guppy
Hi, I am new to php and mysql. I have them installed on Win/XP and also on Linux.
I have been trying to get a simple example to run and am having problems getting it to display. I have run the phpadmin test and it works just fine, but when I try a simple script like 'hello world', I get the headings but the php script does not get read, that I can tell. One of the scripts I am using is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Hello World in PHP</title>

</head>
<body>
<?php echo "<p>Hello, World!</p>"; ?>
</body>
</html>

the Hello World! from php does not get display.

Any help is appreciated,

thanks
jlowry
 
jlowry said:
Hi, I am new to php and mysql. I have them installed on Win/XP and also on Linux.
I have been trying to get a simple example to run and am having problems getting it to display. I have run the phpadmin test and it works just fine, but when I try a simple script like 'hello world', I get the headings but the php script does not get read, that I can tell. One of the scripts I am using is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Hello World in PHP</title>

</head>
<body>
<?php echo "<p>Hello, World!</p>"; ?>
</body>
</html>

the Hello World! from php does not get display.

Any help is appreciated,

thanks
jlowry

I tried your code on my account on the Linux server and it worked ok. By chance are you not using a .php extension on the file?

I used the .php extension and it worked, when I changed the extension to .html, it did not work.
 
Either that, or PHP is not enabled for that website from the control panel. Make sure you use the 'apply changes' link if you enable it.
 
Thanks, for the info...

I figured out what the problem was. My web browser was not setup to use php as an application. Changed the configuration file and all is well.

thanks
 
Sorry...

jlowry said:
My web browser was not setup to use php as an application. Changed the configuration file and all is well.

thanks

How did you know, and how you changed the configuration (I use Win2000 and seems that I have trouble like yours)
Sorry... I guess it's a silly question
thank you
 
1. Installed php4 into directory....mine is C:\php4
2. Run the Pear installation script
- move php.ini-recommended to C:\windows\php.ini

3. Installed Apache 2.x using the defaults
4. Modified httpd.conf with the following lines in there respective places:

- DirectoryIndex index.html index.php index.html index.php.var
- ScriptAlias /php4/ "C:/php4/"
- AddType application/x-httpd-php .php .phtml .html
AddType application/x-httpd-php-source .php
- Action application/x-httpd-php /php4/php.exe
- LoadModule php4_module C:\php4\php\php4apache2.dll

:) hope this helps.
 
Back
Top