Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    WordPress & PHP memory-related notes

    WordPress (Developer)
    1
    1
    142
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d19dotca
      d19dotca last edited by d19dotca

      I was recently experimenting a bit with php.ini settings and memory constants in the wp-config.php. Here is what I learned which I had found confusing before, so wanting to share this in case anyone didn't know this already:

      When looking at the Tools > Site Health > Info page in WordPress...

      • The PHP memory limit value (under Server tab) comes from the memory_limit set in the php.ini file.
      • The WP_MAX_MEMORY_LIMIT value (under WordPress Constants tab) also comes from the memory_limit set in the php.ini file when the WP_MAX_MEMORY_LIMIT isn't also defined in the wp-config.php file. ​If the WP_MAX_MEMORY_LIMIT is defined in the wp-config.php file, then this overrides the memory_limit parameter set in the php.ini file.
      • The WP_MEMORY_LIMIT value (under WordPress Constants tab) comes from the WP_MEMORY_LIMIT defined in the wp-config.php file (this is hard-coded). If not defined, it defaults to 40M.

      I would recommend increasing WP_MEMORY_LIMIT closer to the overall app memory limit by adding something like this to your wp-config.php file: define( 'WP_MEMORY_LIMIT', '2G' ); for a 2 GB memory limit to WordPress for example.

      I had found it confusing earlier as to where each parameter was defined and how it was set (and what the defaults are). Hopefully this helps others for the future too.

      --
      Dustin Dauncey
      www.d19.ca

      1 Reply Last reply Reply Quote 3
      • First post
        Last post
      Powered by NodeBB