Posts

htaccess: Redirecting multiple domains to the main domain

Let's say this is the main domain: mywebsite.com.au And you'd like to redirect several other domains that you have purchased to this main domain.The steps shown below redirects all www, non-www, http and https variations and also matches the internal pages. Step 1: Go to your DNS provider's website and point each of those purchased domains to the server that is hosting your main domain. In other words, add the IP address of your hosting server in the A record. Step 2: Log in to your WHM. Then park each domain on top of the main domain. You may be able to do this in cPanel > Aliases but I haven't tried. Step 3: If you have AutoSSL enabled, all the additional parked domains will automatically get SSL added. This may take some time. Alternatively, you can go to WHM > Manage AutoSSL and Run AutoSSL Check. Step 4: Add your parked domains to your .htaccess file as shown below. Note the "$" at the end of this line: ^www\.mywebsite\.com$ . This ...

Getting iframe tag to work in TinyMCE

If iframe tag does not work in TinyMCE (ie when iframe tag is inserted into the HTML editor, the code is simply removed), it must be enabled by modifying the tinyMCE.init function in the application and adding the extended_valid_elements option: tinyMCE.init({   ...   extended_valid_elements : "iframe[src| allowfullscreen |frameborder|style|scrolling|class|width|height|name|align]" }); This will make the iframe tag immediately available in the editor. To check if the new settings have been added, tinyMCE.settings.extended_valid_elements can be typed into the Firefox or Chrome console.

Increase the redo log size using innodb_log_file_size

Got this error while trying to import a large .sql file in MySQL Workbench: ERROR 1118 (42000) at line 171970: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size. Solution to the above error in XAMPP is as follows: In xampp\mysql\bin\my.ini file, set innodb_log_file_size = 128M (the default value was around 20M) Save the file and restart MySQL server.

How to resolve 'res://ieframe.dll/acr_error.htm#' error (Internet Explorer stopped working while viewing a website)

While testing a website I was developing, I got an error message saying "Internet Explorer has stopped working". This is followed by this line added before the URL: res://ieframe.dll/acr_error.htm# . I was using Internet Explorer 11 in Windows 7 64-bit machine. I tried disabling all add-ons in IE but that did not resolve the issue. I've found this solution to my problem: From Tools menu, open "Internet options". Go to the Advanced tab. Under "Accelerated graphics", tick the box that says "Use software rendering instead of GPU rendering". Click Apply and Ok. Test your website. You might need to restart your computer if it does not immediately show any effect. This worked for me.

XAMPP MercuryMail shutdown unexpectedly

When MercuryMail shuts down unexpectedly, you get the following message on XAMPP control panel: Error: Mercury shutdown unexpectedly. 6:25:56 PM  [mercury]     This may be due to a blocked port, missing dependencies, 6:25:56 PM  [mercury]     improper privileges, a crash, or a shutdown by another method. I restarted Mercury but that did not help. However this worked for me. Open up your Mercury's /QUEUE directory. It should be located somewhere at "C:\xampp1.8.3\MercuryMail\QUEUE". There should be one or more *.QCF files. Delete all of them. Then start Mercury from XAMPP Control Panel.

Cygwin cygintl-2.dll issue with 'ls' command in Win 7

After installing Cygwin, there was a warning on the Win 7 command prompt that says 'cygintl-2.dll' file is missing. It turned out to be a conflict between Cygwin and OpenSSH program, which I had installed prior to Cygwin. 'ls.exe' was part of both Cygwin's /bin and OpenSSH's /bin directories and it looked like the 'ls' command was running off OpenSSH's path. I just uninstalled OpenSSH. Then it started working again. Alternatively, I could simply remove OpenSSH from the Window's PATH. That might have resolved the issue too but didn't try. If you have found another solution, free free to share.

MySQL: How to find tables that are using a certain column name?

This SQL helps you list the tables with a certain column name. As you can see in the script, you can also use comma-separated multiple column names. SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ('column_name1', 'column_name2') AND TABLE_SCHEMA='database_name' You may also use "COLUMN_NAME LIKE" to find a closer match of something you are looking for such as: SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE 'column_name%' AND TABLE_SCHEMA='database_name'

"421 service not available closing channel" error

I was trying to send emails to my localhost account in Windows Live Mail and it's giving me an error message "421 service not available closing channel". This is nothing to do with the email client. This is an issue in xampp's MercuryMail folder. I am using XAMPP 1.8.3 and it appears MercuryMail seems to have "QUEUE" folder missing. Place a "QUEUE" folder inside MercuryMail as in "C:\xampp1.8.3\MercuryMail\QUEUE" and this problem goes away. The same path for the QUEUE folder should be used in the "Mail queue" tab in Mercury's Configuration > Mercury Core Module Configuration.

Case sensitive table names in MySQL

In Windows, MySQL database tables are saved with lowercase letters. When you import tables with case sensitive names, these get converted into lowercase names. If you want to maintain case sensitivity in MySQL database, do the following: In your MySQL installation folder, find my.ini file and open it. If you are using xampp, it's usually located in /mysql/bin/ directory. In [mysqld] section, modify the value of lower_case_table_names to 0. If this entry is not there already, simply add this line: lower_case_table_names = 0 Then restart your MySQL server.

How to make jQuery Cycle2 plugin compatible with old Cycle plugin?

Malsup's Cycle2 plugin does not work with old Cycle plugin if both of them are used on the same page. It's because both these plugins use the same cycle() method name. In order to make both of them work on the same page, one of the plugin's cycle() method must be renamed. I tried this with Cycle 2 version 2.1.2 minified production js file and it seems to work fine. If you are using non-minified file, I think the steps will be pretty similar. Follow the steps below. Open up jquery.cycle2.min.js file and replace all "fn.cycle" with "fn.cycle2" and ".cycle(" with ".cycle2(". You don't need to change the class names, etc. If you are initialising the slideshow by invoking the cycle() method in your view or anywhere else, you will need to change the function call too, such as "$('.myslideshow').cycle2()". If you are using additional plugin files of Cycle2, perform find and replace as shown above on each of the ...

Deprecated: mysql_connect() error in Opencart 1.5.6.1

In my new xampp 1.8.3 installation, I installed Opencart 1.5.6.1 and received a deprecated warning message such as: Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in ....\system\database\mysql.php on line 6 The quick way to resolve this issue is by making a small change to the config.php and admin/config.php files. In both these config.php files, look for the line define('DB_DRIVER', 'mysql'); Modify the above line to define('DB_DRIVER', 'mysqli'); The new line will simply connect to the database from system/database/mysqli.php file.

PHPBB3 Error: Could not get style data

I moved PHPBB3 files and database from my windows localhost to Linux based remote server. After changing the settings in the remote server's config.php files, I got an error Could not get style data when trying to get to the forum. The reason for this error was that cache subdirectory was not writeable. Just chmod 777 cache and you should be fine.

Joomla: How to add module position within the module or component layout template?

In your site template, you can use something like this to load modules in certain positions: <jdoc:include name="position-0" type="modules" /> You can't use the above markup within the module or component layout template (we are talking about the php files inside /tmpl subdirectory of your module or component's view). But there is a workaround. Method 1: This is a straight Joomla code. You can use the following code to load modules within the module or component layout templates: <?php $document = &JFactory::getDocument(); $renderer = $document->loadRenderer('modules'); $position = 'position-0'; $options = array('style' => 'raw'); echo $renderer->render($position, $options, null); ?> This will load the modules that are assigned in "position-0" position. Method 2: There is another method using an extension if you don't want to write all those lines of code. You...

Step-by-step guide to transfering your web hosting to a new web host with domain transfer

