Control Web Panel

WebPanel => PHP => Topic started by: Administrator on October 25, 2014, 08:22:55 PM

Title: php.ini configuration per user
Post by: Administrator on October 25, 2014, 08:22:55 PM
you can make php.ini per user account,  user only needs is to create php.ini file and add values in it.

Location of the php.ini file is
/home/USERNAME/php.ini

How to test php.ini changes?
Simple create phpinfo.php file in the users public_html folder and add the following content in it.

Example location: /home/USERNAME/public_html/phpinfo.php
Code: [Select]
<?php
phpinfo
();
?>


Now open url in your browser (Apache restart is NOT needed):
http://your-domain.com/phpinfo.php



PHP.ini values
http://php.net/manual/en/ini.list.php
Title: Re: php.ini configuration per user
Post by: akmallinux on September 25, 2015, 10:13:46 AM
I change, in /home/username/public_html/php.ini
then i check with php.info, but the configuration not changed? how to fix it?
Title: Re: php.ini configuration per user
Post by: Administrator on September 28, 2015, 05:52:51 AM
have you checked in phpinfo() which php.ini path is loaded ?
Title: Re: php.ini configuration per user
Post by: akmallinux on September 28, 2015, 08:44:26 AM
Yes, the php path in my public html, http://domain.com/info.php, the configuration is loaded in here /home/shinoa/public_html/php.ini, i change upload max filesize , but when i login in wp-admin, i use wordpress, the configuration not change, upload file limit it's not change.
Title: Re: php.ini configuration per user
Post by: Administrator on September 28, 2015, 09:12:39 PM
Yes, the php path in my public html, http://domain.com/info.php, the configuration is loaded in here /home/shinoa/public_html/php.ini, i change upload max filesize , but when i login in wp-admin, i use wordpress, the configuration not change, upload file limit it's not change.

to make this change for wp-admin folder you should add php.ini file in wp-admin folder.
Title: Re: php.ini configuration per user
Post by: akmallinux on September 29, 2015, 03:10:31 AM
Thanks, Work For me ...  ;D
Title: Re: php.ini configuration per user
Post by: monkeyking on December 03, 2018, 07:30:10 AM
to make this change for wp-admin folder you should add php.ini file in wp-admin folder.

This doesn't work in CWPpro version: 0.9.8.742. Is there another method?
Title: Re: php.ini configuration per user
Post by: monkeyking on December 03, 2018, 07:15:56 PM
php.ini doesn't work with php-fpm in CWPpro version: 0.9.8.741 and above. You have to change it.

from
Code: [Select]
php.ini
to
Code: [Select]
.user.ini
Title: Re: php.ini configuration per user
Post by: studio4host on December 03, 2018, 09:45:12 PM
with php-fpm you need to make a file named as ".user.ini"
Title: Re: php.ini configuration per user
Post by: venty on December 31, 2018, 03:15:44 PM
php.ini doesn't work with php-fpm in CWPpro version: 0.9.8.741 and above. You have to change it.

from
Code: [Select]
php.ini
to
Code: [Select]
.user.ini

Is local php.ini  working for a user...?
Title: Re: php.ini configuration per user
Post by: GTMAN on December 31, 2018, 03:45:02 PM
On further research its was an Apache config error which apparently is quite common. Specifically it was a trailing slash error in the domain.ca.conf file.

/usr/local/apache/conf.d/vhosts

Code: [Select]
<IfModule proxy_fcgi_module>
<FilesMatch \.php$>
SetHandler "proxy:unix:/opt/alt/php-fpm73/usr/var/sockets/jet.sock|fcgi://localhost/"
</FilesMatch>


The trailing slash after localhost breaks the recursive search at least for ClassicPress / WordPress.



https://stackoverflow.com/questions/27226055/does-the-user-ini-file-work-for-subdirectories (https://stackoverflow.com/questions/27226055/does-the-user-ini-file-work-for-subdirectories)
Title: Re: php.ini configuration per user
Post by: slimtim on July 25, 2019, 09:44:57 AM
Hello,
I switched from php-cgi to php-fpm and it can't read .user.ini from /home/user but /home/user/public_html only, where is .user.ini public and mixed with another files. Is possible a manual or template config to have .user.ini working from /home/user directory? Thank you.