I open a PHP file with FF and its content is printed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Raistlin Majere

    I open a PHP file with FF and its content is printed

    I have Apache/MySQL/PHP on Windows XP.

    I want my PHP files to behave in my computer like in web host.

    I open a PHP file with FF and its content is printed!

  • Kimmo Laine

    #2
    Re: I open a PHP file with FF and its content is printed

    "Raistlin Majere" <pedbessa@uol.c om.br> wrote in message
    news:1146197942 .435073.6610@i4 0g2000cwc.googl egroups.com...[color=blue]
    >I have Apache/MySQL/PHP on Windows XP.
    >
    > I want my PHP files to behave in my computer like in web host.
    >
    > I open a PHP file with FF and its content is printed![/color]

    1) Are you acessing the files with c:/path/to/docroot/file.php or
    http://localhost/file.php ? You should be using the latter one.

    2) Is Apache+PHP configured properly? Is Apache set to execute .php files
    with your php?

    --
    "ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
    spam@outolempi. net | Gedoon-S @ IRCnet | rot13(xvzzb@bhg byrzcv.arg)


    Comment

    • Michael B. Trausch

      #3
      Re: I open a PHP file with FF and its content is printed

      Raistlin Majere wrote in
      <1146197942.435 073.6610@i40g20 00cwc.googlegro ups.com> on Fri April 28 2006
      00:19:
      [color=blue]
      > I have Apache/MySQL/PHP on Windows XP.
      >
      > I want my PHP files to behave in my computer like in web host.
      >
      > I open a PHP file with FF and its content is printed![/color]

      Well, you didn't provide a heck of a lot of information, so I'll try to help
      you with what I can. I'm going to make the assumption that you're using
      http://localhost/ or something similar as the base for the URL and when you
      load the PHP script that way, you're getting the entire script's source
      code on your screen as opposed to the parsed and printed output of the
      script. I'm going to wager a guess that no matter what browser you open it
      up with, you're getting the same result, thereby not making it specific to
      Firefox, but more likely specific to the installation of Apache that you're
      running.

      If that is the case, then you'll have to tell Apache that it needs to
      recognize files ending in .php to be server side scripts. Ensure that the
      PHP module is loaded and that the following incantation exists somewhere in
      your Apache httpd.conf file:

      AddType application/x-httpd-php .php

      Is the line that you're going to need to your Apache configuration file to
      make that work. You can also optionally have it print the source in a
      pretty, syntax highlighted fashion if you add

      AddType application/x-httpd-php-source .phps

      to your Apache configuration file, but never do this on a machine to the
      outside world, if you have phps files lying around. They can give away
      things like your passwords and the like and be a big security risk in
      general. My personal opinion is that if you want pretty printing of the
      source code, you're going to be using a relatively decent IDE, anyway.

      If I've not addressed your problem, please provide more information so that
      I or somebody else can help you. There are tutorials on the Internet that
      you can use to get the system configured correctly, and IIRC, there's even
      an installer for all of these things on Windows that does the work for you,
      including adding MySQL to the bunch and configuring it as an extension to
      PHP as required.

      - Mike

      Comment

      • Raistlin Majere

        #4
        Re: I open a PHP file with FF and its content is printed

        How can I properly configure Apache+PHP?

        Comment

        • Raistlin Majere

          #5
          Re: I open a PHP file with FF and its content is printed

          "Ensure that the PHP module is loaded" How?

          Comment

          • Kimmo Laine

            #6
            Re: I open a PHP file with FF and its content is printed

            "Raistlin Majere" <pedbessa@uol.c om.br> wrote in message
            news:1146204571 .680769.104060@ y43g2000cwc.goo glegroups.com.. .[color=blue]
            > How can I properly configure Apache+PHP?
            >[/color]

            Read the f***ing manual:

            PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.

            if you have Apache 1.3 version or


            if you have Apache 2.0 version

            --
            "ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
            spam@outolempi. net | Gedoon-S @ IRCnet | rot13(xvzzb@bhg byrzcv.arg)


            Comment

            • Schraalhans Keukenmeester

              #7
              Re: I open a PHP file with FF and its content is printed

              Raistlin Majere wrote:[color=blue]
              > "Ensure that the PHP module is loaded" How?
              >[/color]

              It sounds like you are

              a) trying to achieve something way over your head
              b) too lazy to read the manuals
              c) unaware of google
              e) utterly dyslexic
              f) braindead
              g) any permutation of the above

              May I suggest installing XAMPP or any similar prefab server package ?
              Just barking staccato questions each time you run into problems isn't
              what usenet was made for.

              Come back if you have READ thoroughly, tried and failed. Then be
              specific about your problem, concise and complete.

              Sh.
              --
              What GOOD is a CARDBOARD suitcase ANYWAY?

              Comment

              Working...