Title: Too large PHP file?
Last modified: August 21, 2016

---

# Too large PHP file?

 *  Resolved [John](https://wordpress.org/support/users/dsl225/)
 * (@dsl225)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/too-large-php-file/)
 * Hello,
 * I’m trying this for the first time, my apologies if this question has already
   been answered here.
 * I tried to insert a very large PHP file and geting this error:
 * > Warning: preg_replace() [function.preg-replace]: Compilation failed: regular
   > expression is too large at offset 479851 in /xxx/wp-content/plugins/insert-
   > php/insert_php.php on line 54
 * Is there any size limit?
 * Thanks.
 * [https://wordpress.org/plugins/insert-php/](https://wordpress.org/plugins/insert-php/)

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

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/too-large-php-file/#post-4774199)
 * John, it seems there is a size limit from what you report. I’ve never experienced
   it, myself.
 * It may be a PHP regular expression size limit, as the error message reports. 
   Or perhaps a function eval() size limit. It might also have to do with the amount
   of server resources available.
 * Try to reduce the size of the code and see if it will run then.
 * Will
 *  Thread Starter [John](https://wordpress.org/support/users/dsl225/)
 * (@dsl225)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/too-large-php-file/#post-4774201)
 * Hi Will,
 * Yes, I think I went to far..
    I tested with a way to large PHP file and that 
   goes beyond the limits.
 * thanks for your reply and for this excellent plugin!
 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/too-large-php-file/#post-4774320)
 * This post is gratuitous to get the thread marked resolved.

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

The topic ‘Too large PHP file?’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/too-large-php-file/#post-4774320)
 * Status: resolved