Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2003
    Posts
    15

    Unanswered: newbie php question

    hi

    So I have php 4.2.1 installed on my slackware 8.1 box (it came default installed so I am assuming it is installed correctly).

    So I am reading online tutorials and i got the source:

    <html>
    <body>
    <title>test page</ititle>
    <?php
    $myvar = "hello world";
    echo $myvar;
    ?>
    </body>
    </html>

    and I saved it as first.php

    but when I go into my browser and go to ~/php/first.php the title shows up at the top (test page) but I don't see "hello world".
    I dont think my computer

    So i figure something is wrong with theway php is setup on my box. The server (my computer) isn't compiling the code.

    any ideas?

    Thanks,

    Trevor
    am I missing something?

  2. #2
    Join Date
    Dec 2002
    Posts
    65

    Hmmm...

    Well it could be a number of things. First thing to check is view the source of your php page when it comes up in your browser, do you see your php code in there? If so that means your web server software (Apache?) is not currently using php to parse your php files.

    If this is the case, the problem is more with your apache configuration and not php. You should check in your httpd.conf (again this is assuming you're using apache) to see if php is enabled/being loaded.

    Hope this helps,
    -B
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  3. #3
    Join Date
    Jan 2003
    Posts
    15

    Re: Hmmm...

    i think it could be the problem. there is no mention of php in /etc/apache/httpd.conf

    but there is however php.ini, php.ini-dist and php.ini-recommended, and a mod_php.conf in /etc/apache.

    am I forgetting anything?

    thanks so far

    -Trevor

  4. #4
    Join Date
    Jan 2003
    Posts
    15

    Re: Hmmm...

    i looked some more and found that mod_php4 is there.

    I have been playing around with some more complicated scripts I found and I am trying to post data onto a mysql database. I get this error (its probably all related):

    405 Method Not Allowed
    The requested method POST is not allowed for the URL /register.php.

    thanks again
    Trevor

  5. #5
    Join Date
    Dec 2002
    Posts
    65
    Hmm, sounds like you have everything setup fine. You might try checking the file permissions on your file(s). According to this URL I found http://groups.google.com/groups?hl=e...%40atmedia.net , that 405 error is usually caused with POST when the document is not executable.

    By the way, you said you are working with more complicated scripts does this mean the simple script you wrote is working?

    Hope this helps.

    -b
    (I'm only available at the email address provided in my profile on weekdays, if you have questions or advice, during off hours use AIM). Also any views I provide here or on my website are mine and not representative of any views of my work, family, friends and sometimes even myself.

    http://www.bcyde.com

  6. #6
    Join Date
    Jan 2003
    Posts
    15
    thanks, i thought so

    I think my databases are set up wrong. thats why I am getting the 405.
    ill have to play around with it a bit

    thanks again,

    Trevor

  7. #7
    Join Date
    Feb 2003
    Location
    Boston MA
    Posts
    1
    The code is wrong, you have an i before titles. </ititle> should be </title>. Works fine once this is fixed...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •