This article applies to enabling FastCGI support for PHP scripts on MediaTemple hosting.

Following sequence of commands/actions as mentioned below. Order is important!

1. Check how your PHP scripts are served?

Create a file with name “info.php” on your domains webroot directory – example path:** “/var/www/vhosts/”**

Add following codes in it.** **

<?php phpinfo(); ?>

After saving file like above access URL from browser:

In output, look for option Server API **and its value. It must be **”CGI/FastCGI”.

2. Login via Plesk panel and enable CGI as well as FASTCGI support for the domain in question, say for

For domain in question, make sure following options are configures:

  • PHP – Enabled
  • PHP ‘safe_mode’ – Disabled
  • CGI – Enabled
  • FastCGI – Disabled

See following screenshot for reference:

3. Login as root over SSH and execute following commands

1. Move to webroot directory for

cd /var/www/vhosts/

2. Copy php-cgi file to bin sub-directory under ** **

cp /usr/bin/php-cgi bin/

3. Change owner for bin directory and its content (that includes php-cgi file)

chown -R username:psacln bin

(replace username with your FTP login name for this domain)

4. Create a vhost.conf file in conf sub-directory under ** **

vi conf/vhost.conf

5. Paste following content in that file. DO NOT forget to replace with your actual domain name.* *

AddHandler fcgid-script .php .php5
<Directory /var/www/vhosts/>
   FCGIWrapper /var/www/vhosts/ .php
 allow from all

6. Run following command so that Plesk will update its configuration including apache server restart

/usr/local/psa/admin/sbin/websrvmng -a -v

7. Jump to the first step and verify PHP Server API. It should now look like as highlighted in following screenshot.

8.DO NOT forget to change owner of files that were created using PHP running as Apache module

chown -R username:psacln *

(replace username with your FTP login name for this domain)