
21st July 2011, 00:51
|
|
Senior Member
|
|
Join Date: Feb 2009
Posts: 126
Thanks: 2
Thanked 5 Times in 5 Posts
|
|
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
|

21st July 2011, 10:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,883
Thanks: 691
Thanked 4,188 Times in 3,205 Posts
|
|
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?
|

4th August 2011, 19:07
|
|
Senior Member
|
|
Join Date: Feb 2009
Posts: 126
Thanks: 2
Thanked 5 Times in 5 Posts
|
|
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
|

4th August 2011, 19:13
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,883
Thanks: 691
Thanked 4,188 Times in 3,205 Posts
|
|
Please post the output of:
ls -la /var/www/clients/client1/web1/web/osticket/attachments/0811/
|

4th August 2011, 19:21
|
|
Senior Member
|
|
Join Date: Feb 2009
Posts: 126
Thanks: 2
Thanked 5 Times in 5 Posts
|
|
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
|
|

4th August 2011, 19:27
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,883
Thanks: 691
Thanked 4,188 Times in 3,205 Posts
|
|
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.
|

4th August 2011, 19:34
|
|
Senior Member
|
|
Join Date: Feb 2009
Posts: 126
Thanks: 2
Thanked 5 Times in 5 Posts
|
|
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.
|

4th August 2011, 19:40
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,883
Thanks: 691
Thanked 4,188 Times in 3,205 Posts
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 04:25.
|
Recent comments
2 days 19 hours ago
3 days 4 hours ago
3 days 7 hours ago
3 days 8 hours ago
3 days 9 hours ago
3 days 11 hours ago
3 days 12 hours ago
3 days 14 hours ago
4 days 5 hours ago
4 days 6 hours ago