Answers.Body: <p>You might try putting putting something like:</p>
  
  <pre><code>&lt;IfModule mod_php5.c&gt;
    php_value max_execution_time "30" 
    php_value memory_limit "256M"
  &lt;/IfModule&gt; 
  </code></pre>
  
  <p>inside your <code>.htaccess.</code> file. </p>
  
  <p>You can tell what your PHP values are right inside Craft... unless you changed your admin trigger, just visit <code>http://server/admin/utils/phpinfo</code> and search for <code>memory_limit</code> and <code>max_execution_time</code>. That'll give you some clues as to what's going on.</p>
  
  <p>Some hosts set these values really low but the <a href="http://php.net/manual/en/info.configuration.php#ini.max-execution-time" rel="nofollow">default execution time</a> is 30 and memory limit is 128M.</p>
  
  <p>If you run PHP as a cgi, some hosts allow you to use <code>ini</code> files in lieu of .htaccess. Typically these are at the root of your home folder but they could be stored elsewhere. Put <code>memory_limit = 256M</code> in one and throw it up in your home folder. Running <code>php_info()</code> would tell you the location of the current in use one.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:02:26.700Z
Answers.Text: thanks. Tried adding to htaccess but no joy. Looking at the limits though in craft they are already set to 
  max_execution_time  50000
  memory_limit 120M
  I have noticed that I now have a notice in the admin panel saying generating pending image transforms which doesn't seem to be moving?
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:12:58.733Z
Answers.Text: How are you running PHP?  Craft doesn't expose that very well but it'll say ``apache2handler`` somewhere if it's running it as ``mod_php`` or ``cgi-fcgi`` if you're running it via cgi.
  
  You may even be running nginx via PHP-FPM. (Right below cgi-fcgi it'll say php-fpm if you are running that way.)
  
  Not all hosts support changing php_value through .htaccess.  You might have to go in via a control panel to do that or contact an admin.
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:14:03.327Z
Answers.Text: I find Settings -> Clear Caches works wonders a lot too.
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:19:13.000Z
Answers.Text: Yeah already tried clearing the cache. Looks like cgi-fcgi nothing else gets picked up on a find. Changing php settings via the control panel is unlikely not seen anything in there and more than likely locked down as you suggested.
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:33:24.327Z
Answers.Text: You got one more option. Make a new file called ``php.ini``. Put ``memory_limit = 256M`` in it and throw it up in your home folder. Some hosts will use that instead of ``.htaccess``. It could be elsewhere as well. Craft doesn't expose that but if you call ``phpinfo()`` it'll show the ``loaded configuration file``. That might be a clue.
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:47:37.630Z
Answers.Text: Ok cheers the php.ini has worked. Checking the phpinfo() shows the new settings. However
  memory_limit = 1024M
  max_execution_time = 120
  And still no dice!
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:48:14.867Z
Answers.Text: Is there a way to clear the pending image transforms?
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T21:51:30.747Z
Answers.Text: See here -> https://craftcms.com/support/stuck-tasks
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T22:03:53.213Z
Answers.Text: Cheers. Now upped to 2048M and 240 but still no joy. I'm thinking it's something in the code. Limits seem way too big now for what the script is doing!
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-09T08:25:12.603Z
Answers.Text: Go LARGE on the memory! Through the above php.ini method, I've managed to allocate  5032000M on a shared server (kept adding zeros), before the stuck image transform process was able to succeed. (won't mention the name of the hosting Company or package) I know this sounds ridiculous but consider that if the processors are also shared then anything which the machine is trying to calculate may timeout because of processing power too. (Exactly none of our other Craft installations need this sort of thing, just the one on the almost-free shared hosting which the client insisted on)
Answers.UserDisplayName: Matt P
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-11T13:50:43.643Z
Answers.Text: Still no joy limits upped to way above suggested 5032000M and it still hangs. My thoughts now turn to the transforms are being performed within a loop on some home page slide images. The loop is over a matrix block could this be causing the issue? There are 4 slides it loops through performing the transform each time it finds the image field.
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-11T16:04:12.380Z
Answers.Text: So you're still getting out of memory errors or is it a different error?
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-08T20:41:19.560Z
Answers.LastActivityDate: 2016-03-08T21:55:34.857Z
Answers.LastEditDate: 2016-03-08T21:55:34.857Z
Answers.UserDisplayName: RitterKnight
Body: <p>I'm having some issues with  when applying image transforms. Hopefully it's something obvious I'm over looking. The code is as follows:</p>
  
  <pre><code>&lt;picture&gt;
      &lt;source media="(min-width: 401px)" srcset="{{ imageUrl.getUrl('homeBanner') }}"&gt;
      &lt;source media="(max-width: 400px)" srcset="{{ imageUrl.getUrl('iphone400x710') }}"&gt;
      &lt;source srcset="{{ imageUrl.getUrl('iphone400x710') }}"&gt;
      &lt;img src="{{ imageUrl.getUrl('iphone400x710') }}" alt="Image Desc"&gt;
  &lt;/picture&gt;
  </code></pre>
  
  <p>Images uploaded are all 2000px x 1330px and the transform should crop from center to the specified size in the handle.</p>
  
  <p>My problem is it works on my local server but once uploaded to my (shared) dev server I am getting php out of memory errors on this script </p>
  
  <p>craft/app/vendor/imagine/imagine/lib/Imagine/Gd/Image.php on line 617</p>
  
  <p>Am I doing something incorrectly that is causing the script to run for too long?</p>
  
  <p>Cheers</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-08T18:57:08.263Z
