Are you ignoring your Host's PHP Set Up?

Sdílet
Vložit
  • čas přidán 22. 06. 2024
  • Are you ignoring your Host's PHP Set Up?
    Grab our Course and $1 Business Packs: learn.websquadron.co.uk/#packs
    Elementor Hosting - managed wordpress hosting :
    be.elementor.com/visit/?bta=2...
    Elementor Pro - The builder that will make you a pro
    be.elementor.com/visit/?bta=2...
    Book your 1-2-1 Consultation: learn.websquadron.co.uk/#support
    We love to create - share - respond - and deliver.
    Join our Facebook Group: / 3309523509284305
    Get Code Snippets Pro: r.freemius.com/10565/3304295/
  • Jak na to + styl

Komentáře • 40

  • @phillankester
    @phillankester Před 17 dny +5

    Based on our experience, a 768M memory limit for PHP is typically more than sufficient; we rarely encounter situations where PHP workers exhaust even 512M. In shared hosting environments, the primary constraint tends to be the availability of PHP workers, with many shared hosting environments capping this at 2 workers. This limitation is more likely to impact performance than the memory limit.
    Additionally, our default file size upload limit is set to 16M to protect the hosting environment from potential abuse. However, we sometimes increase this limit upon request for clients who need to upload larger files.
    :D

    • @websquadron
      @websquadron  Před 17 dny +2

      Great points.

    • @zadekeys2194
      @zadekeys2194 Před 17 dny +1

      Out of interest, what files are they uploading that are 16MB or more? Hopefully not images 😂

    • @phillankester
      @phillankester Před 16 dny

      @@zadekeys2194 sometimes PDFs can be huge. a few clients have various media types. :)

  • @nigelhancock3580
    @nigelhancock3580 Před 17 dny +6

    I have a strong suspicion that there are hosting companies out there that allow you to apparently increase PHP memory limit but, in the background it's still capped at some silly low number.

    • @websquadron
      @websquadron  Před 17 dny +3

      Totally agree. There is one that begins with 'K' that cap you at 256 Limit unless you go to their highest Premium Package but they don't reveal that to you until you hit a problem :(

    • @ericblackwell3727
      @ericblackwell3727 Před 16 dny

      @@websquadron Yep. I hit that head on awhile back and had to move away from them.

    • @phantomcraneflymusic
      @phantomcraneflymusic Před 16 dny

      @@websquadron Would there be a way to test this?

  • @StuartLowPhotography
    @StuartLowPhotography Před 16 dny +2

    This is a touch misleading because there's no one size fits all. If your site uses more than 100 MB per request or if your site needs more than 256Mb to generate a single page, something is very wrong with your site's code. You shouldn't just increase the limit to 768mb for the sake of it because that won't speed up your site. 256mb is a safe default limit and you should only increase it if you're seeing memory limit hit fatal errors etc. A site with PHP 7 + Cache enabled uses up to 5x less memory. For example, a site 7.4 with 20mb per request doesn't need more than 64mb.

  • @CFGroove
    @CFGroove Před 16 dny +1

    You. Are. The. Man. xo

  • @boutzero
    @boutzero Před 17 dny +1

    Muchísimas gracias!!

  • @zadekeys2194
    @zadekeys2194 Před 17 dny

    Imran, my host (Hetzner) limits the RAM to 256MB, and I've never had any issues. With no CDN or Cache plugins, I can get my sites to above 90% in GTmetrix and other speed tests. I think this comes down to proper image opt and setting the site to load properly, eg preload logo, company name, menu, hero image and lazy load the rest.

  • @just_jen
    @just_jen Před 17 dny +1

    Good to know! Thanks, Imran!

  • @markbratton111
    @markbratton111 Před 17 dny +1

    VERY important

  • @tamera00
    @tamera00 Před 15 dny

    As usual I love your vids, BUT PHP 7.4? you really should be on 8.3 or at least 8.1 for plugins to work correctly. But always love your videos

  • @Mymysticmama
    @Mymysticmama Před 17 dny +1

    This is very useful. I have both those settings at 1024M (trying to solve a problem with Printful where if I have more than 3 variants on a product it kicks some timeout error. Still haven't solved it).
    My site health keeps reminding me I have an "outdate SQL server". Clueless on how to fix that. BUT.......I have I told you lately that yer AWESOME!!! ♥

    • @websquadron
      @websquadron  Před 17 dny +1

      Go to your WordPress dashboard, navigate to Tools > Site Health > Info, and check the database version.
      Contact your hosting provider’s support and ask them to update the MySQL server to the latest stable version. They will handle the update for you.
      PS: Optimize your database using a plugin like "WP-Optimize" to ensure it’s running efficiently.

    • @zadekeys2194
      @zadekeys2194 Před 17 dny

      Make sure you are running php 8 and that your images are scaled properly and optimised before converting them to webp. My host limits me to 256MB and I've never had issues with performance. Most if not all of my sites get over 90% in GTmetrix, page speed score etc. This is without any cache or CDN plugin.

  • @hosterplus
    @hosterplus Před 17 dny +1

    Tolles Video, Imran! 👏 Die Betonung auf die PHP-Memory-Limits und die maximale Dateigröße beim Upload ist extrem wichtig und wird oft übersehen. Deine Erklärungen sind klar und praxisnah, besonders für diejenigen, die ihre Websites optimieren möchten.
    Eine Frage hätte ich: Wie siehst du die Entwicklung von PHP in den nächsten Jahren, insbesondere in Bezug auf die zunehmende Nutzung von serverlosen Architekturen und modernen Webtechnologien? Denkst du, dass PHP weiterhin eine wichtige Rolle spielen wird oder werden andere Technologien die Oberhand gewinnen? 🤔
    Freue mich auf deine Antwort und weitere informative Videos! 😊

    • @websquadron
      @websquadron  Před 17 dny

      Great question! PHP has been a powerhouse for web development for years, and it's constantly evolving. While other languages and frameworks are gaining traction, PHP's large ecosystem, continuous updates, and strong community support ensure it will remain a key player.
      It's not going anywhere soon-expect it to coexist and integrate with emerging technologies rather than be overshadowed. I think. And I am probably wrong :)

  • @johnwellington269
    @johnwellington269 Před 15 dny

    whats ur view on cloudways? is it allow 768mb?

  • @Tom59Kriek
    @Tom59Kriek Před 12 dny

    My SP limits the max file upload size to 4G. They claim you do not need more than that. They have made me jump hoops to get the latest SEO Pro plugin (4.12G) uploaded and installed. I queried them and they do not want to budge, saying it is to limit DDOS attacks. It sounds like hogwash to me. So, they give two reasons. Bigger than 4G is not needed and DDOS. Any comments?

  • @shuvobaroi7766
    @shuvobaroi7766 Před 17 dny

    @Imran is there any way to change these PHP settings from the website by plugin or custom code? Some clients, don't want to share hosting credentials :)

    • @websquadron
      @websquadron  Před 17 dny +2

      I refuse to work with clients that don't share hosting, or don't have a named person who is clued up for any hosting issues.
      Yes, you can change PHP settings directly from your WordPress website using either a plugin or custom code. Here are both approaches:
      ### Using a Plugin
      1. **WP Config File Editor Plugin:**
      - Install and activate the "WP Config File Editor" plugin.
      - Go to the plugin settings from the WordPress dashboard.
      - Use the plugin interface to modify PHP settings in the `wp-config.php` file.
      2. **PHP Settings Plugin:**
      - Install and activate the "PHP Settings" plugin.
      - Navigate to Settings > PHP Settings.
      - You can change various PHP settings directly from the plugin interface.
      ### Using Custom Code
      You can add custom code to your `wp-config.php` file to change PHP settings. Here’s how to do it:
      1. **Edit `wp-config.php`:**
      - Access your WordPress installation files via FTP or a file manager.
      - Locate and open the `wp-config.php` file.
      2. **Add PHP Settings:**
      - Add the following lines of code to modify PHP settings. Adjust the values as needed:
      ```php
      @ini_set('upload_max_filesize', '64M');
      @ini_set('post_max_size', '64M');
      @ini_set('memory_limit', '256M');
      @ini_set('max_execution_time', '300');
      @ini_set('max_input_time', '300');
      ```
      - These lines set the `upload_max_filesize`, `post_max_size`, `memory_limit`, `max_execution_time`, and `max_input_time` PHP settings.
      3. **Save and Upload:**
      - Save the changes to the `wp-config.php` file and upload it back to your server if you used FTP.
      ### Example: Changing Memory Limit via Code
      If you want to increase the memory limit, add the following line to your `wp-config.php` file:
      ```php
      define('WP_MEMORY_LIMIT', '256M');
      ```
      ### Note:
      While these methods are generally safe, incorrect changes to the `wp-config.php` file can break your site. Always back up your site before making changes.
      By using either of these methods, you can easily adjust PHP settings from within your WordPress site.

    • @zadekeys2194
      @zadekeys2194 Před 17 dny +1

      Setup a staging environment on the client's environment and work in a clone of the site there, one where you have access. Clients who refuse to share such details only slow you down and that means more cost for the client....

    • @shuvobaroi7766
      @shuvobaroi7766 Před 16 dny

      @@websquadron Thanks for your valuable feedback! Take love 💟

  • @stevebullman4116
    @stevebullman4116 Před 16 dny

    just to confuse matters....I checked one of my sites which shows its running 512M so I queried this with my host. The server runs 512M per php worker but has 3 workers per website, so in fact I have available 1536, yet Wordpress doesn't recognise the multiple workers. Am I missing something, or is Wordpress missing something?

  • @sigma.m
    @sigma.m Před 17 dny

    What hosting provider do you recommend? Which host are you using in this video?

    • @websquadron
      @websquadron  Před 17 dny +1

      I use SiteGround, and Elementor Hosting. 20i are good too.

    • @sigma.m
      @sigma.m Před 17 dny

      ​@@websquadron I currently use Chemicloud and it shows the ff: PHP memory limit - 1G; Upload max filesize and PHP post max size - 100M. Do you think the 100M is acceptable? In your sample it shows 250M which is higher.
      Thanks for your response!

    • @websquadron
      @websquadron  Před 17 dny +1

      @@sigma.m 100M is fine :)

    • @zadekeys2194
      @zadekeys2194 Před 17 dny

      ​@@sigma.mtry not to upload such large files. Images should be waaaaaay smaller.... Video should be placed on a separate CDN and not on your actual site host storage.

    • @zadekeys2194
      @zadekeys2194 Před 17 dny

      ​@@sigma.m also, having a large file upload does mean that if your site is compromised, an attacker can upload big files, likely exe's etc and then distribute that using your site. I take mine down to 2-4MB as all my images are under those sizes.