Web Hosting for Dummies: What is Web Hosting?!

Posted: July 1, 2007 at 2:18 pm | (3) Comments

Web hosting is a pretty vague term because there are plenty of web hosting types out there, ranging from Shared Web Hosting up to Clustered Web Hosting, I will be explaining all of these in this article.

Shared Web Hosting

This probably is the most popular type of web hosting on the internet. Shared web hosting means you and other people share the same server and are hsoted on the same server. Usually, there is a control panel such as cPanel that helps you manage your email and other features such as MySQL. This is the most common type of web hosting purchased by people who run their own small blog or a small business.

Reseller Web Hosting

This type of web hosting is less popular compared to Shared Web Hosting. Reseller web hosting is a special type of account that comes with a special control panel which generally is WHM and the difference is that Reseller Web Hosting gives you the ability to give away shared web hosting. Typically, start up web hosting companies get Reseller web hosting so that they can offer Shared Web Hosting.

Virtual Private Servers

Virtual Private Servers are pretty common for people who have out grown the resources of Shared web hosting but do not want to pay yet the high prices of dedicated servers. Virtual Private Servers are virtual machines located on dedicated servers; it’s like dividing the server into small servers. However; the Virtual Private Servers are not shared, you have your own operating system, your own kernel. It’s a complete dedicated server environment.

Dedicated Servers

Dedicated servers are a bit less popular due to their high prices however they are usually used by very high traffic websites or web hosting companies who would like to have their own servers instead of working on Reseller Web Hosting. Usually the servers are leased with a specific bandwidth allotment and when purchasing, you usually choose the server’s specifications (RAM, HDD, CPU)

Colocation

Colocation is pretty close to Dedicated Servers; however, the colocation provider only does provide you with bandwidth, space & power for your server. You have to purchase your own server and send it to the colocation provider. The colocation provider has nothing to do with your server and generally colocation is not recommended unless it’s a local datacenter because of the high costs of repairs.

Clustered Hosting

This most probably is the least used web hosting solution as it comes at a high price and is for high usage sites. They usually have multiple servers and each server would get a specific role, one server could serve all the HTTP traffic and one would manage all the MySQL traffic. Usually; this is a custom solution and it is not sold as packages on the internet.

This article pretty much sums up all the types of web hosting out there, stick around for more articles about web hosting, make sure to subscribe to this blog!

Only CSS hack you’ll ever need, seriously.

Posted: March 1, 2007 at 10:24 pm | (23) Comments

While working on a few of my clients pages, I’ve always used other methods for CSS hacks but mostly using PHP to detect the remote user User-Agent and come up with the specific CSS. Until I’ve discovered this one:

You can actually have IE6 specific lines in CSS, it’s as simple as prefixing them with an underscore. Sure, you might start complaining “STANDARDS!!11!” – If I had to choose from a site that works fine in every browser and standards, I’ll go with the more working one. That’s not all! You can actually have lines that are both IE6 & IE7 specific in CSS by prefixing them with a dot.

So to sum it up, let’s say if I use a left margin that has to be 5px in Firefox/Opera, 6px for IE6 & 7px for IE7 – Here’s how I would do it:

1
2
3
margin-left: 5px; /* Left margin for all browsers, mainly Opera, Firefox, etc. */
.margin-left: 7px; /* Left margin of 7px that can be readable by both IE6 & IE7, now other still think it’s 5 while IE6 & IE7 think it’s 7 */
_margin-left: 6px; /* Only IE6 reads this and changes the value to 6px */

I have to admit I was pretty happy upon discovering this hack; I’ll sure be using it for a while now that I have found a pretty good one.

Do you have any of your own do not need loads of JavaScript and/or PHP code to work? Comment on!

Top 5 new (and cool!) features in PHP5 that you probably haven’t heard of

Posted: January 3, 2007 at 11:23 pm | (27) Comments

PHP5 has brought so much new features but because of its big syntax changes, a big percentage of the PHP developing base has not made the change. Here are the top 10 new features that could change your mind.

