Mod Rewrite Enabled But Not Working

If you find that your mod rewrite is enabled, but doesn’t seem to be working you may need to add this little bit of code to your httpd.conf file.

AllowOverride All

It’s possible your file might have the following:

AllowOverride None

If your AllowOverride was set to none then your .htaccess files in your project directory are not able to set their own settings including url rewriting.

Make sure to restart Apache after applying this change to your httpd.conf file.

 

The following link helped me solve my problem.

http://stackoverflow.com/questions/17772962/laravel-4-simple-route-not-working-using-mod-rewrite-and-htaccess

How-To's

How To Fix Plex Media Server Not Recognizing Files On Separate Hard Drive

If Plex Media Server can’t find your files which are located on a separate hard drive other than the hard drive Linux is on chances are it needs to be mounted.

This how to will be focused on Ubuntu, but I believe will work on other Linux versions as well.

Most likely if you want to use the other hard drive you’ll want it to auto mount.
Auto mount will mount the hard drive on boot.

But first we need to get the Universal Unique Identifier of the drive.
In the terminal type

sudo blkid

Take note of the UUID and the Type. We’ll use this to mount the drive.
Let’s pretend my UUID is abcdefghi and type is NTFS

Next create a folder located on the same hard drive as your Linux installation.
This folder will be used as a mount point for the other hard drive.
In the terminal type

sudo mkdir /media/data

Replace data with the desire folder name to create.

Make a back up and then modify the fstab file.
This file is in charge of auto mounting
In the terminal type

sudo cp /etc/fstab /etc/fstab.old
sudo gedit /etc/fstab

The last command should launch an editor.
In the editor add a new line

UUID=abcdefghi /media/data ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0

NOTE: the second and third parameters will change depending on the type we found earlier.
Visit this fstab Ubuntu link for more details and look for file system specific examples.

This mounting windows partitions from Ubuntu link helped solve my specific problem which was plex not recognizing my files which are located on a separate hard drive from my Linux installation.

How-To's, Tech

How To Fix Android Studio Not Opening

Google recently released an Android Studio. Developers have been wanting this for sometime now.

I was super excited to try it out and after installing it wouldn’t open. I did some searching and some people are having problems with it detecting the JDK installation path and the system environment path.

It’s a real easy fix.

First, make sure you have the JDK installed on your machine.

Secondly make sure you have a system variable JDK_HOME set to your JDK install folder

After those two steps have been completed Android Studio should launch.

This post on XDA developer forums help me fix my issue.

How-To's, Interesting, Tech

How To Watch Netflix Outside The U.S.

First you’ll need a Netflix account. If you don’t have a Netflix account and want to sign up, but can’t because you’re overseas this is where Spotflux also comes in.

Secondly you’ll need to install and run Spotflux. Your internet connection might drop for a minute after installing. Spotflux needs to makes some changes to the internet connection which temporarily disrupts the connection.

Spotflux routes all of your traffic through it’s servers in the U.S. tricking Netflix into thinking you’re in the U.S..
Allowing you to watch Netflix overseas for free, assuming you have a Netflix account.

Your connection might be slow for two reasons.
One, geologically the distance between you and Spotflux servers is great.
Two, your connection is already slow.

Not only does Spotflux encrypt your traffic to keep it safe from prying eyes, but it also removes ads, tracking cookies, and other malware.
According to their site:

The location and identity of your devices are concealed. Your connection to the internet is safe, more private, and unrestricted.

Spotflux is also useful if you’re using public WiFi because if your traffic isn’t encrypted anyone on the network can see what sites your browsing and potentially username/passwords.

 

You can download Spotflux here.

Xampp Send Email Issues

After upgrading my xampp installation I had issues sending email.

I wrote a small test PHP page and it was saying my emails were being sent, but I never received them. Obviously something was misconfigured.

I thought I correctly edited my php.ini file, but it turns out all the tinkering I did with it may have caused the issues.

Search your php.ini file for [mail function].

  1. Remove the comment on smtp and smtp_port by removing the semi colons before them.
  2. Add smtp server, port number. I’m using my ISP smtp server. Find your ISP smtp settings by searching google.
  3. sendmail_from needs to be set only if you don’t specify a from header in your PHP code. This can be set to any email address.
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = examplesmtpserver.com
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = email you want to send from (ex: [email protected]). This needs to be set or a from header must be added in the php mail code

 

Here is test PHP code that I used. You’ll have to edit the “to” variable to your email address.

$to = "your email here";
$subject = "Test Email";
$body = "Email for testing Xampp";

if (mail($to, $subject, $body)){
	echo("Message successfully sent!");
} 
else{
	echo("Message delivery failed…");
}

