Running a php file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Jamesta
    Private First Class

    • Feb 2008
    • 8

    Running a php file

    I created a php file. The data is saved but when i pull up the page I'm asked to download the file to save locally.

    1.) I have created the file with .php extension.
    2.) The code is:

    <?php
    phpinfo();
    ?>

    3.) I added a php handler of application/x-httpd-php as well.

    Can anyone provide some insight into what is the problem?

    4.) Also do I need to install php on the server using shell access?

    Much appreciated.

    -James
  • navaldesign
    General & Forum Moderator

    • Oct 2005
    • 12080

    #2
    Re: Error when running php file

    Not sure I follow you.

    Your code

    <?php
    phpinfo();
    ?>

    will output on the screen the info regarding the php version and settings of your server. Unless you have added something else, it should only do that.

    Handler: HOW did you embed the handler ? it is probably because of this that it asks to save.

    Not sure i follow you: why should you install php ??? Are you talking about a VodaHost server ? If yes, php is already installed, you don't need to do anything. If not, and your host doesn't support php, could be the reason why you are asked to download / save the file. It doesn't see it as a php file that needs to be executed, but as an unknown type file so it sees it as a download request.

    I don't think ANY host in the world would ever let you install php, seems impossible (to me) that they could give you permissions to do so.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

    Comment

    • Ver
      Private

      • Oct 2008
      • 3

      #3
      Re: Running a php file

      To Navaldesign,

      I am new here and just joined.. Hope with your helping hand you can share some of your knowledge... Barely new with html but what I am trying to understand is php. I have a website which a friend created it . It was saved in the form of many php files and not one html. How do I load these php files so it will show the site. Will these have to be converted as one html. Please kindly help as I am new to these but very willing to learn at the shortest possible time...Am I at the right forum to get the request I need? This may be a dumb question but "what is php vs html" in lay man's term.

      Thanks,

      Ver

      Comment

      • navaldesign
        General & Forum Moderator

        • Oct 2005
        • 12080

        #4
        Re: Running a php file

        PHP is a programming language, so php is usually used to create pages where the content is different, depending on the users input. Example: in a shopping cart, the product page is only one, and, depending on the product ID passed to the page, it will display the specific product details.

        HTML istead is a page description language. It can create only static pages.

        You can't create php pages that are usefull if you don't know HTML. That's because, at the end, php creates the output using html.

        I can't know what all those php files that you have are, or how they are joined. And, seems highly improbable that you can join al those files in a unique html file. Why ? each HTML file is ONE page. If those php files are an entire website, then there are certainly more than one pages, so joining them would be meaningless

        Further more, if your friend has created it in php, there SHOULD be a reason. In example, the site takes the content from a database, or a file. So seems rather difficult that you could convert the site to a html one, or your friend would have done so right from the start.
        Navaldesign
        Logger Lite: Low Cost, Customizable, multifeatured Login script
        Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
        DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
        Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

        Comment

        • Jamesta
          Private First Class

          • Feb 2008
          • 8

          #5
          Re: Running a php file

          Thank you very much for the response.

          1)When I executed the .php file what I see in the browser is the lines of code written as text and not the php server/other information. Correct me from wrong but this happens if the server does not understand the extension then the data is displayed as a text file as it is and not as any other file to be interpreted by the php compiler/pre-processor.
          2)I added the handler so that the server can understand that this is a php file and hence it needs to be interpreted. Should I remove this one?

          I want to make sure that php is interpreted and executed. How do I do this? If I no need to do anything, then my setup is probably not set right?
          Who do I contact regarding this?

          Is there a document which explains how to run php applications with a sample example?

          Thanks again,


          James

          Comment

          • navaldesign
            General & Forum Moderator

            • Oct 2005
            • 12080

            #6
            Re: Running a php file

            Please provide a link to one of th eproblematic pages.

            If your page is published as php and IF your server supports php (are you a VH customer ? ) there is no need for handlers of any kind.

            IF the server supports php, it automatically executes the php code as it should. No need for further actions on your side, other than publish the pages as php.
            Navaldesign
            Logger Lite: Low Cost, Customizable, multifeatured Login script
            Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
            DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
            Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

            Comment

            • Jamesta
              Private First Class

              • Feb 2008
              • 8

              #7
              Re: Running a php file

              Thanks Navel! I appreciate the quick response.

              Here is the url:



              I am a customer.

              Whenever I pull the page up I'm asked to open or save as.

              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: Running a php file

                How complicated!

                Create a BV page and place a html box in the page, then paste in the box this code:

                <?
                phpinfo();
                ?>

                Publish the page as php and publish. That's all.
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment

                • Jamesta
                  Private First Class

                  • Feb 2008
                  • 8

                  #9
                  Re: Running a php file

                  I tried again this time with html box.

                  I set page properties to php and then saved.

                  Published.

                  Now when i pull up the page, I"m asked to find a web service to open the file.

                  www.sowhatchee.com/phptest.php is the page.


                  Why am I being asked to find a web service to open the file?

                  Thanks again,

                  -James

                  Comment

                  • Karen Mac
                    General

                    • Apr 2006
                    • 8332

                    #10
                    Re: Running a php file

                    You arent asking it to execute anything else? The info or the script to process it is missing...

                    Karen

                    VodaHost

                    Your Website People!
                    1-302-283-3777 North America / International
                    02036089024 / United Kingdom
                    291916438 / Australia

                    ------------------------

                    Top 3 Best Sellers

                    Web Hosting - Unlimited disk space & bandwidth.

                    Reseller Hosting - Start your own web hosting business.

                    Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


                    Comment

                    • Jamesta
                      Private First Class

                      • Feb 2008
                      • 8

                      #11
                      Re: Running a php file

                      I'm not sure I follow.

                      I added the following to the html box:

                      <?
                      phpinfo();
                      ?>

                      Should there be something else?

                      I'm just trying to get a simple php script to work before I hook up with db.

                      Thanks,

                      James

                      Comment

                      • Karen Mac
                        General

                        • Apr 2006
                        • 8332

                        #12
                        Re: Running a php file

                        Well php works just fine on vodahost.. hook up your database and most likely will take care of the errors.

                        Karen

                        VodaHost

                        Your Website People!
                        1-302-283-3777 North America / International
                        02036089024 / United Kingdom
                        291916438 / Australia

                        ------------------------

                        Top 3 Best Sellers

                        Web Hosting - Unlimited disk space & bandwidth.

                        Reseller Hosting - Start your own web hosting business.

                        Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)


                        Comment

                        • navaldesign
                          General & Forum Moderator

                          • Oct 2005
                          • 12080

                          #13
                          Re: Running a php file

                          Please use my contact form to send me your page. It SHOULD have worked as i said.
                          Navaldesign
                          Logger Lite: Low Cost, Customizable, multifeatured Login script
                          Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                          DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                          Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                          Comment

                          • Jamesta
                            Private First Class

                            • Feb 2008
                            • 8

                            #14
                            Re: Running a php file

                            Hey.. I'm not sure what you mean by "contact me". Is this a private message? Where would I send this?

                            The page that I'm trying to get to work is: www.sowhatchee.com/phptest.php

                            Thanks for the support.

                            -James

                            Comment

                            • navaldesign
                              General & Forum Moderator

                              • Oct 2005
                              • 12080

                              #15
                              Re: Running a php file

                              Contact me means "use my contact form" to send me the file of your page.
                              In my signature you can find my site and hence my contactform.
                              Direct Link: contact form
                              Navaldesign
                              Logger Lite: Low Cost, Customizable, multifeatured Login script
                              Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                              DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                              Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                              Comment

                              Working...
                              X