0

my tests with tcpfd run well as long as in terminal mode. (see 1. and 2.). they don't when browser calls the same file via http (3.): why?

  1. local apache2 lists the file with appropriate rights:

tcPDFv6213 # ls -l include/tcpdf_font_data.php -rw-r--r-- 1 root root 313432 Dez 2 2016 include/tcpdf_font_data.php

  1. starting rechnung.php via php provides the demanded rech.pdf correctly

tcPDFv6213 # php rechnung.php >rech.pdf (what is not under focus here)

  1. unfortunately the same will not provided if invoked via http:

http://localhost/html/platzhalter.One/tcPDFv6213/rechnung.php

the call provides me with "warning" and "fatal error".

Warning: require_once(/var/www/html/platzhalter.One/tcPDFv6213/include/tcpdf_font_data.php): failed to open stream: Permission denied in /var/www/html/platzhalter.One/tcPDFv6213/tcpdf.php on line 113

Fatal error: require_once(): Failed opening required '/var/www/html/platzhalter.One/tcPDFv6213/include/tcpdf_font_data.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/platzhalter.One/tcPDFv6213/tcpdf.php on line 113

  1. i tried to chmod root:root to www-data:www-data and v.v. then i tried to chmod rights for other to 6 and finally to 7. all that without any success - the error throwed remains the same ..

my system is linux (ubuntu) and mostly running well


edit: after chmod folder include to 755 (see comments, thans martin) the response to http://localhost/html/platzhalter.One/tcPDFv6213/rechnung.php changes from fatal error to warnings (concerning image related functions).

The issue reported here in my question has been solved. thank you, martin.

marita
  • 1
  • 5
  • Since the error indicates a permission issue, it could be that only the root user has access. Try to check the apache process owner. To check this, try to use this `` the owner should be `nobody`. – Martin Jun 06 '18 at 09:35
  • thank you, martin. i just added that who.php there with include # ls -l -rw-r--r-- 1 root root 313432 Dez 2 2016 tcpdf_font_data.php -rw-r--r-- 1 root root 32 Jun 6 12:06 who.php now: http://localhost/html/platzhalter.One/tcPDFv6213/include/who.php Forbidden You don't have permission to access /html/platzhalter.One/tcPDFv6213/include/who.php on this server. Apache/2.4.7 (Ubuntu) Server at localhost Port 80 (maybe too hot here today ..) – marita Jun 06 '18 at 10:19
  • Try and refer to: https://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server – Martin Jun 06 '18 at 10:23
  • thank you, martin, i just transfered who.php into another folder where it ran without problems. so my interest was guided to the rights of the folder under inspection (include) which i had to chmod from 744 to 755. after that who.php runs fine with result "www-data" - as could be expected in local conditions. as reported in my question (4.) i just tried the script with root:root and www-data:www-data. do you have, please, an idea? – marita Jun 06 '18 at 10:50
  • Hmm, what I provided was my initial ideas and input, if the problem still persists, I'd have to look into it more in depth, which I can't do as of right now I'm afraid. – Martin Jun 06 '18 at 10:58

0 Answers0