PDF not working

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
parseljc
Posts: 11
Joined: Fri Jul 07, 2006 7:25 pm

PDF not working

Post by parseljc »

When I first installed phpMyFAQ, the PDF function worked great. I still have a few PDF's sitting around in my .../pdf directory.

I have upgraded to version 1.6.6. I have actually upgraded 2 or 3 times, and I don't know when this stopped working, but now when I try to view an article as PDF, the browser says:
FPDF error: Unable to create output file: pdf/2.pdf
and the /var/log/httpd/error_log says:
[client 10.48.128.146] PHP Warning: fopen(pdf/2.pdf): failed to open stream: Permission denied in /var/www/html/faq/inc/fpdf.php on line 1046, referer: http://eng2/faq/index.php?action=artike ... artlang=en
Permissions are 777 on the .../pdf folder and the disk is nowhere near full. Any ideas why this would be broken? What should I check?
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Re: PDF not working

Post by matteo »

Hi,
parseljc wrote:Permissions are 777 on the .../pdf folder and the disk is nowhere near full. Any ideas why this would be broken? What should I check?
double check the permissions: that line is asking a write permission on the file so basically you need to check:
  1. the pdf/ folder need the write permission for the WebServer user;
  2. IF the 2.pdf file already exist, please check that it has the write permission: you could also safely delete every PDF in that folder instead of changing their permissions.
Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
parseljc
Posts: 11
Joined: Fri Jul 07, 2006 7:25 pm

Post by parseljc »

Permissions are 777 on the folder itself. I tried it without a 2.pdf file in the directory and then I did a touch 2.pdf in the folder and made the file 777. Same error either way.

Okay, I fixed it. I have a group called www which was the group on this folder. Somehow, apache was not a member of the group. After adding apache to the group, and deleting the existing PDF's, now the PDF's get created and they are owned by apache apache.


I feel like this is not the first time I've added apache to the www group to fix a problem. No one else administers this server but me. :?
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
parseljc wrote:I feel like this is not the first time I've added apache to the www group to fix a problem. No one else administers this server but me. :?
it is possible that something runs at night and adjust your users/groups settings according to a given policy.

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
parseljc
Posts: 11
Joined: Fri Jul 07, 2006 7:25 pm

Post by parseljc »

matteo wrote:Hi,
parseljc wrote:I feel like this is not the first time I've added apache to the www group to fix a problem. No one else administers this server but me. :?
it is possible that something runs at night and adjust your users/groups settings according to a given policy.

Ciao,
Matteo
That would surprise me. It's a RHEL 4 box in an almost entirely Windows world here.
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
parseljc wrote:That would surprise me. It's a RHEL 4 box in an almost entirely Windows world here.
I mean: check out any cron entry running on your server. Maybe an RPM taken from somewhere (I cannot recall anything from the net, at the moment) runs nightly and changes groups membership to be that given with the original RPMs setup: mine is just an idea to find out how can the apache user be moved away from the www group ;).

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Post Reply