nBill Community nBill Home Page
18/May/2012, 10:17:39 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for the nBill home page, or take a tour.  
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: PDF generation not working in both Admin and Frontend  (Read 3533 times)
kentheteaman
Jr. Member
**
Offline Offline

Posts: 39


View Profile
« on: 23/March/2009, 03:14:08 PM »

I copied the pdf instalation as instructed to pdfwriter folder -administrator/components/com_netinvoice/pdfwriter/

The pdf buttons show up on both front and admin side.
However when clicked I get this error message - Cannot retrieve https://s-oaks.co.uk/components/com_netinvoice/images/vendors/1.gif

I found that the image/vendors folder did not exist.
So created one and uploaded the 1.gif folder and changed the folder permission to 755.

But still getting the same error on admin side.

On front end I get this -

Cannot retrieve https://s-oaks.co.uk/components/com_netinvoice/images/vendors/1.gif
Warning: fopen(/usr/share/webapps/joomla/1.5.9/htdocs/administrator/components/com_netinvoice/pdfwriter/cache/79d56a5716ae0e08abe97c57ba9f69dc) [function.fopen]: failed to open stream: Permission denied in /usr/share/webapps/joomla/1.5.9/htdocs/administrator/components/com_netinvoice/pdfwriter/image.class.php on line 86

Warning: fclose(): supplied argument is not a valid stream resource in /usr/share/webapps/joomla/1.5.9/htdocs/administrator/components/com_netinvoice/pdfwriter/image.class.php on line 88


I do not want to use the pdf in frontend.
But I need it in the Admin side.

Can some one help please.

thank you,

ken
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,557


View Profile
« Reply #1 on: 23/March/2009, 04:25:03 PM »

If the images/vendors folder did not exist, it suggests a problem installing nBill, as a default vendor logo is supplied with the component. You should upload your own vendor logo using the vendor editor in nBill administrator. The permissions required depend on your server configuration and how you uploaded the logo. If you don't have suPHP, and you uploaded the logo by FTP, you might need to set the permissions to 777.
Logged
kentheteaman
Jr. Member
**
Offline Offline

Posts: 39


View Profile
« Reply #2 on: 24/March/2009, 01:34:01 AM »

Thank you for the reply.

I changed the folder permission for images and vendors to 777.
Still getting the same error for pdf preview generation

html preview is fine.
It generates the invoice with my logo on it.

regards,
ken
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,557


View Profile
« Reply #3 on: 24/March/2009, 09:58:16 AM »

You also need to make sure both the /cache/ and /out/ folders are writable.
Logged
kentheteaman
Jr. Member
**
Offline Offline

Posts: 39


View Profile
« Reply #4 on: 24/March/2009, 01:07:12 PM »

Hello netshine,

Thank you for the reply.

I looked for both cache and out folders.
Found 2 cache folders as below and made them 777.

/usr/share/webapps/joomla/1.5.9/htdocs/administrator/cache         (htdocs is my root)

/usr/share/webapps/joomla/1.5.9/htdocs/cache

But not fine the 'out' folder.

However, I still get the same error -
Cannot retrieve https://s-oaks.co.uk/components/com_netinvoice/images/vendors/1.gif
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,557


View Profile
« Reply #5 on: 24/March/2009, 05:32:23 PM »

I meant within the pdfwriter folder.

Eg. it will either be:

/usr/share/webapps/joomla/1.5.9/htdocs/administrator/components/com_netinvoice/pdfwriter/cache
/usr/share/webapps/joomla/1.5.9/htdocs/administrator/components/com_netinvoice/pdfwriter/out

or

/usr/share/webapps/joomla/1.5.9/htdocs/components/com_netinvoice/pdfwriter/cache
/usr/share/webapps/joomla/1.5.9/htdocs/components/com_netinvoice/pdfwriter/out

...depending on where you put the pdfwriter folder.
Logged
kentheteaman
Jr. Member
**
Offline Offline

Posts: 39


View Profile
« Reply #6 on: 24/March/2009, 06:31:01 PM »

Hello,

Did that.

Changed the permission to 777 in cache and out folders.

Still not working.
Same error appears.
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,557


View Profile
« Reply #7 on: 25/March/2009, 09:32:16 AM »

Ok, please raise a support ticket so I can access your site myself and take a look. I cannot guarantee to be able to fix it though, as it involves your server configuration and a 3rd party script (html2ps/pdf).
Logged
greache
Jr. Member
**
Offline Offline

Posts: 9


View Profile
« Reply #8 on: 03/September/2010, 11:07:05 AM »

The permission changes worked for me ... thanks netshine Smiley

Greache
Logged
greache
Jr. Member
**
Offline Offline

Posts: 9


View Profile
« Reply #9 on: 21/October/2010, 07:47:55 AM »

Just a question ... does having these pdf folders @ 777 leave me vulnerable to hacking? Can I have them @ 755 or something?
Logged
netshine
Administrator
Hero Member
*****
Offline Offline

Posts: 4,557


View Profile
« Reply #10 on: 21/October/2010, 08:34:39 AM »

Files and folders are not automatically insecure just because they have 777 permissions - a hacker would still need some way of getting to your files, such as access to a script already on the server which can write to those locations. There are 2 ways of keeping things secure:

1) Use suPHP. This is the option I have taken on my own servers - it causes PHP to run under the account username, so PHP can write to files and folders with more restrictive permissions. In my experience, this causes fewer headaches, as you don't have to change any file or folder permissions (and in fact if you do set permissions to 777, it causes a server error so you are not caught out accidentally).

2) Use an open_basedir restriction. With this option, PHP runs under a global username (such as 'nobody'), but cannot write to any of your folders or files unless you set the permissions to writable. The basedir restriction prevents scripts in the accounts of other users on the same server from modifying your files (so if a neighbouring website gets hacked, they still can't get to your files).

If the PDF generator did not work without setting permissions to 777, you do not have suPHP. You therefore need to make sure that your hosting company has put an open_basedir in effect.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!