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-04-26, 15:28:09

Author Topic: Different php.ini for domains  (Read 10185 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
Different php.ini for domains
« on: 2013-06-15, 22:50:30 »
I have been trying for two days to get domain specific php.ini files to work in kloxo-mr.

I am using kloxo-mr 6.5.0-f apache, php 5.4, php-fpm event.

.htaccess rules for php_value do not work (not kloxo fault, php fault) but there is supposed to be a way to use user.ini files but not work yet.

please advise a solution for me to change php.ini settings by domain without using suphp.  I don't need secure environment as I am only user on my vps. (3 domains)

thank you kindly
Chris
« 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: Different php.ini for domains
« Reply #1 on: 2013-06-15, 22:58:35 »
Php_value only work in .htaccess when using mod_php. Php-fpm use /etc/php.ini.

You can modified /home/custom.php53-fpm-pool.conf (copy from php53-fpm-pool.conf) php_value per-user base (not domain-base).
« 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: Different php.ini for domains
« Reply #2 on: 2013-06-15, 23:12:05 »
I just found easy work around.  Wanted to share in case another kloxo user has this problem.

http://us3.php.net/manual/en/ini.sections.php

I simply add
[HOST=mydomain1.com]
php values here (on / off)

[HOST=mydomain2.com]
php values here (on / off)

This is done in the /etc/php.ini file.  I would consider having kloxo-mr do this automatically and update this way for php 5.3+ for each domain that changes php settings in control panel, remove updating individiual php.ini and .htaccess rules.??? what you think?

This works for fastcgi php methods.
« 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: Different php.ini for domains
« Reply #3 on: 2013-06-16, 00:45:58 »
I have been playing with [HOST=] ini directive for a few hours.

Interesting behaviour of this directive.

If you set HOST=example.com and access the site as www.example.com it will NOT use your php directivies.

If you set HOST=www.example.com and access the site as example.com it will NOT use your php directives.

Tried wildcards *.example.com and *example.com but both break it and it works for neither.

Tried comma deliminated list ie: example.com,www.example.com but it breaks as well.

I had to add two host directives for the one domain in order to be sure it is always used:
[HOST=example.com]
memory_limit=128M
[HOST=www.example.com]
memory_limit=128M

That made example.com have a php memory limit of 128 no matter what.  I hate repeating myself - does anyone know a way to combine the two??

Also, the force www. in kloxo has no effect on this. (already tested).
« 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: Different php.ini for domains
« Reply #4 on: 2013-06-16, 01:11:26 »
If /etc/php.ini can handle like 'include /etc/home/phpini/<domain>' it's simple to implementing.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.077 seconds with 22 queries.

web stats analysis