Cannot set PHP .user.ini per user

Discussion in 'Programming/Scripts' started by MaxT, Apr 15, 2016.

  1. MaxT

    MaxT Member HowtoForge Supporter

    I'm with FCGI and I'm not able to configure php to load .user.ini per user. And I don't find any tutorial for ISPC.

    Somebody knows some guide?

    I have inside /etc/php5/cgi/php.ini:
    user_ini.filename = ".user.ini"
    user_ini.cache_ttl = 300
    then I create a .user.ini file inside /var/ with:
    error_reporting = E_ALL
    display_errors = On
    display_startup_errors = On
    and then I restart apache.
    However, when executing phpinfo() still is loading the /etc/php5/cgi/php.ini

    Where is the error?. Logs don't show me nothing :(
  2. MaxT

    MaxT Member HowtoForge Supporter

  3. till

    till Super Moderator Staff Member ISPConfig Developer

    There is a field named custom php.ini on the options tab of the website in ispconfig where you can add the website specific php options. Per ini files in a web dir are really dangerous as a hacker that hacks your website or a client that dont likes you can extend his privileges with that file.
  4. MaxT

    MaxT Member HowtoForge Supporter

    ok, thanks for answering.

    Therefore, if I want to avoid that risk, there is no way to specify a php.ini per user. All users should be under the same directive s of /etc/php5/cli/php.ini .
    That's right?

    I have read one message from yours, in where you explained that there is an option to place a php.ini per user inside the /var/www/conf/webX/:

    Is this information outdated and only related to ISPC2 ?

    I come from Cpanel, in where it was possible creating a wrapper script and a /cgi-bin folder in every website. Like this:

    I see with ISPC the wrappers are inside /var/www/php-fcgi-scripts/webX/.php-fcgi-starter but I don't want to change nothing to avoid future errors with the ISPC config.

    So.. Is not there a secure way to have a php.ini per user?
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    No. As I posted above, ispconfig has a custom php.ini field where you can set website specific php.ini settings in a safe way.

    That's outdated and not related to ispconfig 3 in any way. In ispconfig 3 you can directly set php values in the custom php.ini field of the website. ispconfig 2 and 3 have nothing in common, so when a infor has been psted for ispconfig 2 then this never applies to ispconfig 3 as these two software packages share nothing in their system setup or code.

    CPanel makes this really complicated indeed and that's why you probably think that it has to be so complicated in ISPConfig as well, but indeed, it is absolutely easy in ispconfig as there is already an input field, al you have to do is to enter your desired php settings there (options tab of the website) and click save. ispconfig then does all the magic with a custom php.ini for that site and custom warpper script automatically. No need to edit any files manually.

    Sure, its absolutely easy and I explained it several times in my two last posts here. Just enter the desired php.ini value for this website in the php.ini field in the interface on the optins tab of the site and press save.
    Last edited: Apr 19, 2016
    MaxT likes this.
  6. MaxT

    MaxT Member HowtoForge Supporter I understand. Thank you for the explanation.

    Sorry. Truly I though it was more complicated. And I did not want to change any thing in the configuration neither I had found a clear explanation.

    thanks again!

Share This Page