如何在本地使用PHP与SQL Server

I am a desktop application / database programmer customizing an ERP application in a Windows environment. I have also done documentation with HTML and javascript on our intranet. I have not done any web programming.

I need to convert an Access 2003 application. Instead of using .Net I think it would be wiser to use HTML to allow access from a tablet. This app will display drawings based on certain lookup values (i.e. part number) stored in a SQL server database. After some research it seems PHP is the best choice. But the things I have found explain on a server supplying the pages and not running locally. I see Apache and IIS mentioned but are these needed if the pages will be loaded on a single machine (or multiple machines but all pages will be present in a single directory structure).

When I search for running pages locally I get pages accessing a databse locally. But the database will be on a server.

Can someone steer me in the right direction?

Since you don't want the presented data to be web-accessible (or at least not public), but you do want the presentation to be through HTML-pages, I can come up with two ideas:

  1. Use a scripting language to access MS SQL Server, extract the data, and present it as HTML. Since you like PHP, maybe Perl with a suitable DB-access library might be a good idea.
  2. PHP as you suggest, some kind of web-server, and a rigorous lock-down configuration so that the webserver is only accessible locally. Depending on the sensitivity of your data, this might be the worse option.

if you want to use PHP then if you put your application online you can use MySql for the database. You will not need to make any changes because any web server uses mysql with php. If you want to use PHP with SQL server then you will need on your server to install the Microsoft Drivers for PHP for SQL Server . in the following link you will have the documentation: [www.microsoft.com/en-us/download/details.aspx?id=20098][1]

PHP has a built-in webserver since 5.4.0: http://php.net/manual/en/features.commandline.webserver.php

If you have PHP (>= 5.4) on your machine, you already have a webserver.

Enable Internet Information Server on your Windows system (using "Turn Windows Features on or off in the control panel) and install PHP: http://php.iis.net/

Alternatively Apache xampp installs the Apache webserver, MySQL (when wanted) and PHP on your system: https://www.apachefriends.org/index.html. To connect to Sql Server you have to remove the semicolon ; before the extension=php_mssql.dll line in the php.ini.

If i understand your question correctly you want to have the database on the tablet. That is possible, simply by installing the web and database server locally. Restrictions might apply depending on your tablet (OS) manufacturer though.
You could also have a "regular" web server / database server setup, and use the localstorage of your tablet's browser to have the result pages available in offline mode, and sync your data when possible, using php and maybe ajax scripts.