<? is not recognized as php only <?php is on my apache 1.3 server!!

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

    <? is not recognized as php only <?php is on my apache 1.3 server!!

    Hi all

    Ive just installed php 5 on my Apache server and its not recognizing my
    code when its written between <? ?only <?php ?will work. How can i
    edit the httpd.conf file to allow this?

    Kind regards

    Marc

  • Erwin Moller

    #2
    Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

    monomaniac21 wrote:
    Hi all
    >
    Ive just installed php 5 on my Apache server and its not recognizing my
    code when its written between <? ?only <?php ?will work. How can i
    edit the httpd.conf file to allow this?
    >
    Kind regards
    >
    Marc
    Hi

    short_open_tags is disabled in your php.ini.
    Enable it. :-)

    Regards,
    Erwin Moller


    Comment

    • =?UTF-8?B?SXbDoW4gU8OhbmNoZXogT3J0ZWdh?=

      #3
      Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      Erwin Moller wrote:
      short_open_tags is disabled in your php.ini.
      Enable it. :-)
      Better replace all ocurrences of "<?" to "<?php" - the short tag is
      problematic if you start using doctypes.

      - --
      - ----------------------------------
      Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

      A la larga el buen manjar, cansa al fin el paladar.

      -----BEGIN PGP SIGNATURE-----
      Version: GnuPG v1.4.6 (GNU/Linux)

      iD8DBQFFhoP2R56 dWuhgxGgRAu8tAJ 9lB6yVWhHo/nCqc/aRRSodhODhvACeO HSm
      KOgETtWO/6aPUBE+buwhqEc=
      =A5RS
      -----END PGP SIGNATURE-----

      Comment

      • monomaniac21

        #4
        Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

        In my php.ini.default file it says:

        short_open_tag = On


        Erwin Moller wrote:
        >
        short_open_tags is disabled in your php.ini.
        Enable it. :-)
        >

        Comment

        • Erwin Moller

          #5
          Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

          monomaniac21 wrote:
          In my php.ini.default file it says:
          >
          short_open_tag = On
          .....
          That doesn't make sense. Should work.
          Please doublecheck.
          Are you are editting the right php.ini (the one phpinfo() says it is using)?
          Be sure to restart apache.
          What does phpinfo() say about short open tags?

          Regards,
          Erwin Moller
          >
          >
          >
          >Erwin Moller wrote:
          >>
          short_open_tags is disabled in your php.ini.
          Enable it. :-)
          >>

          Comment

          • monomaniac21

            #6
            Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

            Thanks Erwin

            Terminal was finding the wrong file! I should of checked phpinfo


            Erwin Moller wrote:
            monomaniac21 wrote:
            >
            In my php.ini.default file it says:

            short_open_tag = On
            >
            ....
            That doesn't make sense. Should work.
            Please doublecheck.
            Are you are editting the right php.ini (the one phpinfo() says it is using)?
            Be sure to restart apache.
            What does phpinfo() say about short open tags?
            >
            Regards,
            Erwin Moller
            >


            Erwin Moller wrote:
            >
            short_open_tags is disabled in your php.ini.
            Enable it. :-)
            >

            Comment

            • Erwin Moller

              #7
              Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

              monomaniac21 wrote:
              Thanks Erwin
              >
              Terminal was finding the wrong file! I should of checked phpinfo
              Good.

              You are not the first, nor the last, that is editting the wrong php.ini
              file.
              Speaking from broad personal experience. ;-)
              I even deleted/renamed all php.ini's on my systems so I have ONLY 1 left.

              Regards,
              Erwin Moller
              >
              >
              Erwin Moller wrote:
              >monomaniac21 wrote:
              >>
              In my php.ini.default file it says:
              >
              short_open_tag = On
              >>
              >....
              >That doesn't make sense. Should work.
              >Please doublecheck.
              >Are you are editting the right php.ini (the one phpinfo() says it is
              >using)? Be sure to restart apache.
              >What does phpinfo() say about short open tags?
              >>
              >Regards,
              >Erwin Moller
              >>
              >
              >
              >
              >Erwin Moller wrote:
              >>
              short_open_tags is disabled in your php.ini.
              Enable it. :-)
              >>

              Comment

              • larry@portcommodore.com

                #8
                Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

                If you plan to share your code you should use <?php ?instead of just
                short tags, you can't expect it to be the case on every server.

                Comment

                • Lord Sauron

                  #9
                  Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

                  On Dec 18, 6:11 am, Erwin Moller
                  <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                  monomaniac21 wrote:
                  Thanks Erwin
                  >
                  Terminal was finding the wrong file! I should of checked phpinfoGood.
                  >
                  You are not the first, nor the last, that is editting the wrong php.ini
                  file.
                  Speaking from broad personal experience. ;-)
                  I even deleted/renamed all php.ini's on my systems so I have ONLY 1 left.
                  A major problem I have is remembering to reload apache. I'll make a
                  whole mess of changes and then wonder why it isn't working, then I'll
                  reload apache and then I'll feel stupid.

                  This need to restart apache (sudo /etc/init.d/[apache|httpd] restart)
                  is something you need to do on Linux. I'm not sure about other
                  non-UNIX platforms.

                  Comment

                  • Toby Inkster

                    #10
                    Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

                    Iván Sánchez Ortega wrote:
                    Better replace all ocurrences of "<?" to "<?php" - the short tag is
                    problematic if you start using doctypes.
                    You mean XML prologues, not Doctypes, surely?!

                    And the fix isn't very hard:

                    <?= '<?xml version="1.0"?> ' ?>

                    --
                    Toby A Inkster BSc (Hons) ARCS
                    Contact Me ~ http://tobyinkster.co.uk/contact

                    Comment

                    • Erwin Moller

                      #11
                      Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

                      Lord Sauron wrote:
                      On Dec 18, 6:11 am, Erwin Moller
                      <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                      >monomaniac21 wrote:
                      Thanks Erwin
                      >>
                      Terminal was finding the wrong file! I should of checked phpinfoGood.
                      >>
                      >You are not the first, nor the last, that is editting the wrong php.ini
                      >file.
                      >Speaking from broad personal experience. ;-)
                      >I even deleted/renamed all php.ini's on my systems so I have ONLY 1 left.
                      >
                      A major problem I have is remembering to reload apache. I'll make a
                      whole mess of changes and then wonder why it isn't working, then I'll
                      reload apache and then I'll feel stupid.
                      >
                      This need to restart apache (sudo /etc/init.d/[apache|httpd] restart)
                      Hi,

                      One addition:
                      graceful is better. It leaves anything apache can think of operational.

                      sudo /etc/init.d/[apache|httpd] graceful

                      It sends a SIG (USR1 if memory serves me well) to apache, meaning in this
                      case to reload configuration.
                      On a development machine is makes no difference of course, but when you are
                      playing with your productionserve r, graceful safes you a few phonecalls.
                      ;-)

                      Regards,
                      Erwin Moller
                      is something you need to do on Linux. I'm not sure about other
                      non-UNIX platforms.

                      Comment

                      • Erwin Moller

                        #12
                        Re: &lt;? is not recognized as php only &lt;?php is on my apache 1.3 server!!

                        larry@portcommo dore.com wrote:
                        If you plan to share your code you should use <?php ?instead of just
                        short tags, you can't expect it to be the case on every server.
                        Good advise, mainly because ini_set("short_ open_tags","On" ) won't do the
                        trick.

                        Regards,
                        Erwin Moller

                        Comment

                        Working...