Create and consume web service on local machine by using WAMP - php

Is it possible to create an environment on local machine( i.e. localhost) where we can create and consume web service using PHP?
Is there any flow to create a web service like environment on localhost?
I would like to create an environment on localhost for web services where local machines, on intranet, get connected to main server (here again it's local machine) and can consume web services.
Like on internet we have Web Servers from where we can create and consume web services, Can we do the same on localhost?
Edit:
I am using WAMP with
PHP 5.3 Apache 2.* MySQL 5Windows 8

It is easy to create a local web service. You will need a local web server (like IIS or xampp) to execute PHP locally.
Access you PHP application in your browser using http://localhost/<yourApp>.php and provide any webservice at a local URL as well, e.g. http://localhost/<yourService>.php. Your application can then access the webservice using the local URL.
This works both for REST or SOAP-style services.
EDIT: Your edit shows that you already set up a local environment to develop and test webservices. You should really be more specific in your question, maybe you are looking for a tutorial to create web services with PHP in genereal. If so, Google will be your best friend: https://www.google.de/#q=create+web+service+using+php+tutorial

Related

How to start a PHP Websocket server on Microsoft Azure?

I was able to setup WebSocket on Azure.WebSockets enabled on Azure
But my issue is : how to start the PHP ws server?
I have used this sample implementation https://github.com/ghedipunk/PHP-Websockets successfuy on my computer but I am not able to start the server in MS Azure.
All Azure Web Apps run in a secure environment called a sandbox. In the sandbox, each app is processed by Microsoft IIS. An app runs through PHP's Command Line Interface (CLI) is not allowed. For more details, please refer to Azure Web App sandbox.
In order to be able to run PHP-WebSockets in Azure, you need to host in something like a Virtual Machines, Cloud Services, or Containers, rather than Web Apps.

Hosting a mongodb based PHP web app

How can I host a PHP web application that used MongoDB as database.(I meant NoSQL)
I have built an applcation which is locally running fine, as I will be executing mongod.exe with db path specified.
How can I host the webapp with mongodb that can be accessible like any other normal PHP web app(or website)
Thanks.

Android Connection to php web services

I am new to android development. I have a module where I need to connect to a webservice via an android application. I have the web services in my localhost.
My question is: How to access them from my android application?
Tutorials on web says how to access the live web services.
First, both your computer and android device need to be in the same network,
If you use windows, go to cmd and type ipconfig /all
Find your computer's ip address
Then you will be able to access your server's from its ip address.
You can also check your firewall configuration if steps above don't work
i have did this before ,first of all , if you need to connect your android application with php service at localhost.following thing need following thing
Android Emulator on which application install
For SERVER -- WAMP or XAMP Server install on Local machine on which you are testing .
now host your php service in the www folder (in case of WAMP) or in the htdocs folder( in case of XAMP).
Now how to communicate between web service and android : as describe below
Now you have Envoirnment set now all you have to do is to follow this tutorial it will definatly resolve your issue .
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/

Ideas on ways to implement simple offsite clone of web app (php / codeigniter / mysql)

Have a web app installed on a local internal hardware. I am trying to figure out how best (even if possible) to replicate the data to an external server with the same app installed so they can sync the data between them. So if external they can access via web if internal they can access locally.
PHP / CodeIgniter App running on MySQL.
Had idea of having the local app remotely connect and use the external server DB as the main source but then thought what if internet isn't available how best could I handle that?
So your webservice runs on a machine in your local network. And if you're not on the local network you want to connect via Internet?
Can you detect when you're on the local network? Maybe this is as simple as trying http://mywebservice/, otherwise switch to Internet mode http://mywebservice.mydomain.com.
You could also consider dropping local availability. Does it happen a lot that you are on the local network but don't have Internet access?

Testing PHP Web Service locally by using android app

I am new to web services and planning to design a php webservice for my android app on my local machine which will send some user informations to database and generate some JSON data. But the problem is i am little confused about how to test it.
For example lets say that my webservice will locate on my local machine like below http://localhost:80/webservice/register.php
And my ip address is 192.168.1.X
Than is it possible for my android app to use this web service by using this url http://192.168.1.X:80/webservice/register.php
Normally since webservices are on the internet any program can access them. But i thought that i can test my webservice with my android app since both my pc and android device are on the same subnet.
If someone make things clear and tell me a way for testing a web service locally i appreciated
This is possible to call the web service in the local network also from the android app. But Your device and Your server on which Web Service running must have on the same network and Your firewall or any proxy server must be off on the server.

Categories