Install additional PEAR modules on Mediatemple dv 3.5
Friday, March 20th, 2009 in PHP
I have a MediaTemple dv 3.5 hosting account that I like a lot (MT support was great whenever I had an issue). Today I needed to install PEAR on one of my domains. To do that, I followed the tutorial from their KnowledgeBase ( please read it if you want to do the same thing; it’s available here ) and all went well for the domain I used ( I had to make a few tries to get it going – I’m a noob in this ).
My goal was to make this work on the main domain, although I needed this on a subdomain. Pear was installed successfully, but I needed Spreadsheets and OLE in order to make things work as planned. Unfortunately, they were not available.
To add them, I created in the httpdocs folder ( using a FTP client ) a folder called PEAR_modules and uploaded Spreadsheets and OLE source files. After that, I connected to my server ( SSH using putty ) and edited vhost.conf for that domain ( in the same way as the MediaTample tutorial explained ) by adding the include path to my PEAR_modules folder.
1 2 3 4 | <Directory "/var/www/vhosts/domain.com/httpdocs"> php_admin_value open_basedir none php_admin_value include_path ".:/usr/share/pear:/var/www/vhosts/domain.com/httpdocs/PEAR_modules" </Directory> |
And it worked. I don’t know if there’s a better way of doing this, I searched like crazy and found nothing on it. I asked the guys at MediaTemple about how to install PEAR modules on dv accounts and they kindly answered that support for additional PEAR modules is not covered by the scope of their support and I should refer to the MT forum. I did that and found nothing useful. Anyway, it worked. Now I needed to add PEAR to the actual subdomain I needed it for. Now, THAT took me a few hours ( don’t laugh and remember that I’m a noob in this ).
So, after a few hours of google searches, curses and cofee. I’ve managed to succeed. The process is very similar to the one for setting PEAR for the domain. The deal is that for every subdomain you have separate vhost.conf files. Lucky me, I had only one. What you need to do ( SSH again ) is go to that subdomain’s /conf folder and create the vhost.conf file ( replace domain.com/my-subdomain with your domain and subdomain names ).
1 2 | cd /var/www/vhosts/domain.com/subdomains/my-subdomain/conf/ vi vhost.conf |
In vhost.conf, add this ( remember to replace domain.com with your actual domain and subdomain with the name of your subdomain )
1 2 3 4 | <Directory "/var/www/vhosts/domain.com/subdomains/my-subdomain/httpdocs"> php_admin_value open_basedir none php_admin_value include_path ".:/usr/share/pear:/var/www/vhosts/domain.com/subdomains/my-subdomain/httpdocs/PEAR_modules" </Directory> |
Look out for typos! I wasted some time with that too. Save the file ( ESC and then type :x! ). Again, using the FTP client I created on my subdomain the PEAR_modules folder ( in httpdocs ) and uploaded the PEAR modules I needed. After that, from SSH, I reconfigured the webserver like the tutorial on MT showed:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com
… and restarted apache. All went well, Spreadsheets was functioning.
I really hope this will help other noobs like me since there’s no “idiot proof” help anywhere ( and man, how I needed it! ) to explain this step by step. If someone with more experience can give some guidelines or knows good resources and is willing to share them it would be great.
Just a quick note: while searching google to solve this problem, I found this: CakePHP on Media Temple (dv) 3.5. It’s about using a single copy of Cake and point all domains to it.






6 comments
mate you are a champion!!! thanks heaps for this, great stuff. cheers
I tried to follow ur instruction but does not work for mine.
should i be able to include PEAR.php if i follow urs setting?
First thing that you need to do is enable PEAR. This is covered in MT’s KnowledgeBase here.
After you do this, to add additional PEAR modules, follow what I did and it should work. As I said, I’m not a guru in this, I just searched info and tried on my own. If what I did doesn’t work for you, I’m afraid I can’t be of any help. As I said before, look out for typos, it took me quite a while to discover them and make this work. Good luck.
[...] 3.5 web server, and it wasn’t currently installed. I did a bit of searching around and found a solution, but it seemed overly complicated — there’s supposed to be an easy one-line command to install PEAR modules, after all. I [...]
Great work. this is a wicked article that really helps.
/usr/local/psa/admin/sbin/httpdmng –reconfigure-domain domain.com works on the new mediatemple v4.0s
You should also see the trackback above your comment. It’s a much better solution (haven’t tested it but looks like that).
Leave a comment