Enabling PUT commands on Xampp Apache

We have a small new development setup running Xampp Apache, PHP , MySQL.

When trying to send PUT commands we get a browser response  "Service  -  Method not allowed"

I"m told its likely just an Apache config issue but struggling to find the right info to fix it

Thanks for any help in advance
webfactorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ahmed MerghaniSoftware EngineerCommented:
I do not think you need to do Apache configuration. I think you are calling a web service method. Kindly, post your code so we can try to help you.
0
webfactorAuthor Commented:
The scenario is, we use the Apache server to call on another "Windows 8" machine which hosts a product called InControl , a home automation control software .. docs are :

http://developer.incontrolha.com/json-api.aspx    and the website http://store.incontrolzwave.com/incontrol-home-automation-software-download 

The code used in the PHP file on the apache server is

$url="http://".$host.":".$port."/zwave/getScenes/?password=".$pass;

$ch = curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PUT, true);


$data1=curl_exec($ch) or die(curl_error($ch));


Perhaps it is being blocked at the Windows machine instead?

Any extra info you need let me know and thanks again
0
webfactorAuthor Commented:
Oh and the exact PUT request we are trying is on this page

http://developer.incontrolha.com/json-api/scene-retrieve-list.aspx
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Ahmed MerghaniSoftware EngineerCommented:
Change your curl part to be something like this:
$url="http://".$host.":".$port."/zwave/getScenes/;

$param= array("password" => $pass);

$ch = curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($param));


$data1=curl_exec($ch) or die(curl_error($ch));

Open in new window

0
webfactorAuthor Commented:
after running your suggested code we get following error:
Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500
0
Ahmed MerghaniSoftware EngineerCommented:
Sorry forget to enclose the string in the first line:
$url="http://".$host.":".$port."/zwave/getScenes/";

Open in new window

0
webfactorAuthor Commented:
same error agian
0
webfactorAuthor Commented:
the server error was our msitake,after fixing that we r back to square one error Method not allowed
0
webfactorAuthor Commented:
Also FYI we were following the suggestions here:  

http://www.evardsson.com/blog/2010/04/27/apache-and-php-http-put-voodoo/
0
Ahmed MerghaniSoftware EngineerCommented:
Perhaps it is being blocked at the Windows machine instead?
I realized this! Yes may be. Did you try to use any other method other than "PUT"? For example "GET"?
You can try any REST client to ensure if its blocked by the Windows machine or not. If you are using firefox browser, then you can download and install REST Easy or RESTClient plug-in. Try "GET" method for any resource and if succeed, then try "PUT" and show the result.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
Here http://www.apacheweek.com/features/put is info on enabling PUT.  You have to enable the protocol and have a program that handles the request.  Apache itself is not going to do it.  In addition, PUT is normally protected by a username/password login so that only authorized sources can PUT a file on the server.
0
Shalom CarmelCTOCommented:
As far as I understand, the problem you have is with php code running on your xampp server. Said code is trying to contact the incontrol software via PUT.
Did I get it right?

If that is the case, then your problems have nothing to do with enabling PUT on your Apache, rather with communications between Apache+php code and the control software.

Can you use command line CURL from your xampp server to send PUT commands to incontrol?
0
webfactorAuthor Commented:
Thanks everyone for your comments, we ended up being able to perform the functions we need using GET commands instead
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Cloud Computing

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.