5: Better error handling with exceptions
I’m sure every PHP developer had been staring at the famous white screen with a “Syntax error” clueless at where the error is really at. With PHP5, you can actually handle PHP errors and do whatever you want with them, but that’s not all. They have also included exceptions which I’m sure most C++ or Java developers use. The good part is that instead of simply failing on with close no errors to you, you could put a few checks before and information you could need such as maybe a

1
print_r()

on an array. I have written an article about this: http://vexxhost.com/blog/?p=21

4: Completely rewritten MySQL extension
The MySQL databases are the PHP’s partner in crime. Many developers use this database system in their website’s because it is on of the easiest, free, open-source database software. However, its performance combined with PHP4 was close to poor. Introduced with PHP5 is a newer, rewritten, optimized MySQL extension which was also compatible with MySQL 5.0. It has also introduced other functions such as: Prepared statements, SSL connections, Multi-query functions.

3: A heck of a lot more useful functions
I have a few favorite PHP5 functions which speed up time while coding & enhances the website’s performance. One of my favorites is the

1
__autoload()

function – What it does that it would be called if a class that was created and did not exist. It provides you with the class name. This is useful because you don’t need to manage what includes you need for X and Y file and reduces the load for those who simply include all the classes in for every single PHP file. Also, another favorite is

1
file_put_contents()

which reduces the 6 lines of code to add something to one.

2: Finally! SQLite database support!
I’m sure a lot of developers will be happy about this one. While MySQL is very popular among most PHP developers, SQLite is much different than it. It actually uses normal files and reads them. It does not need a daemon (or called server) to run in order to execute any queries on it. It makes a better smaller database for these low traffic sites.

1: The best damn OOP support period
PHP programmers have spent an awful of long time trying to create hacks so in order that PHP can make a better OO programming language. Finally, they are rewarded with OO support that either PHP3 or PHP4 can match. It has anything you usually see in most of the other established coding languages. From Constructors, Destructors, Public, protected, private properties & methods, Interfaces, Abstract classes, Class type hints, Static properties and methods, Final properties and methods & a whole suite of magical methods.

That’s the top 5 for me. I hope you think that PHP5 deserves a try! (and we offer it with our hosting plans!)

What FFMPEG-PHP can do and how to use the most out of it

Posted: December 20, 2006 at 8:49 pm | (12) Comments

Need help using specific FFMPEG-PHP functions or some programming help? Let our experienced technicians help you debug your problem for FREE. Sign up today and post at our online community: FFMPEG-PHP Help Forums

You’ve probably heard of ffmpeg-php and it’s wide usability mostly in sites that involve with videos such as YouTube or any other similar site. Here’s a bit of an introduction to it and how to use it.

First thing, you’ve got to check that your web hosting provider actually has ffmpeg & ffmpeg-php extension installed on your account and then you could get started with ffmpeg. You can check if it’s installed by creating a PHP script and executing the following code:

1
extension_loaded('ffmpeg') or die("ffmpeg extension not loaded");

If you get “ffmpeg extension not loaded” then your web hosting provider does not have ffmpeg installed, if you get nothing, then you’re one the good track!

ffmpeg-php is very simple to learn, what it is pretty much is an interface that works with the ffmpeg software to make it easier for PHP developers to access.

Like any object in PHP, you’ll have to start with creating a new instance of it. You can do that by using the following line:

1
$ffmpegInstance = new ffmpeg_movie(“/path/to/movie/”);

Now that you’ve had that, you can use that instance to use the many features of ffmpeg-php which are from knowing the duration of the movie/audio in seconds to retrieving the bitrate of the movie/audio file.

Once here, it’s pretty much like object oriented programming, ex:

1
2
$ffmpegInstance->getDuration(); // Gets the duration in secs.
$ffmpegInstance->getVideoCodec(); // What type of compression/codec used

This can be very helpful when coding anything that has to do with uploading videos because you can know a lot of information about it. I’ve made a small script that pretty much retrieves all the information that ffmpeg can get right here

