{"id":742,"date":"2010-05-07T08:38:55","date_gmt":"2010-05-07T12:38:55","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=742"},"modified":"2013-03-20T08:42:48","modified_gmt":"2013-03-20T12:42:48","slug":"how-to-protect-php-ini-with-suphp","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-protect-php-ini-with-suphp","title":{"rendered":"How to protect\/secure php.ini with SuPHP?"},"content":{"rendered":"<p>When Apache is compiled as CGI\/SuPHP, it allows users to create their own php.ini file under their home directory and modify the php values as per their wish.<\/p>\n<p>This may increase security concerns on the server and hence to protect\/secure php.ini in SuPHP enabled servers, force every user to use a common php.ini file.<\/p>\n<p>This can be achieved by defining the path of server side php.ini file using suPHP_ConfigPath directive. To force users to use server side php.ini file, create suphp_configpath.conf<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># pico \/usr\/local\/apache\/conf\/userdata\/suphp_configpath.conf<\/span><\/pre>\n<\/blockquote>\n<p>and add the following lines<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">&lt;IfModule mod_suphp.c&gt;<\/span>\r\n<span style=\"color: #0000ff;\">&lt;Location \/&gt;<\/span>\r\n<span style=\"color: #0000ff;\">suPHP_ConfigPath \/usr\/local\/lib\/<\/span>\r\n<span style=\"color: #0000ff;\">&lt;\/Location&gt;<\/span>\r\n<span style=\"color: #0000ff;\">&lt;\/IfModule&gt;<\/span><\/pre>\n<\/blockquote>\n<p>Once done, save the file and rebuild the Apache configuration so it picks up the changes.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># \/usr\/local\/cpanel\/bin\/apache_conf_distiller --update --main<\/span>\r\n<span style=\"color: #0000ff;\"># \/usr\/local\/cpanel\/bin\/build_apache_conf<\/span><\/pre>\n<\/blockquote>\n<p>To verify the include files, execute:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># \/scripts\/verify_vhost_includes<\/span><\/pre>\n<\/blockquote>\n<p>It will display the path of the .conf file you created. Restart the Apache service once<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># \/scripts\/restartsrv httpd<\/span><\/pre>\n<\/blockquote>\n<p>This will ensure all the users use the server side php configuration file. If you wish to keep the php.ini elsewhere, just change the value of &#8220;suPHP_ConfigPath&#8221; and follow the above steps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When Apache is compiled as CGI\/SuPHP, it allows users to create their own php.ini file under their home directory and modify the php values as per their wish.<br \/>\nThis may increase security concerns on the server and hence to protect\/secure php.ini in SuPHP enabled servers, force every user to use a common php.ini file.<br \/>\nThis can be achieved by defining the path of server side php.ini file using suPHP_ConfigPath directive. To force users to use server side php.ini file, create suphp_configpath.conf<\/p>\n<p># pico \/usr\/local\/apache\/conf\/userdata\/suphp_configpath.conf<\/p>\n<p>and add the following lines<\/p>\n<p>&lt;IfModule mod_suphp.c&gt;<br \/>\n&lt;Location \/&gt;<br \/>\nsuPHP_ConfigPath \/usr\/local\/lib\/<br \/>\n&lt;\/Location&gt;<br \/>\n&lt;\/IfModule&gt;<\/p>\n<p>Once [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[837,834,833,832,836,835],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/742"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=742"}],"version-history":[{"count":8,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/742\/revisions"}],"predecessor-version":[{"id":745,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/742\/revisions\/745"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}