mediatemple, pear, sessions.

Tech Notes

In order to use some pear libraries and also use sessions properly in php you might need to create a vhosts.conf file for your mediatemple install. To get it all working in a subdomain I had to create a vhost.conf file in the subdomains/[subname]/conf/vhosts.conf file too. Here is the contents of mine. You'll need to be root to create these files.

# less conf/vhost.conf
<Directory /var/www/vhosts/example.com/subdomains/staging/httpdocs>
php_admin_value open_basedir none
php_admin_value session.save_path /var/www/vhosts/example.com/subdomains/staging/tmp
</Directory>

In the parent domain I also specify a path to pear

# less ../../conf/vhost.conf
<Directory /var/www/vhosts/example.com/httpdocs>
php_admin_value open_basedir none
php_admin_value session.save_path /var/www/vhosts/example.com/tmp
</Directory>

<Directory /var/www/vhosts/example.com/subdomains/staging/httpdocs>
php_admin_value open_basedir none
php_admin_value session.save_path /var/www/vhosts/example.com/subdomains/staging/tmp
php_admin_value include_path ".:/usr/share/pear"
</Directory>

And then reconfigure both domains and restart apache.

# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=example.com
# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=staging.example.com
# /etc/init.d/httpd stop; /etc/init.d/httpd start

http://kb.mediatemple.net/questions/514/Enabling+PEAR+by+setting+your+op...