Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-29, 11:46:12

Author Topic: Access denied for PHP files  (Read 7799 times)

0 Members and 1 Guest are viewing this topic.

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Access denied for PHP files
« on: 2014-03-29, 18:07:43 »
Using the latest update, i'm finally able to start PHP-FPM which config was filled with XML content earlier. But now i can't serve PHP pages:
[Sat Mar 29 18:01:12 2014] [error] [client 192.168.2.150] FastCGI: server "/home/user1/test101.myftp.org/test101.myftp.org.0fake" stderr: Access to the script '/home/user1/test101.myftp.org/index.php/apps/files' has been denied (see security.limit_extensions), referer: http://test101.myftp.org/

Any idea how i can fix it?


[root@kloxo ]# sh /script/sysinfo

A. Kloxo-MR: 6.5.1.b-2014032502

B. OS: CentOS release 6.5 (Final) x86_64

C. Apps:
   1. MySQL: mysql-5.5.34-1.el6.x86_64
   2. PHP: php55u-5.5.10-1.ius.el6.x86_64
   3. Httpd: httpd-2.2.26-2.el6.x86_64
   4. Lighttpd: --uninstalled--
   5. Hiawatha: hiawatha-9.3.1-1.mr.el6.x86_64
   6. Nginx: --uninstalled--
   7. Cache: --uninstalled--
   8. Dns: bind-9.9.5-1.el6.x86_64
   9. Qmail: qmail-toaster-1.03-1.3.38.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.16.mr.el6.x86_64

D. Php-type (for Httpd/proxy): php-fpm_event

E. Memory:
                total       used       free     shared    buffers     cached
   Mem:          1877        858       1018          0        161        389
   -/+ buffers/cache:        308       1568
   Swap:         3775          0       3775
Kloxo-MR!

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Access denied for PHP files
« Reply #1 on: 2014-03-29, 18:48:50 »
Find out 'cgi.fix_pathinfo = 0' in /etc/php.ini. By default, value is '1' but for security reason this value set to '0'.

In /home/nginx/conf/globals/php-fpm.conf, disable 'fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;' (use 'customize rule' for change/modified config file).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Re: Access denied for PHP files
« Reply #2 on: 2014-03-29, 22:56:58 »
Yes, cgi.fix_pathinfo = 0 inside /etc/php.ini. Now trying to customize the FPM file by having a custom.php53-fpm-pool.conf.tpl inside
/home/php-fpm/tpl and running sh /scripts/fixweb + service php-fpm restart does not change /etc/php-fpm.d/$pool.conf.

How do i customize one specific FPM pool file, e.g /etc/php-fpm.d/user1.conf?


 I don't use Nginx, but Hiawatha proxy :)

 

Find out 'cgi.fix_pathinfo = 0' in /etc/php.ini. By default, value is '1' but for security reason this value set to '0'.

In /home/nginx/conf/globals/php-fpm.conf, disable 'fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;' (use 'customize rule' for change/modified config file).
Kloxo-MR!

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Access denied for PHP files
« Reply #3 on: 2014-03-30, 16:29:00 »
This '/home/user/test.myftp.org/test.myftp.org.0fake' is correct when using php-fpm_worker/_event.

As you can see, this forum using latest 6.5.1.b and nothing problem with php-fpm.

In many situation, nothing problem with 'cgi.fix_pathinfo=0'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Re: Access denied for PHP files
« Reply #4 on: 2014-03-30, 17:16:12 »
Hmm ok.
First of all, after using 2 hours i found a minor issue which is fixed in https://github.com/mustafaramadhan/kloxo/pull/3.
I don't know your policy, but if you merge it, that issue will be fixed.
Secondly, i think you are right that PHP apps are mostly fine with 'cgi.fix_pathinfo=0', but OwnCloud doesn't work it :(

But i can survive by having custom FPM pools, but can you please inform me why the file isn't read when i have a custom.php53-fpm-pool.conf.tpl inside /home/php-fpm/tpl?
Is it possible to have custom rules per FPM pool? E.g one custom conf for /etc/php-fpm.d/user1.conf and another custom conf for  /etc/php-fpm.d/user2.conf .
Kloxo-MR!

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Access denied for PHP files
« Reply #5 on: 2014-03-30, 18:33:01 »
Custom file work.

I didn't found any issue to implementing custom file for php-fpm. Only need custom.php53-fpm-pool.conf.tpl for handle all users.

Before latest update of KLoxo-MR 6.5.1 I was using custom file for different allocate of max_children. In latest version, you can set in panel under 'limit' or 'resource plans' for 'Number Of FastCGI Children'. Choose 'Unlimited' will be intrepretate as '6'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Re: Access denied for PHP files
« Reply #6 on: 2014-03-31, 14:02:06 »
I got it working after running sh /scripts/fix-all.
Oh it's great that we can set this in resource plans!
Thank you very much for you help.
Kloxo-MR!

 


Top 10 Social Networking:    Facebook    Twitter    LinkedIn    Pinterest    Google Plus    Tumblr    Instagram    VK    Flickr    Vine

Page created in 0.034 seconds with 21 queries.

web stats analysis