Setup PHP5 on Media Temple DV 3

  1. These changes must be made on a per domain basis. Log into Plesk and enter the setup area for the domain that you would like to enable php5. Under ‘Services’ make sure that:
    • PHP support is checked, safe_mode ‘on’ is unchecked
    • CGI support is checked
    • FastCGI support is checked
  2. SSH into your server as ‘root’ and execute these commands one at a time:
        cp /opt/php51/cgi-bin/php5 /var/www/vhosts/<domain>/bin/
        cd /var/www/vhosts/<domain>/
        chown -R <domain-user>:psacln bin/
        cd conf
        vim vhost.conf

    Remember to replace <domain> with your actual domain name and <domain-user> with the ftp username for that domain. These commands: make a copy of the CGI version of php5 and place it in the ‘bin’ directory of the domain, change the owner of the ‘bin’ directory and the copy of php5 to the same as the domain user and create a vhost.conf file in the conf directory.

  3. Add these lines to the vhost.conf file that you are editing with ‘vim’:
    AddHandler fcgid-script .php .php5
    SuexecUserGroup <domain-user> psacln
    <Directory /var/www/vhosts/<domain>/httpdocs>
         FCGIWrapper /var/www/vhosts/<domain>/bin/php5 .php
         FCGIWrapper /var/www/vhosts/<domain>/bin/php5 .php5
         Options ExecCGI +Indexes +FollowSymLinks
         allow from all
    </Directory>

    Again please remember to make the correct substitutions for <domain> and <domain-user>.

  4. Execute this command to reconfigure your server to use the new vhost.conf file:
        /usr/local/psa/admin/sbin/websrvmng -a -v

    This will automatically restart your webserver.

Author: Jeff

Born a cantankerous old man, mellowed ever so slightly by age.

8 thoughts on “Setup PHP5 on Media Temple DV 3”

  1. I’m having an issue with executing the final command to save/restart the server. I keep getting a “E486: Pattern not found: usr” message. Any thoughts?

  2. Hi and thanks for this article.
    I’m having trouble when I get into the vhost.conf.
    How and where do I add the commands that you mention? When I open the .php5 file through the Plesk file manager, I get garbled text.
    Can you please help? Thanks in advance. Cheers!

  3. We followed every step as described above.
    Initially, we got stuck at the First command (cp …), getting an error that said the directory did not exist (/var/www/vhosts//bin/ (substituting the real domain name, of course). So, we proceeded to create it manually, using the “mkdir” command.
    Once the directory was created, and we confirmed so (by using the FTP client FileZilla to “see” it), we proceeded to redo the First command, and were able to move forward up to the Fifth command, which is editing the vhost.conf file.
    Once here, we proceeded to 1. execute the “vim vhost.conf” command, 2. change to “insert mode” using the command “a”, 3. we copy/pasted the lines provided by you in Step3, 4. we changed back to “command mode” using the “esc key”, 5. we quit using the command “:wq” to save and exit the vim editor.
    LAST, we execute the command “/usr/local/psa/admin/sbin/websrvmng -a -v” to reconfigure our server.

    Once the server restarted, my programmer uploaded a small file called “phpinfo.php” with the code “phpinfo();” to make sure we now had PHP5 running, and not our old PHP4.3. We still got the old information. Soon after, our Apache server started going down. This happened repeatedly. We had to turn off that domain, since we host close to 100 customers in the same server. After this, the problem stopped.

  4. Unfortunately, this necessarily does not always work. I followed all the steps correctly multiple times and even had Media Temple on dispatch with a starter tech which elevated me to high level techs and they couldn’t explain or resolve my upgrade issue on their server.

  5. Yeah! It worked flawlessly! During the previous process, I am ashamed to say but we made a typo error in the domain user that rendered the entire process incorrect. We deleted the domain space in our Plesk, proceeded to create a new space (same domain name) from scratch, followed the process step by step, double checking to make sure no mistakes were made, and we have now corroborated the PHP5 was installed correctly and it is working.
    Thank you!!!

Leave a Reply

Your email address will not be published. Required fields are marked *