I created a website using ASP.net and it's accessing MySQL through visual studio using IIS and there are some web services developed in PHP [tested using Apache Server] for the android application. Now, I am able to run both Asp.net website and android application using the same host by running both the servers on the same machine.
But how can I use the same MySQL database for both the purposes. How can I redirect the requests for both asp.net web services and php requests to the same database?
It depends, but generally, connection strings in Asp.Net are stored in a file called web.config, in the root folder of the application.
I don't know if php have a central place to store connection strings, but in both cases you need to change that.
Related
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.
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?
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
We have the following setup:
-Windows 2008 R2 Standard.
-ASP.NET Web Application deployed on Microsoft IIS 7.5 Web Server.
-PHP Version 5.4.21 Non Threaded 32-bit version
-WISP (Windows, IIS, SQL Server/Express, and PHP) stack and an ASP.NET web application
HTTPS ( SSL )
We will ultimately deploy an ASP.NET Web Application and a PHP Web Application on the Same IIS Server.
User will first log on to the ASP.NET Web Application, but we want the user to be able to navigate between the ASP.NET Web Application and the PHP Web Application back and forth with ease.
We were planning on using a Distributed Cache technology to share session information between the ASP.NET Web Application and the PHP Web Application.
Could I use Microsoft AppFabric Caching for communication between PHP and ASP.NET? Will Microsoft AppFabric Caching work with PHP? If yes, how well does Microsoft AppFabric Caching work with PHP?
I would say your best bet is to write some sort of standards compliant wrapper around your cache API. Something like a REST service that works equally well in PHP and ASP.NET.
So in that solution you would have :
ASP.NET Web Application
ASP.NET Hosted Web API -or- ASP.NET Hosted WCF webHttpBinding
PHP Hosted Web Application
Your two web applications should then share serialized JSON or XML objects through the REST service.
I want to use PHP to build web application for my client(s) but I don't want my code to be read by other(s) when the web is deployed onto a shared web server.
How can I protect my PHP codes?
File system permissions to restrict access.
Use ioncube encoder or zend guard.