Search blog

Showing posts with label XAMPP. Show all posts
Showing posts with label XAMPP. Show all posts

Friday, September 5, 2014

Drupal cache_rules error, Error: Tablespace for table abc exists. Please DISCARD the tablespace before IMPORT

I got these queer error today with my site viz:

Error #1. 'cache_rules does not exist in database'
Error #2: 'Error: Tablespace for table abc exists. Please DISCARD the tablespace before IMPORT' in XAMPP using phpMyAdmin & MySQL.

There are various ways to fix these errors. I've listed them below:

Solution 1. Manually create the table using the following SQL query:

DROP TABLE cache_rules ;
CREATE TABLE IF NOT EXISTS `cache_rules` (
  `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
  `data` longblob COMMENT 'A collection of data to cache.',
  `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
  `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cache table for the rules engine to store configured items.';


Solution 2: If the above solution doesn't work for you and you get error relating to 'tablespace' saying 'Error: Tablespace for table abc exists. Please DISCARD the tablespace before IMPORT' in XAMPP using phpMyAdmin & MySQL.'

There might be either one of the two or both the files 'tablename.ibd' or 'tablename.frm' files left in the location 'C:\xampp\mysql\data\database_name\' Delete those files, in our case it will be 'cache_rules.ibd' or 'cache_rules.frm.' Your problem should be resolved now and you should be able to create/import the 'cache_rules' table.

You might also check the following solution for your 'tablespace' issue: http://tinyurl.com/me69h6x

Saturday, June 29, 2013

Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?, xampp 1.8.1

Enabling SSL Socket Transport in Xampp 1.8.1

1. First you will need to stop your 'apache' services.

2. Then open php.ini which is located in '\xampp\php.'

3. Find libeay32.dll and ssleay32.dll in xampp\php\ folder, and copy it into  xampp\apache\bin\ folder. Just overwrite the older files in there.

4. Edit php.ini file in xampp\apache\bin, remove the semicolon in “;extension=php_openssl.dll”
If you can’t find this line, just insert “extension=php_openssl.dll” in your php.ini

5. Start the Apache services.

6. That’s it, your SSL transport socket in your XAMPP has been activated.

Else try this:

Please try this: http://www.leoganda.net/how-to-enable-xampp-ssl-socket-transport/

Friday, December 7, 2012

Creating Virtual Host on Xampp 1.8.1

Firstly, please follow all the steps mentioned in this post of mine: http://soluzione08.blogspot.in/2012/02/creating-virtual-hosts-on-apache.html and then add this line 'Require all granted' as below for all your virtual host setup.The changes should be made to the file 'httpd-vhosts.conf'

<Directory "c:/vhosts/sandbox.wp">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>

Note: The above code is an example for a Name-based Virtual Host. For and IP-based Virtual Host you will have to replace the Name with the IP which usually is "127.0.0.1" on a localhost.

Tuesday, November 6, 2012

Default Ports of XAMPP

ftp             21/tcp              # File Transfer [Control] (XAMPP: FTP Default Port)
smtp          25/tcp             mail # Simple Mail Transfer (XAMPP: SMTP Default Port)
http           80/tcp             # World Wide Web HTTP (XAMPP: Apache Default Port)
pop3          110/tcp           # Post Office Protocol - Version 3 (XAMPP: POP3 Default Port)
imap          143/tcp           # Internet Message Access Protocol (XAMPP: IMAP Default Port)
https          443/tcp           # http protocol over TLS/SSL (XAMPP: Apache SSL Port)
mysql        3306/tcp         # MySQL (XAMPP: MySQL Default Port)
AJP/1.3     8009               # AJP/1.3 (XAMPP: Tomcat AJP/1.3 Port)
http-alt      8080/tcp         # HTTP Alternate (see port 80) (XAMPP: Tomcat Default Port)

Sunday, March 4, 2012

How to view Apache error log files in Windows?

If you ever wanted to view your Apache Log files from your local computer or Windows Operating System (Xp, Vista, Windows 7) and were unable to do so, this awesome software can do the task for you. You must have noticed the log files are usually very large in size  and won't open in text editors like Notepad causing them to hang.

As the website states "Apache Logs Viewer (ALV) is a free and powerful tool which lets you monitor, view and analyze Apache/IIS logs with more ease. It offers search and filter functionality for the log file, highlighting the various http requests based on their status code. There is also a report facility, thus you can generate a pie/bar chart in seconds. Together with this there are also statistics where you can get the top hits, top errors, number of status codes, total bandwidth and more."

So here are the links:

1. Setup File: http://www.apacheviewer.com/download.php?new=1
2. Help File: http://www.apacheviewer.com/ApacheLogsViewer_Help.pdf

Saturday, February 18, 2012

Creating Virtual Hosts on Apache Web Server

For setting up Virtual Host in XAMPP 1.8.1 please visit the following page: http://soluzione08.blogspot.in/2012/12/creating-virtual-host-on-xampp-181.html

Note: The settings below are for general websites. For Drupal specific settings visit the following page: http://drupal.org/node/161975

When it’s first installed, Apache is capable of hosting only one website, which is identified in a local testing environment by the URL http://localhost/. To get around this restriction, it’s common practice to develop websites in subfolders of the Apache server root. For example, if you have two sites called site1 and site2 and create separate subfolders for them in the server root, you access them in your testing environment as http:// localhost/site1/ and http://localhost/site2/. This works perfectly well as long as you use document-relative links all the time. However, if you want to use links relative to the site root, you need to create virtual hosts for each site.

Virtual hosting is a technique that web servers use to host more than one website on the same machine. If you have bought a web-hosting package from a hosting company, it’s almost certainly on a shared server that uses virtual hosts. Continuing with the previous example, once you create virtual hosts for site1 and site2 in Apache, you can test them locally using http://site1/ and http://site2/. This is essential for testing sites that use links relative to the site root. If you’re serious about web development, you should learn sooner or later how to set up virtual hosts in your testing environment. Once you have mastered the technique, it takes only a few minutes to set up each one.

You can call your virtual hosts whatever you like, as long as you don’t use any spaces or characters that would be illegal in a domain name. I always use the same name as the actual website, without the top-level domain. For example, for my own site, http://foundationphp.com/, I have created a virtual host called foundationphp in my local testing setup. This means that I access it as http://foundationphp/. It’s then a simple matter of clicking in the browser address bar and adding the .com to see the live site. Whatever you do, don’t use the top-level domain as the name of a virtual host in your testing setup. If you do, your computer will always point to the local version of the site and never access the real one on the Internet.

Apache allows you to create as many virtual hosts as you want. It’s a two-stage process. First, you tell the operating system the names of the virtual hosts, and then you tell Apache where the files will be located. There are separate instructions for Windows and Mac OS X.

Registering virtual hosts on Windows


Although you can locate your virtual hosts anywhere on your hard drive system, it’s a good idea to keep them in a single top-level folder, as this makes it easier to set the correct permissions in Apache. The following instructions assume that all your virtual hosts are kept in a folder called C:\vhosts and show you how to create a virtual host called dwcs4 within that folder.

To edit the necessary files in Vista, you need to select Run as administrator even if you are logged in to an administrator account. For Notepad, go to Start ➤ All Programs ➤ Accessories, right-click Notepad, and select Run as administrator from the context menu.
Enter your administrator password when prompted. Inside Notepad, select File ➤ Open and navigate to the relevant file. The Open dialog box in Notepad shows only .txt files, so you need to select All Files (*.*) from the drop-down menu at the bottom right of the dialog box.

STEPS For Configuration:


1. Create a folder called C:\vhosts and a subfolder inside it called dwcs4.

2. Open C:\WINDOWS\system32\drivers\etc\hosts in Notepad or a script editor and look for the following line at the bottom of the file:
127.0.0.1 localhost
127.0.0.1 is the IP address that every computer uses to refer to itself.
3. On a separate line, enter 127.0.0.1, followed by some space and the name of the virtual host. For instance, to set up a virtual host for this book, enter the following:
127.0.0.1 dwcs4 or 127.0.0.1 sackid.local and also set ServerName (see bottom page to know more) also to sackid.local if you want something like http://sackid.local
4. If you want to register any further virtual hosts, add each one on a separate line and point to the same IP address. Save the hosts file and close it.

5. Open the Apache configuration file, httpd.conf. The default location is C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf. If you installed XAMPP, it should be at C:\xampp\apache\conf\httpd.conf.

6. Scroll down to the Supplemental configuration section at the end of httpd.conf, and locate the following section:
7. Apache uses the hash sign (#) to indicate comments in its configuration files.  Uncomment the command shown on line 463 in the preceding screenshot by removing the #, like this:
Include conf/extra/httpd-vhosts.conf
This tells Apache to include the virtual host configuration file, which you must now edit.

8. Save httpd.conf, and close it.

9. Open httpd-vhosts.conf. The default location is C:\Program Files\Apache Software Foundation\Apache2.2\conf\extra\httpd-vhosts.conf. If you installed XAMPP, it should be at C:\xampp\apache\conf\extra\httpd-vhosts.conf. The main part of the file looks like this:

10. Position your cursor in the blank space shown on line 15 in the preceding screenshot, and insert the following four lines of code:

<Directory C:/vhosts>
Order Deny,Allow
Allow from all
</Directory>


This sets the correct permissions for the folder that contains the sites you want to treat as virtual hosts. If you chose a location other than C:\vhosts as the top-level folder, replace the pathname in the first line. Remember to use forward slashes in place of backward slashes. Also surround the pathname in quotes if it contains any spaces.

11. Lines 27–42 in the preceding screenshot are examples of virtual host definitions. They show all the commands that can be used, but only DocumentRoot and ServerName are required. When you enable virtual hosting, Apache disables the main server root, so the first definition needs to reproduce the original server root. You then add each new virtual host within a pair of <VirtualHost> tags, using the location of the site’s web files as the value for DocumentRoot and the name of the virtual host for ServerName. If the path contains any spaces, enclose the whole path in quotes. If your server root is located, like mine, at C:\htdocs, and you are adding dwcs4 as a virtual host in C:\vhosts, change the code shown on lines 27–42 so they look like this:

<VirtualHost *:80>
DocumentRoot c:/htdocs
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot c:/vhosts/dwcs4
ServerName sackid.local
</VirtualHost>


For XAMPP, use C:/xampp/htdocs instead of C:/htdocs.

12. Save httpd-vhosts.conf, and restart Apache. All sites in the server root will continue to be accessible through http://localhost/sitename/. Anything in a virtual host will be accessible through a direct address, such as http://dwcs4/.

Top 5 Posts (Weekly)