Creating PDF’s on the fly using PHP & FPDF

Posted: December 3, 2006 at 12:27 pm | (16) Comments

Generating PDF’s is an easy method to make a very nice printable and/or savable version of an article. This could be helpful in a WordPress blog or any articles website. This method utilizes the popular FPDF class.

First of all, I suggest you get the latest FPDF version from here. I suggest creating a directory such as “pdf” on your web hosting space. You will need to place the fpdf.php into that directory, you will only need it.

Let’s make our first “Hello World” example. Place the following in a file called test.php:

1
2
3
4
5
6
7
8
<?php
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>

Now let’s see that code line by line…

1
require('fpdf.php');

This line includes our FPDF class that we need to create the PDF file.

1
$pdf=new FPDF();

This line creates a new instance of the FPDF class which will be binded to $pdf

1
$pdf->AddPage();

This line tells FPDF to add a new page to the PDF file; obviously we need one page so we will call this function once.

1
$pdf->SetFont('Arial','B',16);

This line tells the FPDF class to change the font to Arial, bold, 16 pt.

1
$pdf->Cell(40,10,'Hello World!');

This line is just like the “echo” of PHP, the text fields in PDF files are just sort of rectangles with text in them, so we want the width of 40 pt. and a height of 10 pt., the third value is the text to be written in that rectangular box.

1
$pdf->Output();

Our final line, which pretty much means: “we’re done, show us our PDF!”

That’s a very simple FPDF usage, however, here is a bit of more advanced version of FPDF usage:

1
2
3
4
5
6
7
8
9
<?php
require('fpdf.php');
$pdf=new FPDF("L", "mm", "A4");
$pdf->AddPage();
$pdf->SetFont('Arial','BIU',30);
$pdf->SetTextColor(0,0,255);
$pdf->Cell(60,20,'PDF+PHP Test',1,1,C,0);
$pdf->Output();
?>

Now let’s do a quick review of that more advanced code:

1
$pdf=new FPDF("L", "mm", "A4");

This will create a new instance but instead will default to creating landscape pages because of the first

1
L

,

1
P

can be used instead to default to portrait pages. The second value is the default measurement unit, a choice of point (

1
pt

), millimeter (

1
mm

), centimeter (

1
cm

) and inch (

1
in

) is given. The last value is the size of the page, the choice of

1
A3

,

1
A4

,

1
A5

,

1
Letter

&

1
Legal

is given.

1
$pdf->AddPage();

Simple function, just add the page, you can tell the function to create either a portrait (

1
P

) or landscape (

1
L

) by giving it as a first value (ex:

1
$pdf->AddPage("L")

,

1
$pdf->AddPage("P")

).

1
$pdf->SetFont('Arial','BIU',38);

This required function again says that we want an Arial, 30 mm in size (because of the default size unit), the

1
'BIU'

simply tells that we want it to be Bold, Italic & Underlined.

1
$pdf->SetTextColor(0,0,255);

This sets the default text color for the text we will be writing, I’ve chosen blue here, the first value is red (

1
r

), the second is green (

1
g

) & blue (

1
b

).

1
$pdf->Cell(60,20,'PDF+PHP Test',0,1,C,0);

This makes the so famous rectangle with 60 mm of width & 20 mm of height, we wrote ‘PDF+PHP Test’ and the first

1
0

means we do not want a border. The

1
1

next to it means that once it’s done the cell, it will go to the beginning of the next line, if

1
0

is provided, then it will be to the right of it, if

1
2

is provided then it will go below. The

1
C

is just the alignment which is center of the text inside the box, possible values are left (

1
L

), center (

1
C

), right (

1
R

).

1
$pdf->Output();

Output our brand new colorful PDF file!

Thanks for reading!

Newer Entries »
« Older Entries

What our clients are saying — Read More →

First of all, we thank you for your best technical support, very easy to share our questions about technical issues with vexxhost.com & very fast to get the best solutions! With your great support, we are thinking to be your guest (client) as long as possible.


Aria R.
Awards — View More →

Technology Partners