Category Archives: SugarCRM

SME Server open_basedir for Pear extensions

Following on from my run in with the open_basedir process for the /tmp folder during a setup of SugarCRM on SME Server.

I today discovered that SugarCRM wants to use some PEAR extensions and that we again failed on the open_basedir option.

So following that earlier process I now have added

/usr/share/pear:/usr/share/pear-addons

to the open_basedir string in the http conf for the ibays.

SME Server httpd.conf open_basedir path to include /tmp

Working with SugarCRM at the moment with a dev install on my SME Server 8.0b5 in an ibay.

Trying to upload some updates using the SugarCRM admin tool Upgrade Wizard but I kept getting an error stating that ‘Missing a Temporary Folder’. Which is kind of cryptic and Sugar could do well to include the missing folder name that it thinks it needs as that would shorten the research process.

Anywho, the issue can be tracked in the appropriate meesages file, /var/log/messages in the case of SME Server.

The log indicates that Sugar is wanting access to the /tmp directory for the upload and that this directory is outside the open_basedir restrictions that SME Server configures for iBays.

The quick steps for this are:

server#mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
server#cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/
server#cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays .
server#mcedit 95AddType00PHP2ibays

I use mcedit for editing, but you might be a vi guru, just substitute mcedit for your favourite editor.
Once you are editing the file look for the output line near the end, it should look like this

my $basedir = $ibay->prop(‘PHPBaseDir’)
|| (“/home/e-smith/files/ibays/” . $ibay->key . “/”);
$OUT .= ” php_admin_value open_basedir $basedirn”;
$OUT .= “n”;

and you need to modify the first .OUT line to include the /tmp directory

my $basedir = $ibay->prop(‘PHPBaseDir’)
|| (“/home/e-smith/files/ibays/” . $ibay->key . “/”);
$OUT .= ” php_admin_value open_basedir $basedir:/tmpn”;
$OUT .= “n”;

Save that file and rebuild the template, restart apache and the uploads should now be ok. Note that this modification does apply this to ALL iBays. Which suits me.

server#/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
server#apachectl restart

and that is done.

SugarCRM web.config IIS7 and Error 500: Internal Server Error

I’d started to deploy a test version of SugarCRM 5.5 CE and an updated PHP 5.2.12 to a Windows 2008 server with IIS7 when I got an internal server error 500.

What I found, eventually, was that while the installation of Sugar completed, the installation creates a web.config file that includes an instruction to ‘Add default document type’ of index.php to the site.

The problem was that my server level settings already included index.php as a default document. The only reason I found it was when checking all the settings for the site in the IIS7 Manager it gives an error in the manager about the double up not being possible.

Would have been more polite if IIS could simply accept that the index.php already is a default document and ignore it politely instead of doing a dummy spit type error and not running.

In this case I just deleted the instruction to Add in the web.config.

Another option is to include a instruction in the web.config to clear any existing default pages prior to adding the one(s) required for the current application. Like this:

Logged as a Bug at Sugar BugTracker

SugarCRM 5.5 Install Error Session Save Path

Using a PHP setup on a Windows 2008 server as per the FastCGI instruction set I found that installing Sugar 5.5 stopped at the SystemCheck page (install/installSystemCheck.php) with a message that the message

The session.save_path setting in your php configuration file (php.ini) is not set or is set to a folder which did not exist. You might need to set the save_path setting in php.ini or verify that the folder sets in save_path exist.

The general comments on searching for ideas were that the is_dir function fails regardless of the existence or otherwise of the directory.

I delved a bit deeper and confirmed that the is_dir function is restricted by the openbase_dir setting and if the session.save_path is outside the openbase_dir setting then it is not found.

I also noted that the php chdir function is limited to the openbase_dir setting.

Using multiple values in the openbase_dir setting does not work either as apparently is_dir ignores the secondary setting.

In any case the only way around this is appears to be to have the session.save_path within the openbase_dir path.