We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36562
    • 94 Posts
    I have no clue about server setups. But i have had problems with the thumbnails showing in modx. And now my host says that modx need shell_exec, exec, system or passthru but they wont allow it. I kind of need the host - and i need modx.

    How can i solve this problem?
      --------------------------------------
      www.williamastrom.se
    • Those commands shouldn't be needed, we actually disable them on our servers with no adverse effects. You do need to have imagemagick installed, which not all hosts offer. Granted if you are doing thumbnails outside of the traditional phpthumb then you may run into other issues, as custom code could use those functions.
        Patrick | Server Wrangler
        About Me: Website | TweetsMODX Hosting
        • 36562
        • 94 Posts
        That sounds very interesting. I have created another thread earlier:
        http://forums.modx.com/thread/84086/no-thumbnails-in-modx-browser-web---media-sources---document-root---modphpthumb-class-php#dis-post-464170

        As you can see i haev tried a lot already. I will do a clean install today though on that host and see if it works out of the box. Imagequick is installed though, as you can see from the other thread(?). Im not too into server setups so i am a little off the grid in the dicussions of all reqs:)

        /w
          --------------------------------------
          www.williamastrom.se
          • 36562
          • 94 Posts
          Tried with a clean install - no changes to anything - basically out of the box and it doesn't work.
            --------------------------------------
            www.williamastrom.se
          • Quote from: AMDbuilder at Apr 25, 2013, 11:53 PM
            Those commands shouldn't be needed, we actually disable them on our servers with no adverse effects.

            Actually I think they are needed for phpThumb to locate and use ImageMagick, since it runs /usr/local/bin/convert (path may differ) via a shell.

            Take a look at the SafeExec() method in core/model/phpthumb/phpthumbfunctions.php (line 443):

            public static function SafeExec($command) {
            	static $AllowedExecFunctions = array();
            	if (empty($AllowedExecFunctions)) {
            		$AllowedExecFunctions = array('shell_exec'=>true, 'passthru'=>true, 'system'=>true, 'exec'=>true);
            		foreach ($AllowedExecFunctions as $key => $value) {
            			$AllowedExecFunctions[$key] = !phpthumb_functions::FunctionIsDisabled($key);
            		}
            	}
            	$command .= ' 2>&1'; // force redirect stderr to stdout
            	foreach ($AllowedExecFunctions as $execfunction => $is_allowed) {
            		if (!$is_allowed) {
            			continue;
            		}
            		$returnvalue = false;
            		switch ($execfunction) {
            			case 'passthru':
            			case 'system':
            				ob_start();
            				$execfunction($command);
            				$returnvalue = ob_get_contents();
            				ob_end_clean();
            				break;
            
            			case 'exec':
            				$output = array();
            				$lastline = $execfunction($command, $output);
            				$returnvalue = implode("\n", $output);
            				break;
            
            			case 'shell_exec':
            				ob_start();
            				$returnvalue = $execfunction($command);
            				ob_end_clean();
            				break;
            		}
            		return $returnvalue;
            	}
            	return false;
            }
            


            Also look at the ImageMagickWhichConvert(), ImageMagickCommandlineBase() and ImageMagickVersion() methods in core/model/phpthumb/phpthumb.class.php to see how SafeExex() is used.

            I've found that having ImageMagick installed is no guarantee that it's actually getting run; you need to check that specifically. You can either look at the debugmessages property of a phpThumb object right after it's run, or install the stand-alone version of phpThumb and run phpThumb.demo.check.php to analyze your configuration.
              Extras :: pThumbResizerimageSlimsetPlaceholders