Title: Turn off php output buffering
Last modified: June 21, 2024

---

# Turn off php output buffering

 *  Resolved [chrisce](https://wordpress.org/support/users/chrisce/)
 * (@chrisce)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/)
 * Hello,
 * I would like to start with saying great plugin! But for some reason it seems 
   that the plugin turns on PHP output buffering , not making it possible to output
   php echo as the script runs, instead it saves everything in memory and then prints
   everything at the same time when the script is done. I my case, I’m importing
   products from a feed, with a response after each product import – It seems that
   this plugins turns on PHP buffering.
 * I have come to this conslusion by disabling and uninstalling the plugin, then
   its works fine. When installing and enabling the plugin, I can’t see any output
   more instead it outputs all the echos in the end when the script is done running
   and not while it’s running.
 * Is it possible to fix that php buffering is turned to off or not override this
   setting?
 * Best regards,
   Chris
    -  This topic was modified 1 year, 12 months ago by [chrisce](https://wordpress.org/support/users/chrisce/).

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17843581)
 * the output buffer is the core function of our plugin , if you don’t buffer it,
   the page optm will not be possible as it sends to brwoser directly as it outputs
   and obvious you can not use PHP to modify the HTML source code that sends to 
   browser already.
 * if you know what is the request URI of your importing , I can help you to disable
   our plugin on that specific URL.
 *  Thread Starter [chrisce](https://wordpress.org/support/users/chrisce/)
 * (@chrisce)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17843825)
 * Hi,
 * The structure for my website is as follows:
 *     ```wp-block-code
       public_html (wp installation is in public_html)- .... (wordpress installation files...)-- ceeglo-engine----import------ run.sh -> calling init.php------ init.php------ logs (folder)
       ```
   
 * 
   init.php calls wp-load, it seems like as soon as wp-load is included in my file,
   the buffering is on.Init.php file start like this:
 *     ```wp-block-code
       // Run init for import functionsif (!defined('ABSPATH')) {    define('ABSPATH', '/home/account/domains/DOMAIN/public_html/');}require_once ABSPATH . '/wp-load.php';require_once ABSPATH . '/wp-includes/wp-db.php';require_once ABSPATH . '/wp-includes/pluggable.php';
       ```
   
 * Best regards,
   Chris
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17843829)
 * I’d suggest this
 * add `define('LSCWP_V', '1');` before you load wp-load.php , once this constant
   is defined before our plugin does, our plugin will exit immediately before actually
   initialize
 * but you may need to check if there is any purge problem after this , like if 
   you import something that requires cache purge
 *  Thread Starter [chrisce](https://wordpress.org/support/users/chrisce/)
 * (@chrisce)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17843836)
 * Hi again,
 * Lovely, I will try it out. I agree with you regarding the cache problem, I’m 
   inserting massive amount of products, Is there a function I can call in order
   to purge cache after the script is done running?
 * Best regards,
   Chris
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17843843)
 * just a quick thinking
 * create another , separated file , with code like
 *     ```wp-block-code
       <?phprequire( './wp-load.php' );if ( defined('LSCWP_V')) {  do_action( 'litespeed_purge_all' );}
       ```
   
 * name it like `my_import_purge.php` or something secret , you can add certain 
   authentication to prevent unauthorized purge
 * then on your script , after it finished inport , send a request to it , like `
   wp_remote_get( 'https://your_domain.com/my_import_purge.php' );` to purge it.
 *  Thread Starter [chrisce](https://wordpress.org/support/users/chrisce/)
 * (@chrisce)
 * [1 year, 12 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17843858)
 * Hi,
 * Sounds great, I will try it out. Thanks!
 *  Thread Starter [chrisce](https://wordpress.org/support/users/chrisce/)
 * (@chrisce)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17848480)
 * Hi again,
 * The solution above seems to have fixed the most of the problems. However, I’m
   seeing that using this plugin activated while importing products seems to slow
   down the whole process, going from 120 minutes when plugin is inactivated to 
   450 minutes when plugin is activated, to import all products.
 * Could it possibly be some caching settings that I should turn off, that can slow
   down the process?
 * Best regards,
   Chris
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17848920)
 * if you have enabled object cache, try disable it
 * logically , with that define LSCWP_V , the plugin should not even be loaded on
   your importing , but object cache is the only thing that could “bypass” this 
   disabling
 *  Thread Starter [chrisce](https://wordpress.org/support/users/chrisce/)
 * (@chrisce)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17852691)
 * Great thanks, I will try it out.

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

The topic ‘Turn off php output buffering’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [chrisce](https://wordpress.org/support/users/chrisce/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/turn-off-php-output-buffer/#post-17852691)
 * Status: resolved