SugarCRM error on module loader on shared hosting

7.4k Views Asked by At

I’ve a shared hosting account and installed SugarCRM. Everything is fine except the message i get for the module loader. Here i get the message to add suhosin.executor.include.whitelist = “upload://” to the php.ini file.

The message is:

Upload stream is blocked by Suhosin, please add "upload" to suhosin.executor.include.whitelist (See sugarcrm.log for more information)

Because i have a shared hosting account i don’t have access to my etc map and therefore also not to my php.ini file.

I want to use the .htaccess file for this but don't know exact code. Can anyone help me?

2

There are 2 best solutions below

0
On

The solution posted by Carlos Quijano didn't work for me. I've found that the solution is different depending if PHP is run as module, CGI or FASTCGI .

This is the documentation I've found about the different methods you can use to use a custom php.ini file for your domain (or even subdomains)

First you should check which one is your case.

For this, you can use the phpinfo command:

Create a php file called phpinfo.php with this content: <?php phpinfo(); ?> and upload it into your domain root, then visit www.yourdomain.com/phpinfo.php, you'll see a table and next to "Server API" you'll see which way PHP is run.

For me it was "CGI/FastCGI", so I had to get a copy of the global php.ini, which I didn't know how to get since it was not accessible by FTP access. I've found a solution in a Drupal forum:

Create a php file you can call gettheini.php with this content:

<?php system("cp /usr/local/php5/lib/php.ini /home/YOURCPANELUSERNAME/php.ini"); ?>

*The first path must be the path next to "Configuration File (php.ini) Path" in the table obtained before (phpinfo.php), with php.ini at the end. The second path is the path where you want to copy it to.

Upload it into your domain root, then visit www.yourdomain.com/gettheini.php. This command will copy the global php.ini file yo the path you specified. Then you can edit that file adding

; configuration for php suhosin module
extension=suhosin.so
suhosin.executor.include.whitelist="phar"
suhosin.executor.include.whitelist="upload"

save it and upload it.

As my hosting service had made some arrangements php.ini overriding, when I checked again the phpinfo page, the new file was already working (check next to "Loaded Configuration File").

Don't forget to protect the new file, add

<Files php.ini>
order allow,deny
deny from all
</Files>

to the end of yout .htaccess file (in the same root folder of your domain or subdomain)

I hope my experience can help you to solve your problem or at least give you some guidance.

0
On

You Can Try Add this to your .htaccess file as suggested in http://forums.sugarcrm.com/f6/upload-stream-blocked-suhosin-82116/

<IfModule mod_php.c>  
    php_value suhosin.executor.include.whitelist upload://
</IfModule>

In my case I'm using php-fpm so I modified the php.ini locater in /etc/php5/fpm/conf.d/suhosin.ini and I have no more warnings from SugarCRM

; configuration for php suhosin module
extension=suhosin.so
suhosin.executor.include.whitelist="phar"
suhosin.executor.include.whitelist="upload"