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-06-16, 05:47:22

Author Topic: php-fpm client defined config solution  (Read 3316 times)

0 Members and 1 Guest are viewing this topic.

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
php-fpm client defined config solution
« on: 2013-07-24, 20:42:40 »
I use php-fpm.  The user defined php config does nothing on thier control panel - which is very unprofessional.

I have been looking for a way to bring this function to php-fpm.

I found it - and mustafa I need a little help.

In /home/phpini we find the template for the php ini file.  Looking through this code I see many variables populated with php settings.

Next we look at:
/home/php-fpm/tpl
php53-fpm-pool.conf.tpl

Inside this file you can write directives that php will change default vaules for:
example:
Code: [Select]
php_admin_flag[display_errors]=On

If we can add use same technique as php ini template we can add:

Code: [Select]
php_admin_flag[display_errors]= <?=$display_error_flag ?>

Adding these to the php-fpm config for that user will make all of his domains at least have his settings.  This is a GOOD work around and very logical.

Mustafa - I have no test environment.  I need to know HOW to populate these variables with the users current php config settings (is there a function?)

Please help with this solution - it is very important.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
Re: php-fpm client defined config solution
« Reply #1 on: 2013-07-26, 22:29:05 »
Mustafa this is a good solution.  I have been messing with the settings.  It is an easy fix.  We simply check if it is default pool and not add settings - for user pool we add that clients settings.

I am currently scouring kloxo code, rewritting a billing solution, and working on a CMS project.  Overworked :)

Just give me a little direction and I will code this solution and send it back.  I simply need to know:

What php file modifies the php settings when clicking PHP settings / Advanced from Kloxo Cpanel.

Where do you build the php-fpm config from (which php file includes custom.php53-fpm....)

Is there a function that reads a users php settings?  If so please advise.

I will make this priority and resend all code changes to you for inspection and inclusion.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline insanity

  • Senior Member
  • *
  • Posts: 215
  • Karma: +0/-0
    • View Profile
Re: php-fpm client defined config solution
« Reply #2 on: 2013-08-02, 15:30:48 »
@chrisf,
I think php-fpm use only one .ini file eg /etc/php.ini

I found a better solution. By default php-fpm can work and with .user.ini in every user directory.
Eg. if some user add .user.ini in /home/user/domain.com the fpm pool for this user will collect information from this .user.ini
I will make some tests these days and i will include this option in Advanced PHP Confing.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
Re: php-fpm client defined config solution
« Reply #3 on: 2013-08-03, 09:32:45 »
This is true - however only for that directory.  Placing it in a top level directory does not effect lower directories.

EVERY user has its own php-fpm pool configuration.  I already have it working.  I do not know how to incorporate it into the kloxo code (I wrote my own custom php to handle it).  But it works great.  I do not have the directory handy, but you will find a php-fpm config file with the user name as part of the file.

My solution is very easy - if I wasn't writing my own hosting solution I could get it working in kloxo - kloxo coding is simple, just not familiar with what class/functions do what.  This takes time.  I have asked for help so I do not have to waste time looking, but no answer.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm client defined config solution
« Reply #4 on: 2013-08-05, 18:44:41 »
It's possible every php-fpm instance use different php.ini.

I have a plan for this features for next version (together with change to primary-secondary-php to multiple-php).
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline chrisf

  • Senior Master
  • **
  • Posts: 883
  • Karma: +11/-1
  • Gender: Male
  • Be the change that you wish to see in the world.
    • View Profile
    • Conviction's Hosting
Re: php-fpm client defined config solution
« Reply #5 on: 2013-08-06, 05:25:39 »
When will this be released?  I am asking because this is needed now.  I do not want to waste any more time if you plan on changing all of the code anyhow.

When would this be available?
« Last Edit: 1970-01-01, 01:00:00 by Guest »
Christopher

Knowledge in: PHP, Perl, MySQL, Javascript, Actionscript, FLASH, HTML, CSS
Server Administrator / Developer: https://convictionshosting.com

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: php-fpm client defined config solution
« Reply #6 on: 2013-08-06, 17:30:58 »
It's not simple to implementing 'multiple php' with 'php-fpm' instance-per-user.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.05 seconds with 22 queries.

web stats analysis