HELP - sure is a piece of cake for you

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

    HELP - sure is a piece of cake for you

    Hello all,
    I have installed apache server on my computer and all it takes to edit
    php files locally.
    everything works, and i can see my index.php file .
    however, the problem is:
    everything which is inside the <?php ?>is ignored.
    i have even done an echo check with the simplest htmk code.
    I'll copy it so you see i've done nothing wrong:

    <html>
    <head></head>

    <body>

    this line can be seen when writing http://127.0.0.1/index.php on the
    address bar but the bla bla is not.
    <?php
    echo "bla bla";
    ?>

    </body>
    </html>


    Heeeeeeeeeeeeel p! I can't figure out why is that :(

    Appreciate your rapid response. got some things to work on .

    Efry

  • PTM

    #2
    Re: HELP - sure is a piece of cake for you

    "greenflame " <dynamic.efry@g mail.comwrote in message
    news:1153944576 .484296.84220@m 79g2000cwm.goog legroups.com...
    Hello all,
    I have installed apache server on my computer and all it takes to edit
    php files locally.
    everything works, and i can see my index.php file .
    however, the problem is:
    everything which is inside the <?php ?>is ignored.
    i have even done an echo check with the simplest htmk code.
    I'll copy it so you see i've done nothing wrong:
    >
    <html>
    <head></head>
    >
    <body>
    >
    this line can be seen when writing http://127.0.0.1/index.php on the
    address bar but the bla bla is not.
    <?php
    echo "bla bla";
    ?>
    >
    </body>
    </html>
    >
    >
    Heeeeeeeeeeeeel p! I can't figure out why is that :(
    >
    Appreciate your rapid response. got some things to work on .
    >
    Efry
    >
    Just ran your code through my server and it all works ok. Did you run:

    phpinfo();

    to verify your setup? It would appear you may have a config issue.


    Phil


    Comment

    • greenflame

      #3
      Re: HELP - sure is a piece of cake for you

      hi, Phil, and thank you for your rapid response.

      mmmm. to be honest, I'd be glad to have more instructions since I have
      no idea what or hw to use this function. phpinfo();

      and what does it mean to run something through a server? just rephrase,
      please.
      :D

      thank you
      Efry
      PTM כתב:
      "greenflame " <dynamic.efry@g mail.comwrote in message
      news:1153944576 .484296.84220@m 79g2000cwm.goog legroups.com...
      Hello all,
      I have installed apache server on my computer and all it takes to edit
      php files locally.
      everything works, and i can see my index.php file .
      however, the problem is:
      everything which is inside the <?php ?>is ignored.
      i have even done an echo check with the simplest htmk code.
      I'll copy it so you see i've done nothing wrong:

      <html>
      <head></head>

      <body>

      this line can be seen when writing http://127.0.0.1/index.php on the
      address bar but the bla bla is not.
      <?php
      echo "bla bla";
      ?>

      </body>
      </html>


      Heeeeeeeeeeeeel p! I can't figure out why is that :(

      Appreciate your rapid response. got some things to work on .

      Efry
      Just ran your code through my server and it all works ok. Did you run:
      >
      phpinfo();
      >
      to verify your setup? It would appear you may have a config issue.


      Phil

      Comment

      • Eric Farraro

        #4
        Re: HELP - sure is a piece of cake for you

        It probably depends on how / where you set up your server. I'm running
        Apache, so I put files in:

        Apache_root / htdocs

        If you browse to http://localhost, you should get a listing of that
        directory (or an index page, if there is one present).

        The phpinfo() function will give a listing of all the extentions and
        configuration options you currently have with PHP. If a simple:

        <? phpinfo(); ?>

        program doesn't work for you, you've probably configured Apache / PHP
        incorrectly (very likely, it's quite difficult to set up the first few
        times)

        Comment

        • Jeremy

          #5
          Re: HELP - sure is a piece of cake for you

          greenflame wrote:
          Hello all,
          I have installed apache server on my computer and all it takes to edit
          php files locally.
          everything works, and i can see my index.php file .
          however, the problem is:
          everything which is inside the <?php ?>is ignored.
          i have even done an echo check with the simplest htmk code.
          I'll copy it so you see i've done nothing wrong:
          >
          <html>
          <head></head>
          >
          <body>
          >
          this line can be seen when writing http://127.0.0.1/index.php on the
          address bar but the bla bla is not.
          <?php
          echo "bla bla";
          ?>
          >
          </body>
          </html>
          >
          >
          Heeeeeeeeeeeeel p! I can't figure out why is that :(
          >
          Appreciate your rapid response. got some things to work on .
          >
          Efry
          >
          I'm going to venture a guess that your server is not configured to
          execute PHP pages. View the source of the result page - five bucks says
          you see the PHP source in there (i.e. it looks exactly like your source
          code on the server). The reason you don't see "bla bla" is because the
          browser thinks <?php ... ?is just a bad XML declaration or HTML tag
          and doesn't display it.

          Configuring apache to run .php pages through the PHP engine is
          nontrivial if you don't know what you're doing. Be careful.

          Jeremy

          Comment

          • PTM

            #6
            Re: HELP - sure is a piece of cake for you

            "greenflame " <dynamic.efry@g mail.comwrote in message
            news:1153945697 .003650.20850@7 5g2000cwc.googl egroups.com...
            hi, Phil, and thank you for your rapid response.

            mmmm. to be honest, I'd be glad to have more instructions since I have
            no idea what or hw to use this function. phpinfo();

            and what does it mean to run something through a server? just rephrase,
            please.
            :D

            thank you
            Efry
            PTM ???:
            "greenflame " <dynamic.efry@g mail.comwrote in message
            news:1153944576 .484296.84220@m 79g2000cwm.goog legroups.com...
            Hello all,
            I have installed apache server on my computer and all it takes to edit
            php files locally.
            everything works, and i can see my index.php file .
            however, the problem is:
            everything which is inside the <?php ?>is ignored.
            i have even done an echo check with the simplest htmk code.
            I'll copy it so you see i've done nothing wrong:

            <html>
            <head></head>

            <body>

            this line can be seen when writing http://127.0.0.1/index.php on the
            address bar but the bla bla is not.
            <?php
            echo "bla bla";
            ?>

            </body>
            </html>


            Heeeeeeeeeeeeel p! I can't figure out why is that :(

            Appreciate your rapid response. got some things to work on .

            Efry
            Just ran your code through my server and it all works ok. Did you run:
            >
            phpinfo();
            >
            to verify your setup? It would appear you may have a config issue.
            >
            >
            Phil
            Sorry.
            Just copied your code into a test.php file and then loaded it up into a
            browser running off my local Apache setup (just as you would have done).
            As Eric has said the phpinfo() command can simply be added to any '.php', so
            just <? phpinfo() ?in an index.php file WILL return you a LOT of php
            information if your php is actually running.

            he wasn't kidding when he said 'its quite difficult to set up', in fact that
            was probably an under statement.

            (ps: try not to pre-post, in other words put your reply at the end, helps
            everyone else with reading it top-down)


            Comment

            • IchBin

              #7
              Re: HELP - sure is a piece of cake for you

              PTM wrote:
              "greenflame " <dynamic.efry@g mail.comwrote in message
              news:1153945697 .003650.20850@7 5g2000cwc.googl egroups.com...
              hi, Phil, and thank you for your rapid response.
              >
              mmmm. to be honest, I'd be glad to have more instructions since I have
              no idea what or hw to use this function. phpinfo();
              >
              and what does it mean to run something through a server? just rephrase,
              please.
              :D
              >
              thank you
              Efry
              PTM ???:
              >"greenflame " <dynamic.efry@g mail.comwrote in message
              >news:115394457 6.484296.84220@ m79g2000cwm.goo glegroups.com.. .
              >>Hello all,
              >>I have installed apache server on my computer and all it takes to edit
              >>php files locally.
              >>everything works, and i can see my index.php file .
              >>however, the problem is:
              >>everything which is inside the <?php ?>is ignored.
              >>i have even done an echo check with the simplest htmk code.
              >>I'll copy it so you see i've done nothing wrong:
              >>>
              >><html>
              >><head></head>
              >>>
              >><body>
              >>>
              >>this line can be seen when writing http://127.0.0.1/index.php on the
              >>address bar but the bla bla is not.
              >><?php
              >>echo "bla bla";
              >>?>
              >>>
              >></body>
              >></html>
              >>>
              >>>
              >>Heeeeeeeeeeee elp! I can't figure out why is that :(
              >>>
              >>Appreciate your rapid response. got some things to work on .
              >>>
              >>Efry
              >>>
              >Just ran your code through my server and it all works ok. Did you run:
              >>
              > phpinfo();
              >>
              >to verify your setup? It would appear you may have a config issue.
              >>
              >>
              >Phil
              >
              Sorry.
              Just copied your code into a test.php file and then loaded it up into a
              browser running off my local Apache setup (just as you would have done).
              As Eric has said the phpinfo() command can simply be added to any '.php', so
              just <? phpinfo() ?in an index.php file WILL return you a LOT of php
              information if your php is actually running.
              >
              he wasn't kidding when he said 'its quite difficult to set up', in fact that
              was probably an under statement.
              >
              (ps: try not to pre-post, in other words put your reply at the end, helps
              everyone else with reading it top-down)
              >
              >
              - Create a php file, say you call it 'phpinfo.php', with this:
              <?php
              phpinfo();
              ?>

              - Find in your Apache2.conf where the 'DocumentRoot' is set and save
              that file in that subdirectory.

              - Then load the file in a browser.



              This will show you the PHP configuration.

              Thanks in Advance...
              IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
              _______________ _______________ _______________ _______________ ______________

              'If there is one, Knowledge is the "Fountain of Youth"'
              -William E. Taylor, Regular Guy (1952-)

              Comment

              • IchBin

                #8
                Re: HELP - sure is a piece of cake for you

                PTM wrote:
                "greenflame " <dynamic.efry@g mail.comwrote in message
                news:1153945697 .003650.20850@7 5g2000cwc.googl egroups.com...
                hi, Phil, and thank you for your rapid response.
                >
                mmmm. to be honest, I'd be glad to have more instructions since I have
                no idea what or hw to use this function. phpinfo();
                >
                and what does it mean to run something through a server? just rephrase,
                please.
                :D
                >
                thank you
                Efry
                PTM ???:
                - Create a php file, say you call it 'phpinfo.php', with this:
                <?php
                phpinfo();
                ?>

                - Find in your Apache2.conf where the 'DocumentRoot' is set and save
                that file in that subdirectory.

                - Then load the file in a browser.



                This will show you the PHP configuration.

                Thanks in Advance...
                IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
                _______________ _______________ _______________ _______________ ______________

                'If there is one, Knowledge is the "Fountain of Youth"'
                -William E. Taylor, Regular Guy (1952-)

                Comment

                • elyob

                  #9
                  Re: HELP - sure is a piece of cake for you


                  "greenflame " <dynamic.efry@g mail.comwrote in message
                  news:1153944576 .484296.84220@m 79g2000cwm.goog legroups.com...
                  Hello all,
                  I have installed apache server on my computer and all it takes to edit
                  php files locally.
                  everything works, and i can see my index.php file .
                  however, the problem is:
                  everything which is inside the <?php ?>is ignored.
                  i have even done an echo check with the simplest htmk code.
                  I'll copy it so you see i've done nothing wrong:
                  >
                  <html>
                  <head></head>
                  >
                  <body>
                  >
                  this line can be seen when writing http://127.0.0.1/index.php on the
                  address bar but the bla bla is not.
                  <?php
                  echo "bla bla";
                  ?>
                  >
                  </body>
                  </html>
                  >
                  >
                  Heeeeeeeeeeeeel p! I can't figure out why is that :(
                  >
                  Appreciate your rapid response. got some things to work on .
                  Chances are that doing a phpinfo may not work if a simple echo also doesn't
                  work.

                  Always worth taking a look at your Apache error log file.





                  Comment

                  • greenflame

                    #10
                    Re: HELP - sure is a piece of cake for you


                    IchBin כתב:
                    PTM wrote:
                    "greenflame " <dynamic.efry@g mail.comwrote in message
                    news:1153945697 .003650.20850@7 5g2000cwc.googl egroups.com...
                    hi, Phil, and thank you for your rapid response.

                    mmmm. to be honest, I'd be glad to have more instructions since I have
                    no idea what or hw to use this function. phpinfo();

                    and what does it mean to run something through a server? just rephrase,
                    please.
                    :D

                    thank you
                    Efry
                    PTM ???:
                    >
                    - Create a php file, say you call it 'phpinfo.php', with this:
                    <?php
                    phpinfo();
                    ?>
                    >
                    - Find in your Apache2.conf where the 'DocumentRoot' is set and save
                    that file in that subdirectory.
                    >
                    - Then load the file in a browser.
                    >

                    >
                    This will show you the PHP configuration.
                    >
                    Thanks in Advance...
                    IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
                    _______________ _______________ _______________ _______________ ______________
                    >
                    'If there is one, Knowledge is the "Fountain of Youth"'
                    -William E. Taylor, Regular Guy (1952-)
                    Hello all,
                    thank you for your kind assistance.

                    as you all think, I believe as well that I have installed it badly.

                    I have changed the root server to another directory, and it doesn't
                    recognize php files. i'll go over your suggestions to see if there's
                    anything I can do.
                    now, on the new directory I have copied the - htdocs, conf & logs
                    directories.
                    on http://localhost/ I still see the list of files.
                    I'll check on your suggestions and see if I manage to change anything.
                    Thank you all.
                    Efry

                    Comment

                    • greenflame

                      #11
                      Re: HELP - sure is a piece of cake for you

                      well,
                      after deleting all and reinstalling apache server 2 (the latest
                      version)
                      and reconfiguring all. - still with SAME PROBLEM.
                      nwo the server root is set to another directory/htdocs.
                      I have copied the directories:

                      htdocs, cgi-bin, modules, conf, and logs.

                      some due to a an error.

                      as said in this correspondence , phpinfo didn't work, as expected.
                      apache server does not give any error msgs.

                      I don't understand what I do wrong. please help.

                      thank you ,
                      Efry

                      greenflame כתב:
                      IchBin כתב:
                      PTM wrote:
                      "greenflame " <dynamic.efry@g mail.comwrote in message
                      news:1153945697 .003650.20850@7 5g2000cwc.googl egroups.com...
                      hi, Phil, and thank you for your rapid response.
                      >
                      mmmm. to be honest, I'd be glad to have more instructions since I have
                      no idea what or hw to use this function. phpinfo();
                      >
                      and what does it mean to run something through a server? just rephrase,
                      please.
                      :D
                      >
                      thank you
                      Efry
                      PTM ???:
                      - Create a php file, say you call it 'phpinfo.php', with this:
                      <?php
                      phpinfo();
                      ?>

                      - Find in your Apache2.conf where the 'DocumentRoot' is set and save
                      that file in that subdirectory.

                      - Then load the file in a browser.



                      This will show you the PHP configuration.

                      Thanks in Advance...
                      IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
                      _______________ _______________ _______________ _______________ ______________

                      'If there is one, Knowledge is the "Fountain of Youth"'
                      -William E. Taylor, Regular Guy (1952-)
                      >
                      Hello all,
                      thank you for your kind assistance.
                      >
                      as you all think, I believe as well that I have installed it badly.
                      >
                      I have changed the root server to another directory, and it doesn't
                      recognize php files. i'll go over your suggestions to see if there's
                      anything I can do.
                      now, on the new directory I have copied the - htdocs, conf & logs
                      directories.
                      on http://localhost/ I still see the list of files.
                      I'll check on your suggestions and see if I manage to change anything.
                      Thank you all.
                      Efry

                      Comment

                      • elyob

                        #12
                        Re: HELP - sure is a piece of cake for you

                        What OS are you using? Windows? If so, why not consider getting a pre-built
                        solution and installing that.





                        Comment

                        • greenflame

                          #13
                          Re: HELP - sure is a piece of cake for you


                          elyob wrote:
                          What OS are you using? Windows? If so, why not consider getting a pre-built
                          solution and installing that.
                          >
                          http://en.wikipedia.org/wiki/Comparison_of_WAMPs
                          yes, I do use Windows (XP).
                          I have installed MySQL and as well PHP. but it doesn't work.
                          the PHP file does load , but the syntax is ignored. the <? php ?>

                          I will try to do so as I get home and hope it will fix that problem.

                          Thank you once again.

                          Efry

                          Comment

                          • greenflame

                            #14
                            Re: HELP - sure is a piece of cake for you

                            hello again,

                            I have viewed the page and read some about it.

                            I have installed all except Linux.

                            mmmmmmmmh

                            but i think i'll try anyway.

                            Efry

                            elyob wrote:
                            What OS are you using? Windows? If so, why not consider getting a pre-built
                            solution and installing that.
                            >
                            http://en.wikipedia.org/wiki/Comparison_of_WAMPs

                            Comment

                            • IchBin

                              #15
                              Re: HELP - sure is a piece of cake for you

                              greenflame wrote:
                              IchBin כתב:
                              >PTM wrote:
                              >>"greenflame " <dynamic.efry@g mail.comwrote in message
                              >>news:11539456 97.003650.20850 @75g2000cwc.goo glegroups.com.. .
                              >>hi, Phil, and thank you for your rapid response.
                              >>>
                              >>mmmm. to be honest, I'd be glad to have more instructions since I have
                              >>no idea what or hw to use this function. phpinfo();
                              >>>
                              >>and what does it mean to run something through a server? just rephrase,
                              >>please.
                              >>:D
                              >>>
                              >>thank you
                              >>Efry
                              >>PTM ???:
                              > - Create a php file, say you call it 'phpinfo.php', with this:
                              ><?php
                              >phpinfo();
                              >?>
                              >>
                              > - Find in your Apache2.conf where the 'DocumentRoot' is set and save
                              >that file in that subdirectory.
                              >>
                              > - Then load the file in a browser.
                              >>
                              >http://localhost/phpinfo.php
                              >>
                              >This will show you the PHP configuration.
                              >>
                              >Thanks in Advance...
                              >IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
                              >______________ _______________ _______________ _______________ _______________
                              >>
                              >'If there is one, Knowledge is the "Fountain of Youth"'
                              >-William E. Taylor, Regular Guy (1952-)
                              >
                              Hello all,
                              thank you for your kind assistance.
                              >
                              as you all think, I believe as well that I have installed it badly.
                              >
                              I have changed the root server to another directory, and it doesn't
                              recognize php files. i'll go over your suggestions to see if there's
                              anything I can do.
                              now, on the new directory I have copied the - htdocs, conf & logs
                              directories.
                              You do not want to move htdocs, conf & logs directories. Just leave them
                              alone. You only need to change the 'DocumentRoot' to point where you
                              want to load your php scripts. You could just leave the 'DocumentRoot'
                              the default and put your scripts in htdocs.
                              on http://localhost/ I still see the list of files.
                              I'll check on your suggestions and see if I manage to change anything.
                              Thank you all.
                              Efry
                              >
                              Did you add these changes to your apache.conf:

                              - Add index.php to 'DirectoryIndex index.html index.html.var'
                              - Add these:
                              AddType application/x-httpd-php .php
                              AddType application/x-httpd-php-source .phps
                              - Add (I am on Windoze and run Apache2 so)
                              LoadModule php5_module "C:/php5.2/php5apache2.dll "
                              - I keep my PHP.ini in the PHP_Base_folder , so I configure to the PHP
                              ini:
                              PHPIniDir "C:/php5.2"
                              SetEnv PHPRC "C:/php5.2"

                              Take a look at this link:


                              Specifically items:
                              6. Configure PHP5 to Work with Apache
                              7. Test PHP5

                              Thanks in Advance...
                              IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
                              _______________ _______________ _______________ _______________ ______________

                              'If there is one, Knowledge is the "Fountain of Youth"'
                              -William E. Taylor, Regular Guy (1952-)

                              Comment

                              Working...