Clone
1
Media Temple Installaton Tips
MohamedAlaa edited this page 2013-02-14 10:00:25 -08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

A few tweaks need to be made to CodeIgniter to make it compatible with the MediaTemple hosting environment. Here is a copy of the .htaccess file weve developed:

AddHandler php5-script .php

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^([0-9a-zA-Z]+.js)
RewriteRule ^(.*)$ /index.php?/$1 [L]`

The first thing well want to do is enable PHP5. Unless you have a reason to continue using PHP4 for your application, use the newer version. Specifically, the version of PHP5 used by MediaTemple is 5.2.2, not 5.3, so you wont need to upgrade CodeIgniter to 1.7.2 to work (CI 1.7.2 introduces PHP 5.3 compatibility).

The second set of rules prevents users from being able to access any files in the system directory. We finally made the leap and pulled my system directory out of the web root and to share it with other websites, so this line isnt needed, however most people will need it.

The next set of rules sends all incoming URL requests to CodeIgniter, unless the files already exist. This is good if your site is as complex as ours and has a WordPress and a WikiMedia script installed. For some reason, if there are JavaScript files in the root of the web folder, MediaTemple still directs the URL to CodeIgniter, despite the !-f !-d ignore rules that other shared hosts seem to accept, so weve had to add the regular expression to ignore JavaScript files.

Inside of your application/config.php file, youll want to set your uri_protocol setting to AUTO.

$config['uri_protocol'] = "AUTO";

Finally, if you would like to take the system folder out of your web folder, to share it among other installations, youll want to take two steps. First, pull the applications folder out of system and put it in the base of your CI installation folder (along side index.php). Then, move /system up two directories so that it is sitting inside of your domains folder (you cant go a step higher, which is unfortunate as it seems a little out of place here) and rename it /codeigniter to prevent ambiguity. Youll then want to update your index.php file so that it uses the following values:

$system_folder = "../../codeigniter";

And now you should be up and running with a CodeIgniter application functioning properly on your MediaTemple host.