简体   繁体   中英

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:

  1. Installed mysql and mysql workbench
  2. Installed IIS using Control panel-> add remove program-> turn on windows feature on off -> iis
  3. Installed php 5.3 version using Microsoft Web platform installer (Web PI).
  4. Activated FastCGI with the help of following link : on-iis#InstallPHP
  5. Updated necessary changed in php.ini file. Activated port 3306 for mysql and port 80 for localhost.
  6. Checked localhost and phpinfo.php file and both work fine.
  7. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM