PHP: Using different Windows user credentials with APACHE and WAMP Server - php

In my company we are currently running a WAMP server with SQLSRV drivers for our BD query's, we are looking to use Windows Authentication for SQLSRV connection instead of SQL AUTH , But the default Windows User where the WAMP server is different from the user we need to access the SQLSRV host.
Im looking for a way to change the credentials from the default user to a new user when using Windows Authentication in PHP. I was wondering if is possible to do it from Apache configuration or other tool inside WAMP server.
I have tried starting Apache service as a different user, and the entire WAMP server as different user, but make no difference.

Related

Run PHP over IIS on an external domain

I need to connect to a remote MS sql-server, which allows connection only over Windows Authentication, using php. My actual setup is IIS10.0, PHP 7.5 and the latest SQLSRV driver for php.
The website is located in my local PC. If i set domain identity (e.g. EXTERNALDOMAIN\USER) in application pool identity, website is no longer running (error 503), probably because of no granted permission of external user for my local folder. How can i deal with this problem?

Using windows domain account instead of web server process identity for windows authentication using PDO

I have been trying to connect to a MSSQL database under windows authentication using the PHP PDO library. I have read this documentation http://technet.microsoft.com/en-us/library/cc296205(v=sql.105).aspx and have achieved a connection under the process name for the web server running my PHP code. However I was wondering if it was possible to use the windows credentials of the user logged into the machine running the web server instead of the machine itself?

Windows 2012R2 connecting to remote SQL2012 Server issue PHP Apache

I have created a local project that connects to a SQL2012 database. On my local machine I have Windows 7 64Bit enterprise, with MS SQL drivers with no problem at all. I moved the project over to a Windows Server 2012R2 production machine. I got the web server up and PHP working fine.
I checked the phpinfo() file and sql drivers are enabled and sqlsrv is a 'registered stream'
I have try & catch blocks for all my connections to the database. No errors
I have checked the Apache error logs and there is no indication of a problem connecting to the DB.
My project uses SQL authentication, using a Username and Password - not built in Windows Authentication. I tried to change the password to a incorrect one ---> still no error?!!
I even tried to disable Domain, Public, and Private Window Firewalls. Still nothing.
I'm totally stumped, perhaps someone here may have some ideas.
Does anyone know if the SQLSRV30 pack is compatible with Windows 2012R2?
OK I have figured out what the problem was, I needed to install Microsoft® SQL Server® 2012 Native Client located at: http://www.microsoft.com/en-us/download/confirmation.aspx?id=29065#
After that installed everything is working fine.

IIS php Mysql - databse insert value work on XAMPP & WAMP but does not work on IIS

I have my Windows 7 desktop computer, and created php application which uses mysql database. I tried to run that after creating environment in my desktop with the help of XAMPP. It worked perfectly without any problem. I tested that same application in WAMP and it worked perfectly there also.
However, at the time of deployment to the Windows R2 2008 server, I used IIS to get the application run. Following is the description of firmware installed:
Installed mysql and mysql workbench
Installed IIS using Control panel-> add remove program-> turn on windows feature on off -> iis
Installed php 5.3 version using Microsoft Web platform installer (Web PI).
Activated FastCGI with the help of following link: on-iis#InstallPHP
Updated necessary changed in php.ini file. Activated port 3306 for mysql and port 80 for localhost.
Checked localhost and phpinfo.php file and both work fine.
Deployed application, and tried to run using localhost and 127.0.0.1 as well as from local IP address and it executed the first login page perfectly.
Everything works perfectly. However, I open the entry form in the application, and tried to fill up the form, and when clicked on submit, the data are not getting saved in database.
As a test, I checked by importing the old database and while searching the data in other application page, I am able to see the data coming from the database. But problem only happens when I do any insert any entry or try to submit data, I can't get the data saved in database.
This same thing works perfectly in WAMP and XAMPP however, does not work on IIS environment.
The MySQL user being used to interact with the database may not have the INSERT Grant for that database. WAMP and XAMPP are both using a mysql user with defined privileges. Have you created the same user with the same privileges on the newly created MySQL instance on your Windows 2008 server? You may consider reading over the MySQL Grant syntax. Utilizing mysql_error() for error trapping could prove useful for troubleshooting as well.

Localhost Connection in Different OS

I have two operating systems installed on my computer. Mac and Windows. Currently i'm developing web based application using php, xampp, and sql server 2008.
I installed local server (xampp) on MAC os, and the database engine (sql server 2008) on Windows 2008.
How can I connect my xampp to the database in different OS?
Thank in advanced.
Assuming you are able to boot them simulatinously, the only thing you may need to do is to port forward your router using your db port.
You don't need to do some kind of xampp modification to connect to your database. Xampp is a single workstation solution for Apache, MySQL, php bundle. You are able to use any of them in collaboration with any other outer resource.
You may want to configure your phpmyadmin to connect your new db. Necessary config file is located here: /opt/lampp/phpmyadmin/config.inc.php

Categories