I'm testing a theme on a group of people. Its a microstock image selling theme. Very unique, so far, works great on most hosts.

However many people complain that that the image-processing script crashes with larger images. It uses wideimage - http://wideimage.sourceforge.net/. This is mostly on shared hosting. Most people have dealt with it by changing php.ini settings and increasing memory - but this goes against the theme being a simple install-and-use situation.

I heard that it might be possible to place a php.ini file in the theme's folder, and it would apply to all other folders. Or even in the script's folder itself.

Logically I had simply upped the memory use in the script itself, but that does not appear to do much. ini_set( "memory_limit", "1024M" ). <- maybe thats just freekishly too high? :D

I simply need a good fast solution to dealing with large images among varying hosts.

  • If Themes have to increase the PHP memory limit, they are inherently _doing_it_wrong(). Have you considered just using the WordPress core image-handling functions, including image resizing? – Chip Bennett Mar 29 '13 at 12:22

I'm wanted to comment rather than answer as I don't have a solution for you, but I think this is too long :)

Hosts vary so widely on how and where they set memory allocation, and whether they allow hosted scripts to set it, that I don't think there is a bullet-proof solution for you.

I would try and 'handle' the situation in a theme settings page; test available memory and if it's too low, try and enable ini_set on each gallery page that posts large data. If that's not possible, ask the user to add the WP_MEMORY_LIMIT constant to their wp-config file, or add the php.ini modification, or call their hosts to up their limit. Some hosts allow a php.ini in the web root, but many don't.

  • Thank you. I'll start with that. Interestingly one can upload anything in wordpress right? So the question is how does wordpress handle big resizes in a constricted environment? – user1915665 Mar 29 '13 at 7:51
  • No Wordpress has to respect the upload settings too. In the add media boxes it shows the max upload size setting (or at least it used to in recent versions). Here's some codex info on it: codex.wordpress.org/… – Mere Development Mar 29 '13 at 8:14
  • Just another thought, you might need to up the post_max_size and upload_max_filesize too. Have a read here: php.net/manual/en/ini.core.php#ini.post-max-size – Mere Development Mar 29 '13 at 8:29
  • Thanks again. That at least gives me some info to work with. – user1915665 Mar 29 '13 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.