FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Forum post attachments fail (Other uploads work fine)
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Forum post attachments fail [message #166421] Mon, 05 December 2011 19:58 Go to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
add to buddy list
ignore all messages by this user
The admin control panel upload features all work fine - the file manager, avatars, smiley icons, etc.

However, the forum post attachment uploads fail.

Not only do they fail, but even when not uploading any attachments, the error message saying the file is too big appears. Usually when you select "preview" before submitting the post.


Any help would be appreciated.

My system configuration overview:
FUDforum version: 	3.0.3
PHP version: 	5.2.17
PHP built on: 	Linux box269.bluehost.com 2.6.32-46.1.BHsmp #1 SMP Tue Sep 6 12:18:02 MDT 2011 x86_64
Database type: 	mysql (mysqli)
Database version: 	5.1.60-community-log
Web server: 	Apache
Web Server load: 	15.68
Web server to PHP interface: 	cgi-fcgi
WebServer User/Group: 	xxxxxxxx / xxxxxxxx (nnn/nnn)
Relevant PHP settings: 	
Safe mode: 	OFF
Open basedir: 	none
Display errors: 	ON
File uploads: 	ON
Maximum file upload size: 	10M
Magic quotes: 	ON
Output buffering: 	No
Disabled functions: 	none
PSpell support: 	Yes
Zlib support: 	Yes


Please let me know if you need any more info or if there is anything I can do to debug this process. I believe bluehost has zend support, so perhaps I could insert the debugger code and step through the process with eclipse, or something.

I had this tacked onto the end of a can't upload anything thread but was getting no response, so I figured maybe you don't respond to old threads, so I'd start my own. Sorry if that's bad.

One more bit of possibly-relevant info: I am using a path_info theme. Did not check to see if the problem exists with the default template/theme.

[Updated on: Mon, 05 December 2011 20:31]

Report message to a moderator

Re: Forum post attachments fail >SOLVED< [message #166429 is a reply to message #166421] Fri, 09 December 2011 19:39 Go to previous messageGo to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
add to buddy list
ignore all messages by this user
I am replying to my own post, with the solution.

The problem was in the php.ini file. Even though all the other "magic_quotes" settings were off, the "magic_quotes_gpc" was On.

After setting magic_quotes_gpc to Off, the problem miraculously vanished. Since magic quotes is deprecated starting with php 5.3.0, it's not really a bug that the code doesn't handle magic_quotes_gpc.

I didn't see it anywhere in the install instructions for 3.0.3, but it might not be a bad idea if php 5.2.x is still going to be supported for a while, to add a warning to be sure to disable all magic quotes functions in your php.ini.
Re: Forum post attachments fail >SOLVED< [message #166431 is a reply to message #166429] Sat, 10 December 2011 12:40 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 662
Registered: May 2009
Location: USA
Karma: 2
Senior Member
add to buddy list
ignore all messages by this user
Sometimes we just have to talk to our selves. Cool

ShineOn wrote on Fri, 09 December 2011 18:39
be sure to disable all magic quotes functions in your php.ini.

So just how do you turn them off?


"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Forum post attachments fail >SOLVED< [message #166432 is a reply to message #166431] Sat, 10 December 2011 17:15 Go to previous messageGo to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
add to buddy list
ignore all messages by this user
In php.ini make sure all lines that start with magic_quotes are "Off"
Re: Forum post attachments fail >SOLVED< [message #166433 is a reply to message #166432] Sat, 10 December 2011 17:33 Go to previous messageGo to next message
The Witcher is currently offline  The Witcher   United States
Messages: 662
Registered: May 2009
Location: USA
Karma: 2
Senior Member
add to buddy list
ignore all messages by this user
Ok that would be the php.ini file on my server.

That's ok I was making sure there were no setting/access from the admin control panel.
Thanks



"I'm a Witcher, I solve human problems; not always using a sword!"
Re: Forum post attachments fail >SOLVED< [message #166434 is a reply to message #166433] Sat, 10 December 2011 22:39 Go to previous messageGo to next message
ShineOn is currently offline  ShineOn   United States
Messages: 53
Registered: July 2011
Karma: 1
Member
add to buddy list
ignore all messages by this user
Nope, not a FUDforum setting, but a php.ini setting. One that you should only have to worry about if you're not yet running php 5.3, unless 5.3 has a "backward compatibility with 5.2" setting that makes deprecated functions available. Hopefully not.

You can see from the display from FUDforum admin panel system config overview I posted in the OP code snippet that it shows "Magic quotes: ON" which apparently will show if any of the magic_quotes settings are on.

In my 5.2.x php.ini there are three "magic_quotes..." settings. Two were off, but the magic_qotes_gpc was on - and that's the one that sets the php magic quotes feature that handles posts, which is where the error was showing up.

Magic quotes essentially escapes stuff going in to php with slashes. It was intended to make database entry easier, by pre-escaping stuff just in case. However, because the pre-escaping caused problems of its own necessitating work-around code to remove slashes, and by its very existence promoted lazy programming practices, it's deprecated as of 5.3, and all magic quotes type data handling should be properly coded for in order to be 5.3 compatible. The FUDforum code is probably already coded such that magic quotes functionality is not needed, so when it was enabled it was interfering with proper operation of the FUDforum code, resulting in the error I was experiencing.
Re: Forum post attachments fail >SOLVED< [message #166435 is a reply to message #166434] Sat, 10 December 2011 22:54 Go to previous message
The Witcher is currently offline  The Witcher   United States
Messages: 662
Registered: May 2009
Location: USA
Karma: 2
Senior Member
add to buddy list
ignore all messages by this user
Gotcha! I know where the php display is, and one of my hosts has a PHP.ini I've had to edit to increase the size of the upload but I didn't recall seeing magic quotes. Thanks for the clarification.



"I'm a Witcher, I solve human problems; not always using a sword!"
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Can't upload any file
Next Topic: Avatar Approval
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Oct 24 02:03:37 EDT 2017

Total time taken to generate the page: 0.00770 seconds