If you are planning to move your website to a new host along with domain transfer, here are some easy tips to follow. First, allow plenty of time- at least a week before your hosting plan expires. You do not have to let your existing host know about your plan to move away from them. However, you have to be aware of the auto-renewal feature. Your existing host may have auto-renewal turned on in your account. What this does is - they auto renew your hosting and/or domain 7 to 14 days prior to the expiry date. If you are not sure, check with them if they have auto-renewal enabled in your account. If they have it enabled, request for the auto-renewal to be turned off. You can then take your time to transfer your hosting and/or domain. Backup everything from your existing web space - all files and folders inside the /public_html or /www folder and the databases.

MailChimp API V2.0 SSL error solution

I got this SSL error while trying to use MailChimp API V2.0 in my localhost. Fatal error: Uncaught exception 'Mailchimp_HttpError' with message 'API call to lists/list failed: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed' in C:\Installation\xampp\htdocs\mailchimp-test\Mailchimp.php:192 Stack trace: #0 C:\Installation\xampp\htdocs\mailchimp-test\mailchimp-api.php(16): Mailchimp->call('lists/list', Array) #1 {main} thrown in C:\Installation\xampp\htdocs\mailchimp-test\Mailchimp.php on line 192 To resolve this, you can try any of the methods below. Method 1: Download cacert.pem file from here: http://curl.haxx.se/docs/caextract.html Save the file in your PHP installation folder. I am using xampp. So I saved it in C:\Installation\xampp\php\cacert.pem Open your php.ini file and add this line: curl.cainfo="C:\Installation\xampp\php\cacert.pem...

MySQL: How to delete records by date

Delete records where date is less than a certain date: DELETE FROM `tablename` WHERE `date` < '2012-08-01'; You can also include intervals: DELETE FROM `tablename` WHERE `date`  < DATE_SUB(NOW(), INTERVAL 3 MONTH); DELETE FROM `tablename` WHERE `date`  < DATE_SUB(NOW(), INTERVAL 3 WEEK); DELETE FROM `tablename` WHERE `date`  < DATE_SUB(NOW(), INTERVAL 2 DAY);

Concrete5: Unable to get permission key for read

C5 version 5.6.0.2. I was creating a block. It wasn't finished. While I was tweaking the code, I got this error: Unable to get permission key for read. The CCM bar disappeared and I was unable to go back to the homepage. After searching through the forums, I am still unable to find a perfect solution at the time of this writing. If you get this error, you can try the following: Go directly to your dashboard such as http://localhost/site/dashboard Go to Cache and Speed Settings Turn off Basic Cache and Overrides Cache Clear Cache See if you can access your homepage now. If it still doesn't work, uninstall the block you are working on. You can then reinstall it again. That worked for me!

Concrete5: Using "key" as table field name gives MySQL error

Image
Tested in v5.6.0.2. When you are writing table schema for a block in db.xml and have field name as "key", this generates MySQL syntax error while trying to install a package. Just rename the field name to something else. I think it's because "key" already represents a primary key attribute and using the same name again in field name somehow causes conflict.

Wordpress: Dynamically watermark all the uploaded images

I found a nice solution to dynamically watermark all the uploaded images in Wordpress. I'm not going to repost the solution here. Here is the link: http://dolcepixel.com/how-to-watermark-all-your-uploaded-images/ . You can also download a zip file that includes the image, php file and htaccess code.

Solution to "MySQL Server has gone away" error

When I was trying to import a large sql file (about 11MB) in phpMyAdmin, I got "Error 2006: MySQL server has gone away". Solution to the above error in XAMPP is as follows: In xampp\mysql\bin\my.ini file, set max_allowed_packet to something like 10M or 20M (larger than the sql file you are trying to import) Save the file and restart Apache and MySQL servers. That should do it. There is no need to make changes to php.ini in this case. However, if you need to import even larger file (say 4GB) , then you will need to modify both my.ini and php.ini file. For modifying xampp\mysql\bin\my.ini , follow the steps as above to set max_allowed_packet = 4GB. Then modify xampp\php\php.ini , set post_max_size = 4G upload_max_filesize = 4G Save the files and restart Apache and MySQL servers.