#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London, England
    Posts
    16
    Rep Power
    0
    Apache is returning the following error:

    Method Not Allowed
    the request method POST is not allowed for the URL /photo/up.html

    Im trying to create a simple form along with a php file to process it:

    up.html:

    <form method="post" action="upload.php" enctype="multipart/form-data">
    <input name="newFile" type="file">
    <input type="submit">
    </form>

    upload.php: (it never actually gets to this stage so i wont bother including it here)

    Someone said to me something about not being able to post to the php file or something..

    Anyone able to help?

    Thanks in advance,

    Sanners.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London, England
    Posts
    16
    Rep Power
    0
    i think the problem is related to:
    http://www.apache.org/docs/misc/FAQ.html#POSTnotallowed

    but i dont know what to do when its php, not cgi.

    [if it helps, im also the admin of the system]
  4. #3
  5. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    How did you install PHP? As an Apache loadable module (DSO), Static linked, or 'CGI' method? (I'm not familiar with installing PHP to run as CGI, and I recommend against it for performance reasons, but sometimes people need that)
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Enschede
    Posts
    3
    Rep Power
    0
    I think your problem might be related to the way you configured Apache to run PHP.
    In your server configuration files you may have a line like:
    "AddType application/x-httpd-php3 .php3 .htm .html .php"
    This line may be in your httpd.conf or in your srm.conf (outdated) depending on the version of Apache.
    The line tells Apache to start PHP when it encounters a file wuth an extension of .php3 .htm .html or .php. (This way even plain html -files are treated as PHP-files, if you want this is a matter of taste)
    In your case you might have the .php3-extension in the list but not the .php .
    In that case PHP will not be started (it never actually gets to this stage so i wont bother including it here)

    Let me know if this solves your problem çause I've seen this several times in students' projects.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London, England
    Posts
    16
    Rep Power
    0
    I'll try out your suggestions later but i thought id quickly say that .php files are processed correctly at the moment. I've made pages that interact with mysql and they work fine, this is the first time i've encountered any real problem.

    I'll have a look at the config file, but as i said before the php files [i think] are being processed fine.

    And as far as how i installed php, i just followed the default root, only adding the --prefix switch to change the path. I think its DSO - but again, i'll try and find out more.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    32
    Rep Power
    15
    I had this problem before and Wilem Smith is exactly correct. Check the extensions and make sure that extensions is on this line:

    AddType application/x-httpd-php3 .php3 .htm .html .php

    In my problem I had it processing .php and .phtml, but forgot .php3. As soon as I added that in it worked perfectly.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London, England
    Posts
    16
    Rep Power
    0
    I checked the AddType line in my httpd.conf file and it only had .php, i added .html .htm and .php3 and restarted the server.

    But nothing has changed. I click on the browse button and select a file. Then i hit the sumbit button. The page simply appears to reload - I get the same page back with a blank space where it previously pointed to the file location.

    I'd really appreciate any suggestions/help - im now pretty stuck with my development at the moment.

    Just incase i've included the code for upload.php below, but my newbie mind is convinced that the prolem lies else where - maybe Apache configuration?

    upload.php: [i never get any output from this file]

    <?php
    if (copy (stripslashes ($newFile), "./upload.txt")) {
    echo "yeah";
    }else {
    echo "fail";
    }
    ?>

    up.html: [the code is as above but with <html> <body> at top and </body> </html> at bottom]

    Like i said above i think php is being processed fine.. Maybe its a config problem, DSO/CGI, POST.. what do you reckon?

    help please!

    Sanners

Similar Threads

  1. Method Post not allowed
    By jwalsh in forum Windows Help
    Replies: 0
    Last Post: January 31st, 2004, 10:59 AM
  2. IE positioning bug and its solution
    By delerious in forum HTML Programming
    Replies: 3
    Last Post: December 23rd, 2003, 04:42 AM
  3. Replies: 0
    Last Post: December 17th, 2003, 03:03 PM
  4. Confused about method calls ><
    By Brittster in forum Java Help
    Replies: 1
    Last Post: November 19th, 2003, 01:45 PM
  5. wats wrong with my method? newbie alert!
    By dave2k in forum Java Help
    Replies: 4
    Last Post: November 10th, 2003, 10:44 AM

IMN logo majestic logo threadwatch logo seochat tools logo