Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st July 2011, 00:51
pebkac pebkac is offline
Senior Member
 
Join Date: Feb 2009
Posts: 132
Thanks: 2
Thanked 7 Times in 7 Posts
Question PHP Based sites not handling attachments correctly

Hi all,

I have a couple of sites on ISPConfig3 running on Ubuntu. One site is a forum and the other is osTicket. Both of these sites have a problem when attachments are uploaded. They both accept the attachment just fine, the problem is that when a user downloads the file it becomes corrupt and not usable. For instance on the forum I have a pdf file and it uploads fine and I can pull the file down via ftp or other means and it opens fine. But when I download it through the forum page it downloads very quickly with a 0byte size and is not usable. I also have the osTicket system running and when users attach pictures they are in the ticket but when you go to open them it is not readable. I've seen this on two differens ISPConfig servers I have installed and I really would like some help in getting it to work.

Thanks,

--Steve
Reply With Quote
Sponsored Links
  #2  
Old 21st July 2011, 10:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,488
Thanks: 813
Thanked 5,259 Times in 4,123 Posts
Default

Which php mode do you use for that website?
Is suexec enabled in the website settings?
Do you get any errors in the error.log of the website, when you upload a file?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 4th August 2011, 19:07
pebkac pebkac is offline
Senior Member
 
Join Date: Feb 2009
Posts: 132
Thanks: 2
Thanked 7 Times in 7 Posts
Default

SuExec is checked, PHP mode is Fast-CGI.

This is the error i get when I try and view an attachment:

Code:
[Thu Aug 04 09:53:34 2011] [warn] [client 96.247.85.207] mod_fcgid: stderr: PHP Warning:  readfile(/var/www/clients/client1/web1/web/osticket/attachments/0811/5D2292FF8C00A00_Screen_shot_2011_08_02_at_3.53.28_PM.png): failed to open stream: Permission denied in /var/www/clients/client1/web1/web/osticket/scp/attachment.php on line 71, referer: http://www.ccchsupport.com/osticket/scp/tickets.php?id=228
Reply With Quote
  #4  
Old 4th August 2011, 19:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,488
Thanks: 813
Thanked 5,259 Times in 4,123 Posts
Default

Please post the output of:

ls -la /var/www/clients/client1/web1/web/osticket/attachments/0811/
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 4th August 2011, 19:21
pebkac pebkac is offline
Senior Member
 
Join Date: Feb 2009
Posts: 132
Thanks: 2
Thanked 7 Times in 7 Posts
Default

Quote:
root@osticket:/var/www/clients/client1/web1# ls -la /var/www/clients/client1/web1/web/osticket/attachments/0811/
total 176
drwxrwxrwx 2 web1 client1 4096 2011-08-03 16:30 .
drwxrwxrwx 7 web1 client1 4096 2011-08-02 15:13 ..
-rw-rw---- 1 web1 client1 89232 2011-08-03 16:30 5D2292FF8C00A00_Screen_shot_2011_08_02_at_3.53.28_ PM.png
-rw-rw---- 1 web1 client1 81275 2011-08-02 15:13 7432BAC6FA15680_image.jpg
root@osticket:/var/www/clients/client1/web1#
Also the last error I posted was after I unchecked suEXEC, here it is with it on, and the way it has always been.
Quote:
root@osticket:/var/www/clients/client1/web1# tail -f /var/www/clients/client1/web1/log/error.log
[Thu Aug 04 10:09:29 2011] [warn] [client 96.247.85.207] mod_fcgid: stderr: PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/clients/client1/web1/tmp) in Unknown on line 0, referer: http://www.ccchsupport.com/osticket/scp/index.php
Reply With Quote
  #6  
Old 4th August 2011, 19:27
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,488
Thanks: 813
Thanked 5,259 Times in 4,123 Posts
Default

Quote:
Also the last error I posted was after I unchecked suEXEC
Ok, that explains the error. The attachments will only work when suexec is on.

Quote:
root@osticket:/var/www/clients/client1/web1# tail -f /var/www/clients/client1/web1/log/error.log
[Thu Aug 04 10:09:29 2011] [warn] [client 96.247.85.207] mod_fcgid: stderr: PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/clients/client1/web1/tmp) in Unknown on line 0, referer: http://www.ccchsupport.com/osticket/scp/index.php
the reason for this error is that you switched off suexec. This caued the session to be written under a wrong user. To fix that, close all browser windows, open the browser again and login again to get a new session.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 4th August 2011, 19:34
pebkac pebkac is offline
Senior Member
 
Join Date: Feb 2009
Posts: 132
Thanks: 2
Thanked 7 Times in 7 Posts
Default

Ok, I did that and redownloded the file and it does download and is the correct size but it will not display, windows picture viewer thinks it is damaged and wont display it.
Reply With Quote
  #8  
Old 4th August 2011, 19:40
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,488
Thanks: 813
Thanked 5,259 Times in 4,123 Posts
 
Default

And you are sure that the file is correct? Please upload a different file yourself to the system. Check the file in picture viewer before you uploaded it and then download it, safe it to disk (dont open it directly) and then try to open the saved file again.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Client TAB Causes ISPConfig to Crash briand0713 General 8 11th May 2011 08:57
A lot of errors after instalation adam_clayton Installation/Configuration 1 1st February 2011 15:12
Error when install ISPConfig 2 with components built from source X-admin Installation/Configuration 5 30th April 2010 13:22
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20
libWand.so.10 error Taxick Installation/Configuration 8 3rd May 2009 01:27


All times are GMT +2. The time now is 18:20.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.