1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Domain specific php.ini files

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by AlanO, Nov 19, 2010.

  1. AlanO

    AlanO Guest

    0
     
    I can't get my server set up to allow individual php.ini for each domain. I've read up on this a fair bit. The problem has come up because I need to ensure that php magic quotes is off for a specific domain but I know that it is needed on another domain - hence the need for a custom php.ini.

    The problem is that my server uses fast CGI everywhere. Reading up the forums suggest changing the cgi_wrapper file from
    #!/bin/sh
    exec /usr/bin/php5-cgi

    to

    #!/bin/sh

    domain=`fgrep -m 1 "$UID" /etc/passwd| awk -F\: '{print $6}' |awk -F"/" '{print $5}'`
    PHPRC=/var/www/vhosts/$domain/conf/php.ini

    [ -f ${PHPRC} ] || PHPRC="/etc/php.ini"

    export PHPRC
    exec /usr/bin/php-cgi -c "$PHPRC"

    I tried this but it crashed the server so I had to back it out.

    Any ideas how I can make it work?

    thanks
     
  2. EduardH

    EduardH Basic Pleskian

    21
     
    Joined:
    Feb 13, 2010
    Messages:
    65
    Likes Received:
    0
    Hello Alan,

    You could use standard PHP module to create individual configuration for specific domains.

    The file conf/vhost.conf or conf/vhost_ssl.conf in (sub)domain directory can be used to add specific PHP settings e.g.:

    php_admin_flag magic_quotes_gpc OnPHP module consumes much less memory than FastCGI.
    You can run virtual hosts as (sub)domain user with Apache module mpm-itk or mod_ruid2.
    PHP module runs PHP code also under specific user in this case.

    See http://forum.parallels.com/showthread.php?t=106297 for details.
     
Loading...