After visiting your created PHP page the page should tell you whether PHP sent your email. Please note that just because PHP says it sent the mail doesn’t actually mean the email will be delivered  While I was having issues PHP still said it successfully sent, but I wasn’t receiving emails. If you’re still having problems after it says email successfully sent you’ll have to do more digging.

Contact me if you have questions I’ll do my best to assist [email protected].

 

 

SoapClient Error after enabling FedEx Shipping Method on Magento Ecommerce Solution

In this tutorial I will explain how to fix the SoapClient error and why it happened. My server threw this error after enabling the FedEx shipping option in Magento running 1.7. I isolated the issue to the FedEx shipping option because every time I enabled FedEx the shopping cart. The next step was to check the Magento error logs which gave me the errors below.

2012-10-19T03:57:53+00:00 ERR (3): Warning: include(SoapClient.php): failed to open stream: No such file or directory  in /var/www/vhosts/www.domain.com/httpdocs/lib/Varien/Autoload.php on line 93
2012-10-19T03:57:53+00:00 ERR (3): Warning: include(SoapClient.php): failed to open stream: No such file or directory  in /var/www/vhosts/www.domain.com/httpdocs/lib/Varien/Autoload.php on line 93
2012-10-19T03:57:53+00:00 ERR (3): Warning: include(): Failed opening 'SoapClient.php' for inclusion (include_path='/var/www/vhosts/www.domain.com/httpdocs/app/code/local:/var/www/vhosts/www.domain.com/httpdocs/app/code/community:/var/www/vhosts/www.domain.com/httpdocs/app/code/core:/var/www/vhosts/www.domain.com/httpdocs/lib:.:')  in /var/www/vhosts/www.domain.com/httpdocs/lib/Varien/Autoload.php on line 93

First I’ll explain why it happened. The reason for my SoapClient error was the php-common and php-soap extensions were at a different version than my PHP installation itself.
PHP was at version 5.3.3 and php-common and php-soap were at 5.3.17. So it’s important to make sure that the PHP extension versions are compatible with the PHP version.

Secondly I’ll explain how to fix this issue. It was extremely easy.
*Note:  There is always the potential that an update may break your site make sure you have a backup in place and ready to go before completing this process!
I simply ran the following command. I knew the PHP version was old compared to the extensions so this updates the PHP installation.

yum update php

After updating the PHP restart Apache by running the following command.

service httpd restart

Refresh the website and verify the checkout works properly.

If you have questions feel free to email [email protected] or leave a comment below.

How-To's, Tech

How to Upgrade Magento from 1.6.2 to 1.7 Using Magento Connect

In this tutorial I will explain how to upgrade the Magento ecommerce solution from 1.6 to 1.7 using Magento connect.

First login to the Magento admin page.

Hover over System then hover over Magento Connect then click on Magento Connect Manager.

On the right side of where it says “Manage Existing Extensions” click on “Check for Upgrades”.

After it finishes scroll through the list of extentions and find “Mage_All_Latest” the entire extension should be yellow and in the actions drop down select the latest stable release.

Scroll to bottom of page and click commit changes this will start the upgrade.

Some people may get a timeout if the php execution time takes too long. If this happens make sure to adjust in the php.ini file the max execution time to something longer than default. I set mine to 300 seconds.

If you have any questions use the contact form or email me at [email protected].

Build Email Message Dynamically From Submitted Form

I wrote some code to dynamically generate an email message based on the names of form elements being sent through post.
In this post I’ll describe how it’s done.

The foreach loop grabs the keys from the post array. An example key for this  $_POST[‘Name’] would be “Name”. It’s important to put in the name of the field how you want it to show in the email. So if you want uppercase letters or spaces put them in.

The $keywos (key without spaces) gets the current key in the foreach loop and replaces the underscores that are automatically put in if the name from the HTML form elements had spaces when posting and replaces them with spaces.

Copy the post array to values array

If the current value for a particular key doesn’t have information in it don’t add it to the email message. This means the user hasn’t typed in any information in the input or selected an option.

If the key isn’t equal to submit then add it to the email messages. The submit button doesn’t need to be added to the email message.

 

Have questions? Email me at [email protected].

Understanding AJAX In WordPress Plugins

For me it’s difficult to retain and grasp the programming concept, especially if it’s new, if I don’t understand the why behind the concept. I didn’t  understand how to properly use AJAX in WordPress. I started searching google and found many article explaining how to use it. The problem was it didn’t go into enough detail for me to understand why. The articles said do it this way, but didn’t explain.

The following article from Smashing Magazine goes into great detail on how to use AJAX in WordPress.
http://wp.smashingmagazine.com/2011/10/18/how-to-use-ajax-in-wordpress/

Send me an email [email protected] if you have questions.