PHP doesn't process php, displays code in browser
Results 1 to 5 of 5

Thread: PHP doesn't process php, displays code in browser

  1. #1
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    PHP doesn't process php, displays code in browser

    Hi, I am typically use php on my Linux servers but now I have reason to install PHP/Apache/MySQL on a Windows 98 pc. Not for a server just for development. I have followed the Windows setup instructions for installing php4 in Win 98 and configuring Apache.

    I added the following to my httpd.conf file:

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

    I also edited doc_root to be c:\apache\htdocs and extension_dir to be c:\php\ in the php.ini

    I am having one problem though, when I go to load my phpinfo.php file in my browser it only displays the file, like this

    <? phpinfo() ?>

    and doesn't actually print out the enviroment information. Seems to me like Apache isn't recongnizing the php extension. I have triple checked my httpd.conf file for the three lines Apache needs for PHP. I have php installed in c:/php and apache in c:/apache.

    Does anyone know how to fix this?

    Thank you,
    Tony

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    RE: PHP doesn't process php, displays code in brow

    Thats kinda funny cause it looks like it should work. Oh well have you tried it with the full <?php instead of just <?, maybe your php.ini file has short_open_tag set to off.

    If you don't require the use of the GD module right away try downloading the Win32 Apache module version from http://php4win.de/

    It's way faster and it'll give you access to all those lovely apache only functions :)

    This is what I have in my Apache httpd.conf file on my development system.

    #Load PHP apache module
    LoadModule php4_module c:/web/php4/sapi/php4apache.dll
    AddType application/x-httpd-php .php4 .php3 .php .phtml

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    RE: PHP doesn't process php, displays code in brow

    Did you restart apache after editing the files?

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    RE: PHP doesn't process php, displays code in brow

    Yes, I did stoped, started, restarted, restarted again. It still won't work. I have again double checked my php.ini and httpd.conf files with multiple howto's. I was in the process of downloading the Win32 Apache module version from http://php4win.de/ last night but football distracted me. I will try it again tonight. Thanks for the suggestions.

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    65,357

    Solved: Thank you

    Thank you for helping with this problem.

    A email I received helped me determine that the file named phpinfo.php was actually a txt file. *Windows files extensions!!!!* Even notepad saves the silly file extension. Back to Linux for me. Again thanks for all the help. The PHP community does it again.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •