Apache allows you to map file system paths to alias file paths. This allows you to place files or code in a folder outside of your websites install directory, but still allows you to access the contents of the folder through your websites domain name. Apache is typically configured to include all files in "/etc/httpd/conf.d/"…
Often it can be quite hard to debug SQL errors when using PHP since PHP will often throw a generic error that doesn't really help you diagnose the situation. Other times you may not want to allow PHP errors to be shown. A quick way to debug PDO SQL errors is to use the or…
In this tutorial I am going to go through all the basic SQL commands using PDO prepared statements. The use of prepared statements is 1 very simple way you can try and defend against SQL Injection. First thing you want to do is set up a connection to the database. The code for this is…
This will guide will show you what you need to do to install phpmyadmin on CentOS via command line. In order to install phpMyAdmin you need to add a repository that contains the download. You can add the repository by executing the following command. rpm -ivh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/i386/epel-release-6-8.noarch.rpm Once the repository has been added you will…
There are several ways to protect a directory from URL access but most of these will also block your website from being able to access them. Heres what you do to protect a directory from being accessed by a URL but still let your website access the contents of the directory. Open the directory you…
elFinder is a great file manager to use to manage files on your web servers hard drive. It can be configured to work with TinyMCE or called on it's own which is what I am going to demonstrate here. When browsing files I wanted to be able to select a file and then to get…
Directory ownership is something that often needs to be changed when an application requires read or write permissions for a directory. This can be a bit tricky to get right at times, but generally you can achieve everything you want using a chown command. Chown is used to change the ownership of a directory from…
This is quite a common issue that can be caused by a few different things, all of which are very simple to fix. If this is a fresh install then the first thing that you should check is your Apache conf file since this is likely the cause. Apaches conf file is usually located in…
There eventually comes a point where you are creating a large amount of posts and manually posting to Facebook is just too time consuming. It's very easy to automate the process of posting to Facebook using PHP. I would suggest you add a custom Facebook title field to your submit form that will allow you…
There are a few examples I have found online, but it took quite a while for me to get all the information I needed to actually make this work. So here is everything that I was able to find to get Cucumber up and running. Start by creating a new folder for the project. Doesn't…