Am I just getting the wrong impression?

I need a lot of help with php, mainly to get it to work

I'm using a VPS with GoDaddy and their setup is partially installed

Any php code like <?php echo "somethign" ?> will show up in the htlm file

When I try to fix the httpd.conf file, apache fails to restart

    Alright this was a bad start, I realize that. I should have had the title say what I am after which is to reinstall PHP 5 correctly with the proper modules so that mysqli queries will work as well as executing code in non-php files.

      greenace92 wrote:

      Why is this forum dead?

      Am I just getting the wrong impression?

      This particular forum (the Install forum) has always seen the least use, methinks, mainly because people often have PHP pre-installed and pre-configured for them by their web hosts.

      As for your problem:

      greenace92 wrote:

      Any php code like <?php echo "somethign" ?> will show up in the htlm file

      Perhaps you should try using .php as the file extension instead. If you want to use .html or even .htlm, then configuring your webserver as you attempted by modifying httpd.conf is possible.

      greenace92 wrote:

      When I try to fix the httpd.conf file, apache fails to restart

      You should tell us exactly what you attempted to "fix" the httpd.conf file. However, I suspect that this is entirely unnecessary as you probably just need to use .php as the file extension.

        Hi thank you for your response.

        I opened up my httpd.conf file and tried to add the following :

        Under <IfModule mime_module> I entered

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

        I want to use php within html as in for example, I want to fill in a name entry that was just filled in using an htlm form via post, I want to retrieve that by say

        <?php echo "$name" ?>

        I will try your suggestion of changing to .php, I will laugh if it is that simple, unfortunately I have already destroyed and rebuilt my server so I will need to re-write the virtual hosts to resolve my domains

        Anyway thanks again

          I also had an interesting problem after adding AddType with .php

          Every webpage I would look up, any domain tied to this server, would automatically download without leaving the last webpage I was on before entering the subsequent websites, what does that mean?

            I am using Linux

            Part of it is installed, that's the thing... ahhh then GoDaddy conveniently says "For just $80.00 more, we'll fix all the problems we've caused."

            Anyway I'm going to give this a go again, then consolidate my finds.

            Thank you again for your respones

              Your Linux distro probably comes with a package manager that could be used to install and provide a basic configuration of PHP. In such a case, you might not even need to follow the PHP manual's instructions on messing around with apache.conf (though you might still need to edit php.ini to enable/disable stuff).

                I don't mind it, I am actually hosting on my own computer right now, apache was a pain to install, it's like "Oh, you're missing, this... you need that... you need this"

                I laughed when the terminal literally said "Sanity Check Failed"

                Anyway

                I'm going to give this another go

                  What laserlight was suggesting is that installing apache or php on linux can be as simple as a single command from the command line:

                  sudo apt-get install php5

                    It's already installed, it's just that not everything is enabled for me to write data into a database. I had to enable some options and rebuild Apache/PHP

                    Then save html documents with php in them as .php files to solve the problem of php script code showing up on the html document when opened in the browser

                      greenace92;11044181 wrote:

                      It's already installed, it's just that not everything is enabled for me to write data into a database. I had to enable some options and rebuild Apache/PHP

                      Or you could have used a package installer. On ubuntu or debian, this command would do that for you:

                      sudo apt-get install php5-mysql
                      greenace92;11044181 wrote:

                      Then save html documents with php in them as .php files to solve the problem of php script code showing up on the html document when opened in the browser

                      That is precisely what all of us do. The .php at the end of the filename is what tells apache that the file should be parsed and interpreted as PHP rather than just coughed up like plain old HTML.

                        Thank you for your response

                        That's what I'll do from now on, use .php extension

                          I strongly suggest that you spend some time carefully reading through the Getting Started and Language Reference section of the PHP manual. The Getting Started section would have suggested the use of the .php file extension and explained why. The Language Reference section would help you learn the basic syntax of PHP.

                            Yes I did start reading through the basics, as well as following through w3school's tutorials on PHP and SQL and of course the extensive resources of the web.

                            I know what I need to accomplish, I'm not really learning php for fun rather I need to accomplish tasks server side. Ideally I would just hire people to make the code within a week or less but I don't have the funds. I like to learn / it is fun but tedious and meticulous. (interchangeable words?)

                            Anyway thanks, I did install netbeans to see if that can help find errors

                              Write a Reply...