August 31, 2010
Hypertext Preprocessor is too hard to remember, so most people just call it PHP, and it should be available free to you from any reliable dedicated hosting provider. But what is PHP?
PHP is a framework that is maintained directly on the server. Server-side frameworks like PHP make coding lightweight and cross-browser compatible, so your PHP code will work almost anytime, anywhere. Similar to HTML, PHP is also open source, which means many of the coding has already been created for you and like with HTML you can copy and paste to your heart’s content.
What PHP means for a Dedicated Server is that you do not have to be a brain surgeon to understand how to create flawless forms, amazing images, and an overall incredible website, utilizing PHP.
Be careful in choosing the best dedicated web host, though, as many hosts do not offer the latest versions of PHP. There is a major difference between PHP 4 and PHP 5, and having the ability to work in either or both is key to the PHP framework.
July 1, 2008
By now you have already installed Apache onto your dedicated server. Now, let’s configure Apache to run with PHP4 or PHP5, whichever is your preference in scripting.
For PHP4, it’s as simple as apt-get:
apt-get install apache2 php4 libapache2-mod-php4
Since PHP5 can be automatically installed if you don’t specify the package ‘4’, you can do that or apt-get:
apt-get install apache2 php5 libapache2-mod-php5
To test and ensure that you are now hosting with PHP4 or PHP5, create a test file called test.php in /var/www folder with phpinfo() function as follows:
nano /var/www/test.php
# test.php
php phpinfo();
Now, just point your web browser to http://ip.address/test.php and you’ll be able to see your php config and default settings. If you don’t, check with your dedicated server administrators or web hosting provider.
From there, you can also edit necessary values or setup virtual domains, enable CAPTCHA, and more.
June 26, 2008
LAMP web hosting is probably the most popular and affordable server setting for webmasters these days. If you aren’t already aware, LAMP stands for Linux, Apache, MySQL, and PHP and defines how your dedicated server will run – it will be Linux hosting with an Apache server, MySQL databases, and PHP development.
The first step to create a LAMP server setup is to install Apache on your Linux machine.
1) Download Apache from Apache Software Foundation.
2) Uncompress the archive using gunzip and tar and replace apache_1.3.11.tar.gz in the example here with the name of the current live version you just downloaded:
gunzip < apache_1.3.11.tar.gz | tar xvf –
This should create an apache_1.3.11 directory.
3) Move into the new directory you just created and use cd apache_1.3.11.
4) ./configure in the root so that your screen appears as such:
# ./configure
Configuring for Apache, Version 1.3.11
…
Creating Makefile
Creating Configuration.apaci in src
Creating Makefile in src
+ configured for Linux platform
+ setting C compiler to gcc
+ setting C pre-processor to gcc -E
+ checking for system header files
+ adding selected modules
+ checking sizeof various data types
+ doing sanity check on compiler and options
…
Creating Makefile in src/modules/standard
5) make so that your screen looks like this:
# make
===> src
make[1]: Entering directory `src/httpd/apache_1.3.11′
make[2]: Entering directory `src/httpd/apache_1.3.11/src’
===> src/regex
…
[several lines later]
…
gcc -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite
-DNO_DL_NEEDED `../apaci` -o ab -L../os/unix
-L../ap ab.o -lap -los -lm -lcrypt
make[2]: Leaving directory `src/httpd/apache_1.3.11/src/support’
<=== src/support
make[1]: Leaving directory `src/httpd/apache_1.3.11′
<=== src
#
6) Install your new Apache with # make install and you’re done!
Now you are welcome to start Apache to make sure it’s working if you’d like.
As root, type /usr/local/apache/bin/apachect1 start and your browser at your brand new web server at yourdomain.com. If you see the Apache standard “It worked!” homepage, you are set.
April 18, 2008
Blog Web Hosting is possibly the fastest growing type of web hosting these days. Because blogging helps with SEO (search engine optimization), builds resources and content, and draws customers and audiences to explore and offer their opinions, link back, and more, corporations are using blogs for their websites as content management systems, even as individuals continue to grow the blogging community with daily unique content about their hobbies and personal lives.
This puts b2evolution web hosting in the forefront of the industry, as b2evolution provides quality open source (free!) blogging software for your website!
b2evolution is actually an advanced blogging tool that is great for beginners and experienced webmasters alike. Similar to WordPress, b2evolution includes all kinds of traditional blogging tool, like posting categories, tags, comments, skins, and content management, but also combines that simplicity with a sophisticated yet easy-to-use interface with features like file and photo management, multiple blogs, and detailed user permissions and groups.
On your dedicated server, you just need to find a reliable dedicated web host and use a LAMP-based configuration (i.e. Linux, Apache, MySQL, PHP/PERL/Python).
April 14, 2008
When searching for a reliable dedicated hosting provider, you know already that you can often find great dedicated hosting coupons and discounts if you compare companies and give them a call or get a custom quote like what Lunarpages offers on their website. But we have some amazing web hosting news for you, as the folks at Lunarpages are offering some phenomenal dedicated hosting freebies!
If you are in the market for Dedicated Windows Hosting, look no further than Lunarpages! With any new 12 or 24 month Windows Dedicated purchase, you will receive a FREE copy of Microsoft Web Expression, a WYSIWYG HTML and webpage editor, as well as a year’s worth of Microsoft-related training from Total Trainning! The training sessions alone are valued at over $700, making this free offer from Lunarpages worth over $1,000!
For more information, please visit Lunarpages Dedicated Hosting and view their Special Offer.
Wondering what you get with Lunarpages Windows Dedicated Hosting? Check out these awesome features:
* Windows Server 2008
* Microsoft Frontpage, Silverlight, and ASP/ASP.NET 3.5, IIS7 compatible
* MS SQL standard
* Plesk Control Panel
* Managed Hosting options
* 80-250GB (and more) storage space
* at least 1,000GB (1TB) bandwidth/month
* 24×7 Dedicated Technical Support
April 10, 2008
Like Ruby on Rails and Web 2.0, LAMP has become one of the most popular and trendy keywords for software and application development these days. But, do you know what LAMP stands for or what it means as you choose a dedicated web host? LAMP is actually incredibly important to application servers, web servers, and software distribution, so if you are planning to purchase a dedicated server for exactly these purposes, you should definitely research this solution stack.
So what is LAMP?
LAMP stands for the solution stack of free, open source software that produces dynamic websites and allows for web server, application server, and easy software distribution. LAMP is actually an acronym for the open source software that it comprises:
L – Linux: the operating system on which LAMP can be hosted
A – Apache: the actual web server
M – MySQL: the database system used for database management
P – PHP, Perl, and Python: the programming languages that can develop the software
Each of these four technologies can be utilized separately, but together, they provide dedicated web developers the chance to dazzle. More importantly, they are more than likely bundled together anyway, as Linux, PHP, and MySQL are almost 100% of the time found beside each other, and the Apache web server is one of the most popular choices.
There is an extremely low cost associated with LAMP web hosting, as all of the LAMP solutions are completely free. The only real cost is the hosting account itself or dedicated server hosting you purchase.
There are many different dedicated server and web hosting technologies available to use when building and accessing your website. Probably the most popular free tool for database web hosting is MySQL.
So what is MySQL Web Hosting?
MySQL (pronounced My-Ess-Queue-El or My-See-Quel) is an open source or free database software, providing ease and speed to its resource base. MySQL boasts over 100 million downloads of this extremely familiar database software, and for good reason – most web hosting companies these days utilize MySQL for their databases and offer it free to their customers for database management as well.
The popularity of MySQL web hosting really came into light as a new application pack for technology was devised called LAMP (Linux, Apache, MySQL, PHP/Perl/Python). This, coupled with the fact that MySQL can be used on Linux as well as Windows and over 20 other platforms, makes MySQL hosting a huge choice for developers and webmasters in the dedicated web hosting and shared hosting fields.
April 7, 2008
Backing up your website is extremely important to the server security of your dedicated server, but you can’t forget about your server databases either! Your MySQL databases are the backbone of your website, especially if you are using it for database server hosting. In either situation, you cannot rely on manual backups of your dedicated server databases if you access them every day and if they are integral to your website’s success and uptime.
So below, we have included some helpful scripts that can be setup via cron jobs (scheduled tasks) on your server. These will automatically backup your databases for you, so you’ll never have to worry again! There are two options for these backups – you can either have them emailed to you or FTPed to you, both of which will assist with your dedicated web hosting experience.
MySQL backup via cron – Emailed to You
<?
$datestamp = date(“Y-m-d”); // Current date to append to filename of backup file in format of YYYY-MM-DD
/* CONFIGURE THE FOLLOWING SEVEN VARIABLES TO MATCH YOUR SETUP */
$dbuser = “”; // Database username
$dbpwd = “”; // Database password
$dbname = “”; // Database name. Use –all-databases if you have more than one
$filename= “backup-$datestamp.sql.gz”; // The name (and optionally path) of the dump file
$to = “you@remotesite.com”; // Email address to send dump file to
$from = “you@yourhost.com”; // Email address message will show as coming from.
$subject = “MySQL backup file”; // Subject of email
$command = “mysqldump -u $dbuser –password=$dbpwd $dbname | gzip > $filename”;
$result = passthru($command);
$attachmentname = array_pop(explode(“/”, $filename)); // If a path was included, strip it out for the attachment name
$message = “Compressed database backup file $attachmentname attached.”;
$mime_boundary = “<<<:” . md5(time());
$data = chunk_split(base64_encode(implode(“”, file($filename))));
$headers = “From: $from\r\n”;
$headers .= “MIME-Version: 1.0\r\n”;
$headers .= “Content-type: multipart/mixed;\r\n”;
$headers .= ” boundary=\”".$mime_boundary.”\”\r\n”;
$content = “This is a multi-part message in MIME format.\r\n\r\n”;
$content.= “–”.$mime_boundary.”\r\n”;
$content.= “Content-Type: text/plain; charset=\”iso-8859-1\”\r\n”;
$content.= “Content-Transfer-Encoding: 7bit\r\n\r\n”;
$content.= $message.”\r\n”;
$content.= “–”.$mime_boundary.”\r\n”;
$content.= “Content-Disposition: attachment;\r\n”;
$content.= “Content-Type: Application/Octet-Stream; name=\”$attachmentname\”\r\n”;
$content.= “Content-Transfer-Encoding: base64\r\n\r\n”;
$content.= $data.”\r\n”;
$content.= “–” . $mime_boundary . “\r\n”;
mail($to, $subject, $content, $headers);
unlink($filename); //delete the backup file from the server
?>
MySQL backup via cron – FTPed to You
<?
$datestamp = date(“Y-m-d”); // Current date to append to filename of backup file in format of YYYY-MM-DD
/* CONFIGURE THE FOLLOWING THREE VARIABLES TO MATCH YOUR SETUP */
$dbuser = “”; // Database username
$dbpwd = “”; // Database password
$dbname = “”; // Database name. Use –all-databases if you have more than one
$filename= “backup-$datestamp.sql.gz”; // The name (and optionally path) of the dump file
$command = “mysqldump -u $dbuser –password=$dbpwd $dbname | gzip > $filename”;
$result = passthru($command);
/* CONFIGURE THE FOLLOWING FOUR VARIABLES TO MATCH YOUR FTP SETUP */
$ftp_server = “”; // Shouldn’t have any trailing slashes and shouldn’t be prefixed with ftp://
$ftp_port = “21″; // FTP port – blank defaults to port 21
$ftp_username = “anonymous”; // FTP account username
$ftp_password = “”; // FTP account password – blank for anonymous
// set up basic connection
$ftp_conn = ftp_connect($ftp_server);
// Turn PASV mode on or off
ftp_pasv($ftp_conn, false);
// login with username and password
$login_result = ftp_login($ftp_conn, $ftp_username, $ftp_password);
// check connection
if ((!$ftp_conn) || (!$login_result))
{
echo “FTP connection has failed.”;
echo “Attempted to connect to $ftp_server for user $ftp_username”;
exit;
}
else
{
echo “Connected to $ftp_server, for user $ftp_username”;
}
// upload the file
$upload = ftp_put($ftp_conn, $filename, $filename, FTP_BINARY);
// check upload status
if (!$upload)
{
echo “FTP upload has failed.”;
}
else
{
echo “Uploaded $filename to $ftp_server.”;
}
// close the FTP stream
ftp_close($ftp_conn);
unlink($filename); //delete the backup file from the server
?>
**MAKE ABSOLUTELY SURE that either script you use from above includes a .php extension. That file should have 755 permissions, and you MUST change the first variables to those specific to your website’s setup. Also, you MUST have a cron job setup in Cpanel and the path to the script needs to look like this: php /home/username/path-to-the-php-script. Just make sure you replace path-to-the-script with your script’s physical path.
February 14, 2008
In updating your code from PHP4 to PHP5, you should first know the differences between PHP4 and PHP5. One of the major differences you’ll note are the new functions available in PHP5. Here is a quick list of some of the most important ones, organized by category.
Arrays:
* array_combine() - Creates an array by using one array for keys and another for its values
* array_diff_uassoc() – Computes the difference of arrays with additional index check which is performed by a user supplied callback function
* array_udiff() – Computes the difference of arrays by using a callback function for data comparison
* array_uintersect_assoc() – Computes the intersection of arrays with additional index check. The data is compared by using a callback function
* array_uintersect_uassoc() – Computes the intersection of arrays with additional index check. Both the data and the indexes are compared by using separate callback functions
InterBase:
* ibase_affected_rows() – Return the number of rows that were affected by the previous query
* ibase_backup() – Initiates a backup task in the service manager and returns immediately
* ibase_db_info() – Request statistics about a database
* ibase_drop_db() – Drops a database
* ibase_maintain_db() – Execute a maintenance command on the database server
* ibase_server_info() – Request statistics about a database server
Date and time related:
* idate() – Format a local time/date as integer
* date_sunset() – Time of sunset for a given day and location
* date_sunrise() – Time of sunrise for a given day and location
* time_nanosleep() – Delay for a number of seconds and nanoseconds
Other:
* curl_copy_handle() – Copy a cURL handle along with all of its preferences
* dba_key_split() – Splits a key in string representation into array representation
* dbase_get_header_info() - Get the header info of a dBase database
* fbsql_set_password() – Change the password for a given user
* ftp_alloc() – Allocates space for a file to be uploaded
* pg_version() – Returns an array with client, protocol and server version (when available)
You can find a full list of the PHP5 functions via the official PHP website, or ask your dedicated hosting provider which version they support for the best results.
Knowing what you already know about the PHP framework, you know that PHP is a simple scripting language that can be used to create amazing forms, features, and functions on your website. But did you know that PHP is updated as it grows and matures, and as this occurs, your older code may need to be tweaked or may not work at all?
Major changes from PHP4 to PHP5:
* Features such as objects, class constants, visibility, unified destructors and constructors, abstracts, interfaces, magic methods, and other things altered in the Object Model
* PHP5 contains the ability to create classes which you can access akin to arrays through an ArrayAccess interface
* Introduced in PHP5 was limited type hinting, which allows you to dictate which kind of variables pass to functions or class methods
* Exceptions (or errors) were introduced
* A variety of new PHP5 Functions
Two Compatibility Issues:
* Scripts that utilize get_class(), get_parent_class(), or get_class_methods() now return the name of the class or method exactly as they were declared or displayed, meaning they are now case sensitive, a real headache for anyone who already has the code written and now needs to go back and be sure everything is properly defined
* array_merge() in PHP4 let you slide with merging non-arrays, but PHP5 now offers warnings if any of the included parameters are not arrays
There are many more differences between PHP4 and PHP5, but the most important thing is read through the framework and documentation and cross all your Ts – and make sure to pick a dedicated server host who can assist with moving between PHP4 and PHP5.