Comments.Text: Since you are on a shared system, the `php_execution_time` or `memory_limit` might be set lower than what you have locally. See if increasing `php_value max_execution_time` and/or `php_value memory_limit` helps.
Comments.UserDisplayName: Damon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-08T20:28:07.520Z
Comments.Text: @damon thanks but where would I set these? I know you can add 'phpMaxMemoryLimit' => '512M', to the general config file but there doesn't seem to be anything for the other 2 you suggest?
Comments.UserDisplayName: Lettie
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-08T21:15:34.613Z
Comments.Text: Ah shoot, that would have been helpful info - sorry about that. @RitterKnight has the right stuff.
Comments.UserDisplayName: Damon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-08T21:49:05.013Z
Comments.Text: No worries as you say @RitterKnight has been very helpful.
Comments.UserDisplayName: Lettie
Tags: <image-transforms><responsive-images>
Title: Issues with picture and image transforms
ThreadText: # Issues with picture and image transforms
  
  (Asked by: username_0 on 2016-03-08)
  
  I'm having some issues with when applying image transforms. Hopefully it's something obvious I'm over looking. The code is as follows:
  
  ```
  <picture>
      <source media="(min-width: 401px)" srcset="{{ imageUrl.getUrl('homeBanner') }}">
      <source media="(max-width: 400px)" srcset="{{ imageUrl.getUrl('iphone400x710') }}">
      <source srcset="{{ imageUrl.getUrl('iphone400x710') }}">
      <img src="{{ imageUrl.getUrl('iphone400x710') }}" alt="Image Desc">
  </picture>
  
  ```
  
  Images uploaded are all 2000px x 1330px and the transform should crop from center to the specified size in the handle.
  
  My problem is it works on my local server but once uploaded to my (shared) dev server I am getting php out of memory errors on this script
  
  craft/app/vendor/imagine/imagine/lib/Imagine/Gd/Image.php on line 617
  
  Am I doing something incorrectly that is causing the script to run for too long?
  
  Cheers
  
  **Tags:** image-transforms, responsive-images
  
  > **Comments:**
  > **username_1**: Since you are on a shared system, the `php_execution_time` or `memory_limit` might be set lower than what you have locally. See if increasing `php_value max_execution_time` and/or `php_value memory_limit` helps.  
  > **username_0**: @username_1 thanks but where would I set these? I know you can add 'phpMaxMemoryLimit' => '512M', to the general config file but there doesn't seem to be anything for the other 2 you suggest?  
  > **username_1**: Ah shoot, that would have been helpful info - sorry about that. @username_2 has the right stuff.  
  > **username_0**: No worries as you say @username_2 has been very helpful.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-03-08. Score: 1
  
  You might try putting putting something like:
  
  ```
  <IfModule mod_php5.c>
    php_value max_execution_time "30" 
    php_value memory_limit "256M"
  </IfModule> 
  
  ```
  
  inside your `.htaccess.` file.
  
  You can tell what your PHP values are right inside Craft... unless you changed your admin trigger, just visit `http://server/admin/utils/phpinfo` and search for `memory_limit` and `max_execution_time`. That'll give you some clues as to what's going on.
  
  Some hosts set these values really low but the [default execution time](http://php.net/manual/en/info.configuration.php#ini.max-execution-time) is 30 and memory limit is 128M.
  
  If you run PHP as a cgi, some hosts allow you to use `ini` files in lieu of .htaccess. Typically these are at the root of your home folder but they could be stored elsewhere. Put `memory_limit = 256M` in one and throw it up in your home folder. Running `php_info()` would tell you the location of the current in use one.
  
  > **Comments:**
  > **username_0**: thanks. Tried adding to htaccess but no joy. Looking at the limits though in craft they are already set to  max_execution_time  50000 memory_limit 120M I have noticed that I now have a notice in the admin panel saying generating pending image transforms which doesn't seem to be moving?  
  > **username_2**: How are you running PHP?  Craft doesn't expose that very well but it'll say ``apache2handler`` somewhere if it's running it as ``mod_php`` or ``cgi-fcgi`` if you're running it via cgi.  You may even be running nginx via PHP-FPM. (Right below cgi-fcgi it'll say php-fpm if you are running that way.)  Not all hosts support changing php_value through .htaccess.  You might have to go in via a control panel to do that or contact an admin.  
  > **username_2**: I find Settings -> Clear Caches works wonders a lot too.  
  > **username_0**: Yeah already tried clearing the cache. Looks like cgi-fcgi nothing else gets picked up on a find. Changing php settings via the control panel is unlikely not seen anything in there and more than likely locked down as you suggested.  
  > **username_2**: You got one more option. Make a new file called ``php.ini``. Put ``memory_limit = 256M`` in it and throw it up in your home folder. Some hosts will use that instead of ``.htaccess``. It could be elsewhere as well. Craft doesn't expose that but if you call ``phpinfo()`` it'll show the ``loaded configuration file``. That might be a clue.  
  > **username_0**: Ok cheers the php.ini has worked. Checking the phpinfo() shows the new settings. However memory_limit = 1024M max_execution_time = 120 And still no dice!  
  > **username_0**: Is there a way to clear the pending image transforms?  
  > **username_2**: See here -> https://craftcms.com/support/stuck-tasks  
  > **username_0**: Cheers. Now upped to 2048M and 240 but still no joy. I'm thinking it's something in the code. Limits seem way too big now for what the script is doing!  
  > **username_3**: Go LARGE on the memory! Through the above php.ini method, I've managed to allocate  5032000M on a shared server (kept adding zeros), before the stuck image transform process was able to succeed. (won't mention the name of the hosting Company or package) I know this sounds ridiculous but consider that if the processors are also shared then anything which the machine is trying to calculate may timeout because of processing power too. (Exactly none of our other Craft installations need this sort of thing, just the one on the almost-free shared hosting which the client insisted on)  
  > **username_0**: Still no joy limits upped to way above suggested 5032000M and it still hangs. My thoughts now turn to the transforms are being performed within a loop on some home page slide images. The loop is over a matrix block could this be causing the issue? There are 4 slides it loops through performing the transform each time it finds the image field.  
  > **username_2**: So you're still getting out of memory errors or is it a different error?  
  
  ---
  
  