2013-12-26 11:26



I have a website hosted in localhost. I'm using as a web server "EasyPHP".

I need to use a command line by cURL to send a file to a directory of the website.

Let's suppose that the URL of the website is :


And that "" is under the local directory :


So I need to make this command line work from MS-dos terminal :

curl -T localhost/test_curl/

And this :

curl -T http://localhost/test_curl/

I checked the configuration file php.ini and I un-commented this :


Then I restarted EasyPHP. But this didn't help.

I keep get this error message :

  The PUT
  method is not allowed for the requested URL.

under this error code :

  Error 405

For info : This worked for me to send a header : How to send header using PHP curl command line?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • douci1851 douci1851 8年前

    Here what I've done to resolve the problem :

    1. Control Panel > Security Center > Firewall > Exception > Add port. Then I added two ports :

      Name : FTP Server Value : 21

      Name : FTP-Data Value : 20

    2. I installed FileZilla Server : here

    3. FileZilla > Edit > Users > Add . Then I added a new user with password.

    4. I shared these folders to the user I've created :

      Only read right : C:\Program Files\EasyPHP 3.0\www

      Full right (and absolutely "write" right) : C:\Program Files\EasyPHP 3.0\www\test_curl

    5. I changed the curl command line to this (replace the variables by the right value):

      curl --user %user_name%:%password% --ftp-create-dirs -T ftp://localhost/test_curl/

    点赞 评论 复制链接分享