We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37449
    • 57 Posts
    Having got the gallery to work locally, I have uploaded to my site (www.darrenjehan.me.uk) but none of the images show.
    Manager can’t see the galleries either.

    I have scoured the forums and as far as I can see I have the required components installed. phpinfo() tells me that GD is enabled, which is what I think is required. Gallery is installed of course, and I have copied over all the album directories and images, colorbox and its JS and CSS files.

    I have checked the namespace for gallery and it’s OK, and I have amended the file paths in system settings for gallery to (for example)
    gallery.files_path = /home/darrenje/public_html/assets/components/gallery/files/
    


    I have set the gallery.files_url to
    /assets/components/gallery/files/
    


    If I enter http://darrenjehan.me.uk/assets/components/gallery/files/ then I get a list of the album directories.

    Finally, when I look at page source (for the Galley home) I can see the following in the href tag:
    "album-view.php?galAlbum=1"><img src="/assets/components/gallery/connector.php?action=web/phpthumb&w=130&h=92&zc=1&far=C&q=90&src=http%3A%2F%2Fwww.darrenjehan.me.uk%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F1%2F1.jpg"
    


    When I follow that link I get
    [2011-07-26 14:10:57] (ERROR @ /home/darrenje/public_html/core/model/phpthumb/phpthumb.functions.php : 474) PHP warning: shell_exec() has been disabled for security reasons
    


    What does this error mean I need to do??

    Thanks in advance
    Daz
      formerly sumodaz on here!
      • 37449
      • 57 Posts
      A friend more conversant with PHP than me (and also uses the same hosting as me) tells me php_exec is defintely disabled on the host and there should be another way to use GD or ImageMagick.....

      Can someone tell me how?

      Thanks in advance
      Daz
        formerly sumodaz on here!
        • 37449
        • 57 Posts
        Well, I have it working - but would really appreciate some feedback here!

        I found the shell_exec statement in core/model/phpthumb/phpthumb.functions.php in the SafeExec function, as follows:
        function SafeExec($command) {
        		static $AllowedExecFunctions = array();
        		if (empty($AllowedExecFunctions)) {
        			$AllowedExecFunctions = array('shell_exec'=>false, '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;
        	}
        


        As you can see I changed the 4th line to read false for shell_exec and then commented out the whole shell_exec case option.

        The images all now load and everything works expected.


        QUESTION: Was this the right thing to do??

        Thanks in advance
        Daz

          formerly sumodaz on here!
          • 37302
          • 4 Posts
          imandickgBanned Reply #4, 12 years ago
          Disabling shell_exec fixed problems I had with all the thumbnails in manager (Gallery, loading images from Resource Manager).

          Before change my error log was full of lines similar to:

          =====================================
          [Tue Apr 10 15:08:06 2012] [error] [client 89.216.29.56] PHP Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts//********.com/httpdocs/revo/core/model/phpthumb/phpthumb.functions.php on line 474, referer: http:///********.com/revo/manager/index.php?a=3&ctx=web&wctx=web&source=1&v=221pl

          [Tue Apr 10 15:15:46 2012] [error] [client 89.216.29.56] PHP Warning: shell_exec() has been disabled for security reasons in /var/www/vhosts/********.com/httpdocs/revo/core/model/phpthumb/phpthumb.functions.php on line 474, referer: http://*********.com/revo/manager/?a=78&album=1&action=album/update
          =====================================

          I'm using Revo 2.2.1 and I'm hosting website on my own server (managed by myself), and disabling suhosin is not an option (I have many "hacker" attacks on daily basis).

          Is this something marked to be fixed in future releases or I have to continue using EVO for my projects (I have lot's of tasks without changing core files, so, this extra job is not what I need right now).

          Just to mention, rapid web development is not possible with REVO slow manager, sometimes I have to wait 2-3 seconds for page to load and when I have to change 100 or more pages, this can be frustrating (tried FF, Chrome, Opera on 16Mbit/s connection).

          Thanx Daz...
            • 36549
            • 572 Posts
            Hi,

            My images are not displaying either in Gallery, they are fine everywhere else on the site.
            I can also view images using the Cliche gallery.


            When I follow the link of the image (http://home/mysite/assets/components/gallery/connector.php?action=web/phpthumb&w=100&h=100&zc=1&far=C&q=90&src=%2F~ugandate%2Fassets%2Fgallery%2F1%2F1.jpg) on the front end of the site i get the following error messages (could be a path issue?):

            Warning: file_get_contents(/home/mysite/public_html/~mysite/assets/gallery/1/1.jpg) [function.file-get-contents]: failed to open stream: No such file or directory in /home/mysite/public_html/core/model/phpthumb/phpthumb.class.php on line 3210
            
            Warning: file_get_contents(/home/mysite/public_html/assets/components/gallery/cache/_home_mysite_public_html_~mysite_assets_gallery_1_1.jpg.a8be3e9723938b6ece18ce39ada0be58.jpg) [function.file-get-contents]: failed to open stream: No such file or directory in /home/mysite/public_html/core/components/gallery/processors/web/phpthumb.php on line 150


            I'm using MODx 2_2_1
            Gallery 1.5.0

            Any ideas?
            [ed. note: 9thwave last edited this post 12 years ago.]
              www.9thwave.co.uk
                 WEB | DESIGN | PRINT
              • 36549
              • 572 Posts
              just to say i got this working by setting the 'Prepend Site URL to Thumbs' to 'yes' in:
              ...Manager/System/System Settings/Gallery(core dropdown)

              Hope that helps.
                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 50923
                • 137 Posts
                Quote from: 9thwave at Apr 28, 2012, 01:10 PM
                just to say i got this working by setting the 'Prepend Site URL to Thumbs' to 'yes' in:
                ...Manager/System/System Settings/Gallery(core dropdown)

                Hope that helps.

                How to do this in database?
                  <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
                  • 36549
                  • 572 Posts
                  Quote from: miomir.dancevic at Dec 14, 2015, 10:56 PM

                  How to do this in database?
                  I did it in the Manager and in System Settings. Choose Gallery from the 'Core' dropdown and you should see the option to 'Prepend Site URL'

                    www.9thwave.co.uk
                       WEB | DESIGN | PRINT