Web Server

Fix “No data was received to import…” in phpMyAdmin with IIS

I have Windows 2008 R2 VPS & already installed IIS v7.5, PHP & MySQL.

I move some of my websites to this new VPS & try to import MySQL database via phpMyAdmin. I was greeted with following error.

No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.

FAQ 1.16 does not help because it only says that my upload database size is too big. I only try to import 5kb database way below the limit.

Further digging reveal that the problem caused by the temporary directory PHP uses for uploads. By default this is C:\Windows\Temp, which is not writable for PHP.

To solve this,

1. Edit “php.ini” file & change

upload_tmp_dir="C:\Windows\temp"

to

upload_tmp_dir="C:\inetpub\temp"

2. Make sure to remove any other “upload_tmp_dir” settings.

3. Set permissions on “C:\inetpub\temp” so that IUSR and IIS_IUSRS have write permission.

4. Restart the web server (IIS)


How to Install Litespeed Webserver on cPanel/WHM VPS Server

Installing and configuring Linux software can be a tedious job for a Linux beginner (including me!). That’s why cPanel is very good tools, and we are willing to pay for it. However, not all software included in cPanel is the best you can find in the market.

For example, Litespeed is a much better webserver when compare to Apache in terms of speed and protection against DDOS. Based on this fact, I decided to try their 15-day trial version.

As mentioned in the beginning of this post, installation is always a hindrance to try a new software. Luckily, Litespeed has cPanel plugin and when you installed this plugin, subsequent steps can be done via cPanel. To install follow steps below.

1. Sign-up for 15 days trial version. You should receive a trial license via email.

2. SSH to your VPS as root and issue the following command.

cd /usr/src; curl http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh | sh

3. Log-in to WHM panel & you should see “Litespeed Web Server” menu under “Plugins” menu.

4. Insert your trial key from (1) above, choose admin username & password and start installing.

5. When finished, you have to build matching PHP Binary. To do this just click, “Build Matching PHP Binary” in Litespeed Plugins page. This process will take approximately 10 minutes.

6. After that you can start to use Litespeed Webserver by selecting “Switch to LiteSpeed” in Litespeed Plugins page.

7. Enjoy the speed of your server. You should see the ” LiteSpeed is running (PID = XXXXX). Apache is not running” message on top of the plugins page.

If you decide to uninstall Litespeed Webserver & cPanel plugins, you may follow the steps below.

1. Uninstall Litespeed Webserver in Litespeed plugins page.

2. When completed, SSH to your VPS as root and issue the following command.

cd /usr/src; curl http://www.litespeedtech.com/packages/cpanel/lsws_whm_plugin_install.sh | sh

3. Done. If you refresh your WHM panel, Litespeed plugins page will be no longer there.