Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Is there a script length limit in Php?

Is there a script length limit in Php?

Hi, I'm trying to save a very long HTML page into the PhP section.  It seems that if I try to save beyond some unknown length, the script isn't saved and the default content "// example: return 23;" is put back in.  I've tried saving different parts of the HTML and it saves fine but if I say copy the same HTML twice in sequence ,it won't save, so there seems to be some arbitrary length?

thanks

joebarrus
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Is there a script length limit in Php?

Hi Joe,

there certainly hasn't been a limit in the past, but it's possible that a recent update in Joomla may have changed the field definitions. Can you tell me what exact version of Joomla you have installed? I'll test it out and get back to you.

Thanks,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Is there a script length limit in Php?

Hi Steven,

I'm on Joomla! 3.3.6 Stable.  I tried again using just plain text and kept increasing the length and there was a point where it wouldn't save, so it seems there is a limit.  I haven't gone through the trouble of trying to determine that limit though smile

If there is a limit, can you tell me if there is a way to bypass it?

Thanks!
Joe

joebarrus
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Is there a script length limit in Php?

Steven, ok I tried to assess the limit.  It appears to be about 64K.  Or to be more specific, 65038 contiguous letter 'x's pasted into the box smile

joebarrus
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Is there a script length limit in Php?

Hi Joe,

yes, looks like the limit is defined by the limit on TEXT fields in MySQL. The params field in the # __modules table is of type "TEXT".

There are 2 ways around this:

1 - store the HTML in a separate file somewhere and load it in via PHP
2 - you can probably safely change the type of the params field to MEDIUMTEXT (up to 16MB). It's unlikely that Joomla will check this or try to change it except on installation. You might need to take care on future major Joomla upgrades however, which may check and enforce particular table characteristics.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1691
Total Polls:
6
Total Posts:
5912
Total Posts Today:
6
User Info:
 
Total Users:
11515
Newest User:
velis415
Members Online:
0
Guests Online:
214

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked