{"id":37042,"date":"2020-04-02T19:56:56","date_gmt":"2020-04-02T16:56:56","guid":{"rendered":"https:\/\/tuthost.ua\/faq\/how-to-install-the-right-version-of-php-for-a-particular-directory-or-domain\/"},"modified":"2024-07-19T22:06:28","modified_gmt":"2024-07-19T19:06:28","slug":"kak-ustanovit-versiyu-php-dlya-direktorii-ili-domena","status":"publish","type":"ht_kb","link":"https:\/\/tuthost.ua\/en\/faq\/kak-ustanovit-versiyu-php-dlya-direktorii-ili-domena\/","title":{"rendered":"How to install the right version of PHP for a particular directory or domain."},"content":{"rendered":"\n<p>To do this in the domain directory, for example:<br\/>domains\/domain_name\/public_html<br\/>create a .htaccess file with this content:<\/p>\n\n<p><strong>&lt;FilesMatch &#8220;.(php4|php5|php3|php2|php|phtml)$&#8221;&gt;<\/strong><br\/><strong>SetHandler application\/x-lsphp71<\/strong><br\/><strong>&lt;\/FilesMatch&gt;<\/strong><\/p>\n\n<p>If your site is on a server with Litespeed, you need to add another line:<\/p>\n\n<p><strong>AddType application\/x-lsphp52 .php5 .php4 .php .php3 .php2 .phtml<\/strong><\/p>\n\n<p>Where x-lsphp71 indicates the desired version. For PHP 5.2 specify x-lsphp52 and so on for other versions. Versions from 5.2 to 7.4 are available for selection<\/p>\n\n<p>The list of available modules is comparable with those that are selected by default for the required version of PHP in the hosting control panel DirectAdmin, section Select PHP Version.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To do this in the domain directory, for example:domains\/domain_name\/public_htmlcreate a .htaccess file with this content: &lt;FilesMatch &#8220;.(php4|php5|php3|php2|php|phtml)$&#8221;&gt;SetHandler application\/x-lsphp71&lt;\/FilesMatch&gt; If your site is on a server with Litespeed, you need to add another line: AddType application\/x-lsphp52 .php5 .php4 .php .php3 .php2 .phtml Where x-lsphp71 indicates the desired version. For PHP 5.2 specify x-lsphp52 and so on&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","ghostkit_customizer_options":"","ghostkit_custom_css":"","ghostkit_custom_js_head":"","ghostkit_custom_js_foot":"","ghostkit_typography":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"ht-kb-category":[10669],"ht-kb-tag":[],"class_list":["post-37042","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-hosting-en"],"taxonomy_info":{"ht_kb_category":[{"value":10669,"label":"Hosting"}]},"featured_image_src_large":[],"author_info":{"display_name":"Denys Semeniuk","author_link":"https:\/\/tuthost.ua\/en\/author\/semden\/"},"comment_info":0,"_links":{"self":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/37042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/comments?post=37042"}],"version-history":[{"count":2,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/37042\/revisions"}],"predecessor-version":[{"id":49034,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb\/37042\/revisions\/49034"}],"wp:attachment":[{"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/media?parent=37042"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb-category?post=37042"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/tuthost.ua\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=37042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}