logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: "Hello World" Blank Page - PHP Install on Windows
Author
RobinR



Joined: 02 Jan 2009
Posts: 2
Location: New Jersey

PostPosted: Fri 02 Jan '09 0:56    Post subject: "Hello World" Blank Page - PHP Install on Windows Reply with quote

I have Windows 2000 Professional on my laptop and installed the apache server to:

C:\Program Files\Apache Group\Apache

In the httpd.conf file I changed Port 8080 to Port 8060

Therefore, these lines:

Listen 8060
Servername localhost:8060

The comment from the line above has been removed.

For PHP 5 CGI added:
ScriptAlias /php/ “c:/php/”
AddType application/x-httpd-php .php
Action application/x-httpd-php “/php/php-cgi.exe”
SetEnv PHPRC C:/php

I restarted the computer and then started the Apache server manually.
The error.log looks fine: Starting thread to listen on port 8060
***********
I then manually installed php on my laptop

c:\php

Using the Control Panel
System Icon > Environment Variables > System Variables

I edited the path name and added to the end:

;c:\php;c:\php\ext;

and restarted computer

I then renamed the php.ini-recommended file to php.ini and made the following changes:
browscap = “c:\winnt\system32\inetserv\browscap.ini”

cgi.force_redirect = 0

doc_root=”c:\Program Files\Apache Group\Apache\htdocs”
mysql.default_socket = MySql
mysql.default_host = localhost
extension_dir = “c:\php\ext”

Removed comment from beginning of
extension=php_mysql.dll

I then created hello.php and put in web server’s root directory:
C:\Program Files\Apache Group\Apache\htdocs

Code:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
</php echo ‘<p>Hello World</p>’;?>
</body>
</html>
******************************
In Internet Explorer address window

http://localhost:8060/hello.php

I should see the words “Hello World” but I get a blank page.

What do I need to change or add to get PHP to work with the Apache Server?

Thanks,

Robin

Question
Back to top
RobinR



Joined: 02 Jan 2009
Posts: 2
Location: New Jersey

PostPosted: Fri 02 Jan '09 23:31    Post subject: Reply with quote

There are two different methods of installing the Apache server:
as a CGI binary
as an Apache module

I decided to try the latter and made the necessary changes in httpd.conf to get Apache 2.2 working with PHP 5. However, I then got this error message:

“Cannot load C:\php\php5apache2.dll into server. The specified module could not be found.”

I searched for these words on the internet and found out that Apache 2.2 didn’t work with PHP 5. The writer said he was going back to Apache 2.0. I decided to do the same and PHP now works. Hello.php displays “Hello World”.

Take a look at:
http://www.phpbuilder.com/board/showthread.php?threadid=10326697

This incompatibility between Apache 2.2 and PHP 5 should be corrected.

Robin
Back to top


Reply to topic   Topic: "Hello World" Blank Page - PHP Install on Windows View previous topic :: View next topic
Post new topic   Forum Index -> Other Software