How to Set Individual/Per-Domain php.ini Configurations

Share this post...Tweet about this on TwitterShare on Google+0Share on Facebook0
SuPHP can use a per user php.ini file. This file must be located at /home/[unixuser]/etc/php.ini.

 

Set Up:

    1. Under the /home/[unixuser] directory for the domain, create a directory named etc:

[root@jenna1 ~]# cd /home/iwtestco/
[root@jenna1 iwtestco]# mkdir etc

    2. Set  user and group permissions for the new etc directory to the unix user:

[root@jenna1 iwtestco]# chown iwtestco:iwtestco etc/

    3. Copy the default php.ini from /etc/php.ini to the new /home/[unixuser]/etc directory:

[root@jenna1 iwtestco]# cp /etc/php.ini /home/iwtestco/etc/php.ini

    4. Set user and group permissions for /home/[unixuser]/etc/php.ini to the unixuser:

[root@jenna1 etc]# chown iwtestco:iwtestco php.ini

If an .htaccess file already exists, skip to Step 7. If not, continue to Step 5.
    5. Create an .htaccess file for the domain under /home/[unixuser]/[domain]/html

[root@jenna1 etc]# vim /home/iwtestco/iwtest.com/html/.htaccess

    6. Set user and group permissions for the .htaccess file to the unix user:

[root@jenna1 etc]# chown iwtestco:iwtestco /home/iwtestco/iwtest.com/html/.htaccess

    7. Using the text editor, add the following to the .htaccess file*:
suPHP_ConfigPath /home/<unix_user>
<Files etc/php.ini>
order allow,deny
deny from all
</Files>

 

*Customers using CentOS 7 may need us replace the above path in the .htaccess file with the following:

suPHP_ConfigPath /home/[unixuser]/etc/

Feb 14, 2018, 12:13 pmBy: InterWorx
How to Set Individual/Per-Domain php.ini Configurations
0 votes, 0.00 avg. rating (0% score)
(0) Comments

Leave a Reply
Surround code blocks with <pre>code</pre>

Your email address will not be published.

Comments

Broken Link