{"id":3060,"date":"2019-02-01T12:54:25","date_gmt":"2019-02-01T12:54:25","guid":{"rendered":"http:\/\/www.softaculous.com\/blog\/?post_type=docs&#038;p=3060"},"modified":"2019-02-01T12:54:26","modified_gmt":"2019-02-01T12:54:26","slug":"detect-php-version-on-cagefs","status":"publish","type":"docs","link":"https:\/\/www.softaculous.com\/blog\/docs\/admin\/softaculous-management\/detect-php-version-on-cagefs\/","title":{"rendered":"Detect PHP Version on CageFS"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Overview<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This guide will help you to configure a hook to detect the correct PHP version and change PHP version for the user on CloudLinux with CageFS enabled. This task can be done easily by configuring a pre_install and pre_upgrade hook.<br><\/p>\n\n\n\n<p class=\"alert alert-info wp-block-paragraph\"><strong>Note<\/strong>\u00a0: This guide assumes that CageFS is enabled for the user.<br><strong>Note<\/strong>\u00a0: This hook will change the PHP version for all the directories of the user.<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You just need to rename the pre_install_cagefs.txt and pre_upgrade_cagefs.txt to pre_install_cagefs.php and pre_upgrade_cagefs.php respectively.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For&nbsp;<strong>cPanel<\/strong>&nbsp;SSH to your server as root and enter following commands&nbsp;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted bash hljs\">Root&gt; cp \/usr\/local\/cpanel\/whostmgr\/docroot\/cgi\/softaculous\/enduser\/hooks\/pre_install_cagefs.txt \/usr\/local\/cpanel\/whostmgr\/docroot\/cgi\/softaculous\/enduser\/hooks\/pre_install_cagefs.php<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted bash hljs\">Root&gt; cp \/usr\/local\/cpanel\/whostmgr\/docroot\/cgi\/softaculous\/enduser\/hooks\/pre_upgrade_cagefs.txt \/usr\/local\/cpanel\/whostmgr\/docroot\/cgi\/softaculous\/enduser\/hooks\/pre_upgrade_cagefs.php<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><br>For&nbsp;<strong>Direct Admin<\/strong>&nbsp;SSH to your server as root and enter following commands&nbsp;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted bash hljs\">Root&gt; cp \/usr\/local\/directadmin\/plugins\/softaculous\/enduser\/hooks\/pre_install_cagefs.txt \/usr\/local\/directadmin\/plugins\/softaculous\/enduser\/hooks\/pre_install_cagefs.php<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted bash hljs\">Root&gt; cp \/usr\/local\/directadmin\/plugins\/softaculous\/enduser\/hooks\/pre_upgrade_cagefs.txt \/usr\/local\/directadmin\/plugins\/softaculous\/enduser\/hooks\/pre_upgrade_cagefs.php<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><br>For&nbsp;<strong>Plesk, ISPManager, ISPConfig, InterWorx, H-Sphere, CentOS Web Panel<\/strong>&nbsp;SSH to your server as root and enter following commands&nbsp;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted bash hljs\">Root&gt; cp \/usr\/local\/softaculous\/enduser\/hooks\/pre_install_cagefs.txt \/usr\/local\/softaculous\/enduser\/hooks\/pre_install_cagefs.php<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted bash hljs\">Root&gt; cp \/usr\/local\/softaculous\/enduser\/hooks\/pre_upgrade_cagefs.txt \/usr\/local\/softaculous\/enduser\/hooks\/pre_upgrade_cagefs.php<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>That&#8217;s it!<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Softaculous will now detect the correct PHP version for the CageFS user.<\/p>\n","protected":false},"featured_media":0,"parent":1671,"menu_order":19,"comment_status":"closed","ping_status":"closed","template":"","docs_category":[],"class_list":["post-3060","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/3060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/comments?post=3060"}],"version-history":[{"count":1,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/3060\/revisions"}],"predecessor-version":[{"id":3061,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/3060\/revisions\/3061"}],"up":[{"embeddable":true,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs\/1671"}],"wp:attachment":[{"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/media?parent=3060"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/www.softaculous.com\/blog\/wp-json\/wp\/v2\/docs_category?post=3060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}