{"id":9205,"date":"2023-12-28T16:20:43","date_gmt":"2023-12-28T16:20:43","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=ht_kb&#038;p=9205"},"modified":"2024-09-23T11:28:51","modified_gmt":"2024-09-23T11:28:51","password":"","slug":"php-build-failed-cwp","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/","title":{"rendered":"How to Resolve &#8220;PHP Build Failed&#8221; on CWP"},"content":{"rendered":"\n<p>You are switching from one PHP version to another, and the build cannot be completed successfully.<\/p>\n\n\n\n<p>This guide will look into the primary causes of these errors and how to solve them.<\/p>\n\n\n\n<p><strong>Low on RAM<\/strong><\/p>\n\n\n\n<p>1.5 GB of RAM is required when compiling PHP, especially PHP 7.x.x and PHP 8.x.x. You can check the RAM available by running this command in your VPS (or CWP) terminal:<\/p>\n\n\n\n<p><code>free -h<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"864\" height=\"84\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16.png\" alt=\"\" class=\"wp-image-9206\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16.png 864w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16-300x29.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16-768x75.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16-50x5.png 50w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16-600x58.png 600w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16-320x31.png 320w\" sizes=\"auto, (max-width: 864px) 100vw, 864px\" \/><figcaption class=\"wp-element-caption\">Here, the available Mem (RAM) is 1.1 GB, which is low. This can cause PHP compilation to fail.<\/figcaption><\/figure>\n\n\n\n<p>The recommended swap memory is 2 GB, to prevent Out Of Memory incidences.<\/p>\n\n\n\n<p><strong>Outdated OS<\/strong><\/p>\n\n\n\n<p>There are OS that have reached End Of Life (EOL). CentOs 6 and 8 are in this period.<\/p>\n\n\n\n<p>Many repositories are disabled in such OS and you may experience the non-availability of packages and dependencies required to build the PHP.<\/p>\n\n\n\n<p>Kindly ensure you are using any of the following OS:<\/p>\n\n\n\n<p><br><strong>Centos 8 stream<\/strong><br><strong>AlmaLinux\u00a08<\/strong><br><strong>Rocky Linux\u00a08<\/strong><br><strong>Oracle Linux 7 and 8<\/strong><\/p>\n\n\n\n<p><strong>Resolver Issue<\/strong><\/p>\n\n\n\n<p>The resolver may not be set correctly, and the packages cannot be downloaded due to misconfiguration.<\/p>\n\n\n\n<p>Edit the <strong>\/etc\/resolv.conf<\/strong> file<\/p>\n\n\n\n<p><code>nano \/etc\/resolv.conf<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<p>and add the following line:<\/p>\n\n\n\n<p><code>nameserver 1.1.1.1<br>nameserver 8.8.8.8<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><div class=\"open_grepper_editor\" title=\"Edit &amp; Save To Grepper\"><\/div><\/pre>\n\n\n\n<p>Then reboot server<\/p>\n\n\n\n<p><code>reboot<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><\/code><\/pre>\n\n\n\n<p>Ensure to check logs to get a detailed reason for the build errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You are switching from one PHP version to another, and the build cannot be completed successfully. This guide will look into the primary causes of these errors and how to solve them. Low on RAM 1.5 GB of RAM is required when compiling PHP, especially PHP 7.x.x and PHP 8.x.x. You can check the RAM [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[2120],"doc_tag":[],"class_list":["post-9205","docs","type-docs","status-publish","hentry","doc_category-cwp-panel"],"year_month":"2026-06","word_count":207,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Ian M","author_nicename":"ian","author_url":"https:\/\/truehost.com\/support\/author\/ian\/"},"doc_category_info":[{"term_name":"CWP Panel","term_url":"https:\/\/truehost.com\/support\/docs-category\/cwp-panel\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Resolve &quot;PHP Build Failed&quot; on CWP -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Resolve &quot;PHP Build Failed&quot; on CWP -\" \/>\n<meta property=\"og:description\" content=\"You are switching from one PHP version to another, and the build cannot be completed successfully. This guide will look into the primary causes of these errors and how to solve them. Low on RAM 1.5 GB of RAM is required when compiling PHP, especially PHP 7.x.x and PHP 8.x.x. You can check the RAM [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-23T11:28:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/\",\"url\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/\",\"name\":\"How to Resolve \\\"PHP Build Failed\\\" on CWP -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-16.png\",\"datePublished\":\"2023-12-28T16:20:43+00:00\",\"dateModified\":\"2024-09-23T11:28:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-16.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2023\\\/12\\\/image-16.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.truehost.com\\\/support\\\/knowledge-base\\\/php-build-failed-cwp\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Resolve &#8220;PHP Build Failed&#8221; on CWP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Resolve \"PHP Build Failed\" on CWP -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/","og_locale":"en_US","og_type":"article","og_title":"How to Resolve \"PHP Build Failed\" on CWP -","og_description":"You are switching from one PHP version to another, and the build cannot be completed successfully. This guide will look into the primary causes of these errors and how to solve them. Low on RAM 1.5 GB of RAM is required when compiling PHP, especially PHP 7.x.x and PHP 8.x.x. You can check the RAM [&hellip;]","og_url":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/","article_modified_time":"2024-09-23T11:28:51+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/","url":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/","name":"How to Resolve \"PHP Build Failed\" on CWP -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/#primaryimage"},"image":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16.png","datePublished":"2023-12-28T16:20:43+00:00","dateModified":"2024-09-23T11:28:51+00:00","breadcrumb":{"@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2023\/12\/image-16.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.truehost.com\/support\/knowledge-base\/php-build-failed-cwp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Resolve &#8220;PHP Build Failed&#8221; on CWP"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/9205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=9205"}],"version-history":[{"count":4,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/9205\/revisions"}],"predecessor-version":[{"id":14069,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/9205\/revisions\/14069"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=9205"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=9205"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=9205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}