{"id":911,"date":"2018-03-04T00:08:08","date_gmt":"2018-03-04T00:08:08","guid":{"rendered":"https:\/\/webhostingplus.uk\/hosting\/?p=911"},"modified":"2018-03-04T00:08:08","modified_gmt":"2018-03-04T00:08:08","slug":"correct-file-permissions-php-files","status":"publish","type":"post","link":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/","title":{"rendered":"What are the correct file permissions for a PHP file?"},"content":{"rendered":"<p>As a general rule, the permissions of a PHP file should take one of two sets of values, either 644 or 600. <\/p>\n<p>644 &#8211; A PHP file needs to be world readable if it is to be called via your web browser (meaning it is being processed by Apache). Do not include important passwords or secret keys in world-accessible files, as this opens your site up for those with malicious intent. <\/p>\n<p>600 &#8211; For include files, typically containing unique keys or passwords (e.g. MySQL credentials, PayPal API Keys). If a PHP file is not accessed directly via your web browser (only referenced via other PHP files), use these permissions. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a general rule, the permissions of a PHP file should take one of two sets of values, either 644 or 600. 644 &#8211; A PHP file needs to be world readable if it is to be called via your web browser (meaning it is being processed by Apache). Do not include important passwords or &#8230; <a title=\"What are the correct file permissions for a PHP file?\" class=\"read-more\" href=\"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/\" aria-label=\"Read more about What are the correct file permissions for a PHP file?\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-911","post","type-post","status-publish","format-standard","hentry","category-php-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What are the correct file permissions for a PHP file? - Web Hosting Plus<\/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:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are the correct file permissions for a PHP file? - Web Hosting Plus\" \/>\n<meta property=\"og:description\" content=\"As a general rule, the permissions of a PHP file should take one of two sets of values, either 644 or 600. 644 &#8211; A PHP file needs to be world readable if it is to be called via your web browser (meaning it is being processed by Apache). Do not include important passwords or ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting Plus\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-04T00:08:08+00:00\" \/>\n<meta name=\"author\" content=\"webhostingplus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhostingplus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/\"},\"author\":{\"name\":\"webhostingplus\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/person\\\/ac818f1a9ee343e82657049f7c97c9dc\"},\"headline\":\"What are the correct file permissions for a PHP file?\",\"datePublished\":\"2018-03-04T00:08:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/\"},\"wordCount\":116,\"publisher\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#organization\"},\"articleSection\":[\"PHP Scripting\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/\",\"name\":\"What are the correct file permissions for a PHP file? - Web Hosting Plus\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#website\"},\"datePublished\":\"2018-03-04T00:08:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/correct-file-permissions-php-files\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What are the correct file permissions for a PHP file?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#website\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/\",\"name\":\"Web Hosting Plus\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#organization\",\"name\":\"Web Hosting Plus\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/wp-content\\\/uploads\\\/Web-Hosting-Plus-Logo.png\",\"contentUrl\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/wp-content\\\/uploads\\\/Web-Hosting-Plus-Logo.png\",\"width\":339,\"height\":78,\"caption\":\"Web Hosting Plus\"},\"image\":{\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/webhostingplus.uk\\\/hosting\\\/#\\\/schema\\\/person\\\/ac818f1a9ee343e82657049f7c97c9dc\",\"name\":\"webhostingplus\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are the correct file permissions for a PHP file? - Web Hosting Plus","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:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/","og_locale":"en_GB","og_type":"article","og_title":"What are the correct file permissions for a PHP file? - Web Hosting Plus","og_description":"As a general rule, the permissions of a PHP file should take one of two sets of values, either 644 or 600. 644 &#8211; A PHP file needs to be world readable if it is to be called via your web browser (meaning it is being processed by Apache). Do not include important passwords or ... Read more","og_url":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/","og_site_name":"Web Hosting Plus","article_published_time":"2018-03-04T00:08:08+00:00","author":"webhostingplus","twitter_card":"summary_large_image","twitter_misc":{"Written by":"webhostingplus","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/#article","isPartOf":{"@id":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/"},"author":{"name":"webhostingplus","@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/person\/ac818f1a9ee343e82657049f7c97c9dc"},"headline":"What are the correct file permissions for a PHP file?","datePublished":"2018-03-04T00:08:08+00:00","mainEntityOfPage":{"@id":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/"},"wordCount":116,"publisher":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#organization"},"articleSection":["PHP Scripting"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/","url":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/","name":"What are the correct file permissions for a PHP file? - Web Hosting Plus","isPartOf":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#website"},"datePublished":"2018-03-04T00:08:08+00:00","breadcrumb":{"@id":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webhostingplus.uk\/hosting\/correct-file-permissions-php-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webhostingplus.uk\/hosting\/"},{"@type":"ListItem","position":2,"name":"What are the correct file permissions for a PHP file?"}]},{"@type":"WebSite","@id":"https:\/\/webhostingplus.uk\/hosting\/#website","url":"https:\/\/webhostingplus.uk\/hosting\/","name":"Web Hosting Plus","description":"","publisher":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webhostingplus.uk\/hosting\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/webhostingplus.uk\/hosting\/#organization","name":"Web Hosting Plus","url":"https:\/\/webhostingplus.uk\/hosting\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/logo\/image\/","url":"https:\/\/webhostingplus.uk\/hosting\/wp-content\/uploads\/Web-Hosting-Plus-Logo.png","contentUrl":"https:\/\/webhostingplus.uk\/hosting\/wp-content\/uploads\/Web-Hosting-Plus-Logo.png","width":339,"height":78,"caption":"Web Hosting Plus"},"image":{"@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/webhostingplus.uk\/hosting\/#\/schema\/person\/ac818f1a9ee343e82657049f7c97c9dc","name":"webhostingplus"}]}},"_links":{"self":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/posts\/911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/comments?post=911"}],"version-history":[{"count":0,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/posts\/911\/revisions"}],"wp:attachment":[{"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/media?parent=911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/categories?post=911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostingplus.uk\/hosting\/wp-json\/wp\/v2\/tags?post=911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}