Support » Networking WordPress » How can I change PHP memory limit by account? Is this possible?

  • Resolved Marcelo Pedra


    Hello guys, I’m wondering if such a thing is possible.
    i have a WP Multisite using parked domains, not subdomains. I develop and sell WP spaces for different companies, and they do the publishing and maintanance by theirself. Every website is a big little world and some of their admins are newbies, testing several plugins and bloating their websites unintentionally. They all run on PHP 5.4 for better memory optimization and have 128 MB of RAM as PHP memory limit, but you can see websites using 20 MB and others using 80 MB.

    That’s why a way to limit the PHP memory usage IN A PER SITE BASIS would be helpful.

    Anybody know about a plugin or any htaccess code or php filter/hack to limit the php usage selectively?


Viewing 4 replies - 1 through 4 (of 4 total)
  • As far as I know, one WordPress Multisite installation has one global php memory limit. This is done on the server level via php.ini.

    Your Multisite users to install and test random plugins? That’s a pretty major security issue. As the installation administrator you install a bunch of secure and applicable plugins and then you can let your users pick what they want to have activated.

    Also, Mutlsite is designed for a set of sites for a community of users. I would highly recommend not using Multisite in your scenario.

    No, end users are unable to install new plugins, and we provide that bunch of very well tested, multisite compatible, plugins. Those plugins covers a wide range of requirements and end users receive their new sites with those plugins deactivated, so they enable what they need. The problem is with several admins of different websites, who enabled lots of plugins that they don’t actually use or need, and it stay active, generating a great memory usage. I thought about limiting what plugins can they access to, but it only generate a huge flow of customer support queries.

    If I could provide only 64 MB for most users, and expand their memory limit when they really need it, we could optimize memory usage.

    The solution we found by now, is to maintain two multisite installs in the same server, so they can start using a limited amount of RAM (64 MB), and if they develop to a more important project, they are migrated to the multisite with 128 MB of usable memory. If their potential of growth is too good, they are moved to an individual WP install. This work for us, yet it means keeping up with two multisite installs.
    BTW, we use a cache plugin, mysql cache, CDN, and all the posible optimizations to do their user experience as smooth as posible.

    Any thoughts regarding this scenario could come in handy.

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Well no. Because PHP is per server user, not per WP instance. PHP has the memory, or it doesn’t. WP isn’t smart enough to know, it’s all PHP 🙂

    The solution is

    1) Get more memory
    2) Remove/limit usage of the plugins that cause the problem.

    ok, that’s what I was afraid of. Thank you for the clarifications.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I change PHP memory limit by account? Is this possible?’ is closed to new replies.