Title: PHP Timeout
Last modified: August 26, 2025

---

# PHP Timeout

 *  Resolved [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [7 months, 3 weeks ago](https://wordpress.org/support/topic/php-timeout-2/)
 * Hi,
   I’ve tested 3 shared hosting and Regex test is too slow. On one I had PHP
   timeout 30 seconds and it was crushing, when lifted to 60 it was 54 seconds on
   Ryzen 7700 CPU. So this regex test can spiral for much longer on slower hostings.
   I suggest you adjust this test so it won’t run longer than 30 seconds on slow
   hosting. That’s more measure for inexperienced users that doesn’t know how to
   debug and adjust. Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Anton Aleksandrov](https://wordpress.org/support/users/antonaleksandrov/)
 * (@antonaleksandrov)
 * [7 months, 3 weeks ago](https://wordpress.org/support/topic/php-timeout-2/#post-18616444)
 * true. i will thing about it.. it makes no sense, if test runs more than 30 seconds.
   that means CPU is slow…
 *  Thread Starter [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [7 months, 3 weeks ago](https://wordpress.org/support/topic/php-timeout-2/#post-18617242)
 * How this server is slow? It doesn’t make sense.
   [https://d3v55qvjb2v012.cloudfront.net/VfEm/2025/08/28/09/45/cTjuQGn2NFd/sc.png?srcid=cTjuQGn2NFd&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kM3Y1NXF2amIydjAxMi5jbG91ZGZyb250Lm5ldC9WZkVtLzIwMjUvMDgvMjgvMDkvNDUvY1RqdVFHbjJORmQvc2MucG5nP3NyY2lkPWNUanVRR24yTkZkIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNzU2Mzc0NDE5fX19XX0_&Signature=fNbBe99Gqz2A9r5F3WUnZQ1qNh1-n18wRTuQqd5YDRmCBwhhwGTnMBS16ZQLQrF9AVsE5rO9En3VwV9ytI2Y0Cu97UV10e7CZNQTWIvPuFvBCoZDVVyxpC2WIZK4QAP43vumgRwSwGhD3yb5X1IYQMGPv4dY-9CfA~lZ5SxVNpU_&Key-Pair-Id=APKAI4E2RN57D46ONMEQ](https://d3v55qvjb2v012.cloudfront.net/VfEm/2025/08/28/09/45/cTjuQGn2NFd/sc.png?srcid=cTjuQGn2NFd&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kM3Y1NXF2amIydjAxMi5jbG91ZGZyb250Lm5ldC9WZkVtLzIwMjUvMDgvMjgvMDkvNDUvY1RqdVFHbjJORmQvc2MucG5nP3NyY2lkPWNUanVRR24yTkZkIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNzU2Mzc0NDE5fX19XX0_&Signature=fNbBe99Gqz2A9r5F3WUnZQ1qNh1-n18wRTuQqd5YDRmCBwhhwGTnMBS16ZQLQrF9AVsE5rO9En3VwV9ytI2Y0Cu97UV10e7CZNQTWIvPuFvBCoZDVVyxpC2WIZK4QAP43vumgRwSwGhD3yb5X1IYQMGPv4dY-9CfA~lZ5SxVNpU_&Key-Pair-Id=APKAI4E2RN57D46ONMEQ)
    -  This reply was modified 7 months, 3 weeks ago by [pixtweaks](https://wordpress.org/support/users/pixtweaks/).
 *  Thread Starter [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-timeout-2/#post-18617891)
 * Valid link of the screenshot: [https://go.screenpal.com/watch/cTjuQGn2NFd](https://go.screenpal.com/watch/cTjuQGn2NFd)
 *  Plugin Author [Anton Aleksandrov](https://wordpress.org/support/users/antonaleksandrov/)
 * (@antonaleksandrov)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-timeout-2/#post-18626318)
 * I have added failover code – if any benchmark runs more than 20seconds – it will
   stop and avoid PHP crash. Please update to latest version.
 *  Thread Starter [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-timeout-2/#post-18626637)
 * I debugged the code and it’s last $paragraphed
 *     ```wp-block-code
       $paragraphed = preg_replace('/\n\n(.+?)(?=\n\n|\z)/s', "<p>\\1</p>", $paragraphed);
       ```
   
 * This test on my local runs in about 220 µs, but on shared hosting, the same I
   posted results, is 2ms, 10x slower for some reason. Now, I think having limit
   you has added is great, but then we don’t have measurement. I suggest split regex
   test into two, simple and complex, move this problematic into the new test and
   make less cycles for it so it’s never more tan 2-3 seconds. Thank you!
 *  Plugin Author [Anton Aleksandrov](https://wordpress.org/support/users/antonaleksandrov/)
 * (@antonaleksandrov)
 * [7 months, 2 weeks ago](https://wordpress.org/support/topic/php-timeout-2/#post-18627282)
 * you can not imagine, how in fact modern CPUs are. That’s why some tests have 
   many cycles. Because otherwise it is so hard to measure spent time. 🙂
 * If it runs fast on your local setup – that is good. There must be a reason, why
   it runs 10x times slower on shared hosting and that was the purpose for this 
   plugin – to identify it. That means – shared hosting provider either has slow
   CPU or throttles your PHP scripts. This plugin idea was not to run fast, but 
   to run heavy code to see – how much you can get out of your hosting. 🙂
 *  Thread Starter [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/php-timeout-2/#post-18628291)
 * I’ve dived into this issue and I got the root cause. The slow regex is caused
   by disabled PCRE JIT. Once you change in php.ini pcre.jit=1 or ini_set(‘pcre.
   jit’,’1′); in wp-config.php, it would be up to 10x faster. For some reasons, 
   shared hostings using Cloudlinux and Litespeed has this setting off by default.
   
   I tested it in the real world scenario, how much improvement it would bring and
   the result is: negligibleA site using translation plugin Translatepress that 
   is heavily using regex shown no sign of improvement in TTFB.Now, I’m very grateful
   that your plugin could detect it and I will everywhere turn this setting on.
 *  Plugin Author [Anton Aleksandrov](https://wordpress.org/support/users/antonaleksandrov/)
 * (@antonaleksandrov)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/php-timeout-2/#post-18628933)
 * Thanks for sharing, very interesting. I will check my settings (we’re alos using
   cloudlinux, but don’t use CL PHP). I will also add your findings to suggestions
   on the page.
 *  Thread Starter [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * (@pixtweaks)
 * [7 months, 1 week ago](https://wordpress.org/support/topic/php-timeout-2/#post-18629035)
 * You welcome! BTW here is the test, if you set 0 in ini_set, the total time will
   be much slower
   [https://onlinephp.io/c/bd146](https://onlinephp.io/c/bd146)
 * Thank you for your work!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP Timeout’ is closed to new replies.

 * ![](https://ps.w.org/wpbenchmark/assets/icon-256x256.gif?rev=2669206)
 * [Hosting Benchmark tool](https://wordpress.org/plugins/wpbenchmark/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpbenchmark/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpbenchmark/)
 * [Active Topics](https://wordpress.org/support/plugin/wpbenchmark/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpbenchmark/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpbenchmark/reviews/)

 * 14 replies
 * 2 participants
 * Last reply from: [pixtweaks](https://wordpress.org/support/users/pixtweaks/)
 * Last activity: [7 months, 1 week ago](https://wordpress.org/support/topic/php-timeout-2/#post-18629035)
 * Status: resolved