Hello,
I am currently working on a project to develop a web database application in PHP.
I have just installed Apache 2.2.4 and php_5.2.2 on my laptop that runs
Windows xp Home Edition. I used the msi installer for each and I edited
httpd.conf to use:

I tested php using a simple script, hello.php:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

I saved it in htdocs as DocumentRoot is set to "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

In the php.ini file the short_open_tag = On

I run Apache tomcat and the browser address I use to run hello.php http://localhost:8080/hello.php

I also added the following lines to the Apache httpd.conf file

PHPIniDir "C:/Program Files/PHP"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

The problem is the php page is blank so the configuration must be wrong but I don't know what
is wrong. Please help me.

😕
S

    When you say 'blank', is it actually blank? Meaning, did you view the source and see if any data was sent (a 'white screen' in a browser tells us very little about the data that the server returned).

    Also, have you tried examining Apache's error logs?

    EDIT: Lastly, I would suggest doing a manual installation and choosing a path that doesn't have spaces (e.g. c:\php).

      Hi bradgrafelman,

      Thanks for your reply. I just had a look at the source code as you suggested and its:

      <html>
      <head>
      <title>PHP Test</title>
      </head>
      <body>
      <?php phpinfo(); ?>
      </body>
      </html>

      Also I had a look at Apache error log and nothing seems amiss there either(or at least I think not). Doesn't this line mean that everything should be working fine-

      [Wed Jun o6 11:02:56 2007] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 configured-- resuming normal operations

      S.

        WAIT no, <?php phpinfo(); ?> should not be returned in the sourcecode, there is an error in your php configuration.

        If you are just starting with PHP and apache, Try a package, wampserver / xampp

          Thanks sheephat,

              I have the phpinfo() displaying properly but now I have a problem with MySQL I get a 'Cannot connect to TCP  3306 port'  I need to use PHP to connect to my local MySQL server installed on my laptop. How do I do this?

          S.

            Is mysql installed properly, if it is it may not be enabled. In WAMP there is an option, im not sure how this works for xaamp.

            Are you connecting via localhost:3306 ?

            Wampserver works straight out of the box, try the mysql documentation / php docs, most of the time your answers can be found there.

              Just out of curisoity, is your Windows setup to hide file extensions? Try doing this:

              1. Open My Computer

              2. On the Tools menu, click Folder Options

              3. On the View tab, ensure that the checkbox labeled "Hide extensions for known file types" is unchecked

              Once you have verified this setting, browse to your htdocs folder and ensure that the file is called hello.php and not hello.php.txt!

              EDIT: Also, have you tried restarting Apache?

                6 days later

                probably the same thing i just had.

                did you use the PHP5 installer? if so They goof up royally in the code.

                Take a look at your HTTPD.INF file at the end for the auto generated code.

                it automatically creates an entry for the lcation of PHP. but by default it appears like

                "C:\directory\php\adafd.dll"

                which screws up. you need to remove the double "\" and ensure there's only one

                and if it is a windows machine, it needs to be \ not / as I believe it still gets confused

                  mpasternak wrote:

                  if it is a windows machine, it needs to be \ not / as I believe it still gets confused

                  On the contrary, I've always used forward slashes without a problem (avoids the backslash-is-an-escape-character issue, too) whether it be Windows, Unix, etc.

                    Write a Reply...