Can't get php to work
Moderator: General Moderators
Can't get php to work
HI there. I'm new to both this forum and proggramming php.
I downloaded the latest php(4.3.2) and manually installed it, and then i installed the latest Apache(2.0.46) via the installer.
The problem is, i inserted the "hello world" example into the apache folder, and all i get is the heading and nothing else. Hello world does not appear on the web page. The echo function does not seem to work.
An example of the "hello world" example....
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo "<p>Hello World</p>"; ?>
</body>
</html>
I can get it to work using a html extension, but only gives me the heading when using the php extension.
Here's a list of things i did....
copied c:\\php\php4ts.dll to c:\\winnt\system32
copied c:\\php\php.ini-reccomended to c:\\winnt and renamed it to php.ini
set doc root in php.ini file to point to apache
added code to the apache config file to configure php and apache as module
changed extension_dir(in php.ini) to be eqaul to c:/php/extensions
changed :extension = php_bz2.dll and took away the ';'
What else should i do to make the thing to work.
I use win2000 by the way...
I downloaded the latest php(4.3.2) and manually installed it, and then i installed the latest Apache(2.0.46) via the installer.
The problem is, i inserted the "hello world" example into the apache folder, and all i get is the heading and nothing else. Hello world does not appear on the web page. The echo function does not seem to work.
An example of the "hello world" example....
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo "<p>Hello World</p>"; ?>
</body>
</html>
I can get it to work using a html extension, but only gives me the heading when using the php extension.
Here's a list of things i did....
copied c:\\php\php4ts.dll to c:\\winnt\system32
copied c:\\php\php.ini-reccomended to c:\\winnt and renamed it to php.ini
set doc root in php.ini file to point to apache
added code to the apache config file to configure php and apache as module
changed extension_dir(in php.ini) to be eqaul to c:/php/extensions
changed :extension = php_bz2.dll and took away the ';'
What else should i do to make the thing to work.
I use win2000 by the way...
The problem could be due to the miss-association of .php extension in your apache config.
When you ran the script did it show everything you dipslayed above, including the "<?php echo "<p>Hello World</p>"; ?>" and not just "Hello World" ?
The following references should point you in the right direction:
http://uk.php.net/manual/en/install.windows.php
http://uk.php.net/manual/en/install.apa ... he.windows
http://httpd.apache.org/docs/windows.html
Regards,
When you ran the script did it show everything you dipslayed above, including the "<?php echo "<p>Hello World</p>"; ?>" and not just "Hello World" ?
The following references should point you in the right direction:
http://uk.php.net/manual/en/install.windows.php
http://uk.php.net/manual/en/install.apa ... he.windows
http://httpd.apache.org/docs/windows.html
Regards,
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Take a look at the PHP manual for setting up Apache 2 http://www.php.net/manual/en/install.apache2.php.
This will give you some guidelines into setting up the server for php.
This will give you some guidelines into setting up the server for php.
nielsene wrote:Did you try a "view/show source" on the page?
Ok after you finish the re-installing you mention, try this:Liansky wrote:Um, i have no idea what that is....
1) Try loading your hello world example, make sure the hello world file has a .php extension, not a .html
2) If the "hello world" doesn't show up, go to the menu bar of your browser, select "View" and then select "Source" (in MSIE) or "Page Source" (in Mozilla/Netscape)
3) Is the <?php echo ... ?> line visible in the source window that opens?
if you use the php zip package from http://php.net/downloads you can do the installation by the book (aka install.txt). But note the ATTENTION: Apache 2 Users section.
you might test the php installation stand-alone first.
Create a small script file in your php directory, e.g. called test.php containing something like <?php phpinfo(); ?>
now open a command shell, change to your php directory and type php.exe -l test.php
If php itself works properly it should return No syntax errors detected in test.php
Now you can move the script file to the htdocs directory of your apache.
if you request http://localhost/test.php now and see nothing, open the source view. If the complete script is shown your Apache isn't set up to let php handle php-scripts and you have to check Installing PHP for Apache as module in install.txt again (if you're going to install php as module. Installing PHP for Apache as CGI binary if you plan to run php as cgi)
you might test the php installation stand-alone first.
Create a small script file in your php directory, e.g. called test.php containing something like <?php phpinfo(); ?>
now open a command shell, change to your php directory and type php.exe -l test.php
If php itself works properly it should return No syntax errors detected in test.php
Now you can move the script file to the htdocs directory of your apache.
if you request http://localhost/test.php now and see nothing, open the source view. If the complete script is shown your Apache isn't set up to let php handle php-scripts and you have to check Installing PHP for Apache as module in install.txt again (if you're going to install php as module. Installing PHP for Apache as CGI binary if you plan to run php as cgi)
yo, I'm always too focused on the initial question.
phptriad has been mentioned here some times.
wampp is another package
phptriad has been mentioned here some times.
wampp is another package
wampp 2.2
ZIP RAR 06. june 2003
42 MB 33 MB released
apache 2.0.46, MySQL 4.0.13, PHP 4.3.2 + PEAR, Perl 5.8.0, mod_php 4.3.2, mod_perl 1.99_10, mod_ssl 2.0.46, openssl 0.9.7b, PHPMyAdmin 2.5.1, Webalizer 2.01-10, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, JpGraph 1.12.1, Fastsream NetFile Server 5.6.0.511, (WEB-DAV + MOD AUTH MYSQL experimental); well suitably as server service under NT, w2k, XP Prof. [last modify: 06.06.02]
Volka, you are a <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> genius without even knowing it for Christs sakes. All i had to do was move my file to htdocs. I mean <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>, i thought i had to leave it in the main apache folder. Thank you very much and God <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> bless...
To all of the others: You see, i know how to read a goddamn manual. Just a pity the goddamn manual aint specific on where to move the source code...
To all of the others: You see, i know how to read a goddamn manual. Just a pity the goddamn manual aint specific on where to move the source code...