{"id":3453,"date":"2014-11-18T16:28:11","date_gmt":"2014-11-18T16:28:11","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2014\/11\/18\/command-line-settings\/"},"modified":"2025-02-11T13:49:23","modified_gmt":"2025-02-11T18:49:23","slug":"command-line-settings","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/","title":{"rendered":"Setting Your PHP Settings in Command Line"},"content":{"rendered":"<p>When you are running a PHP file from the command line (on <a title=\"Click here to navigate to our main website and review our available Cloud VPS Hosting plans.\" href=\"https:\/\/www.inmotionhosting.com\/vps-hosting\">VPS Hosting<\/a> or otherwise), there may be times when you need to make <strong>changes to the PHP settings<\/strong>. In this guide, we will show you how to specify the php.ini file, and <strong>change a PHP setting in the command line<\/strong>. If you are <em>not<\/em> working in the <em>command line<\/em>, you can <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/update-local-php-settings\/\">change your PHP settings in cPanel<\/a>.<\/p>\n<h2>Specify the php.ini File in Command Line<\/h2>\n<ol class=\"article_list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-login-ssh\/\">Connect to your server using SSH<\/a>.<\/li>\n<li>You can specify the php.ini file in the command line by using the following syntax:\n<p class=\"code_block\">php -c [Path to php.ini file] [Path to .php file]\n<p>For example:<\/p>\n<p class=\"code_block\">php -c \/home\/userna5\/public_html\/php.ini \/home\/userna5\/public_html\/example.php<\/p>\n<p>Now the <em>example.php<\/em> file will run, with the limitations set in the <em>php.ini<\/em> file located here: \/home\/userna5\/public_html<\/li>\n<\/ol>\n<h2>Change PHP settings<\/h2>\n<ol class=\"article_list\">\n<li><a href=\"https:\/\/www.inmotionhosting.com\/support\/server\/ssh\/how-to-login-ssh\/\">Connect to your server using SSH<\/a>.<\/li>\n<li>You can specify php.ini settings in the command line with this syntax:\n<p class=\"code_block\">php -c [Path to php.ini file] [Path to .php file] -d [PHP setting]\n<p>For example:<\/p>\n<p class=\"code_block\">php -c \/home\/userna5\/public_html\/php.ini \/home\/userna5\/public_html\/example.php -d memory_limit=256M<\/p>\n<p>In this example, you can see I am setting the <strong>memory limit<\/strong> to 256 Megabytes. Here are some other PHP settings that are often modified:<\/p>\n<table class=\"article_table\">\n<tbody>\n<tr>\n<td>max_execution_time<\/td>\n<\/tr>\n<tr>\n<td>max_input_time<\/td>\n<\/tr>\n<tr>\n<td>upload_max_filesize<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"alert alert-warning\"><strong>Important:<\/strong> The PHP <code>max_execution_time<\/code> is capped at <strong>90 seconds<\/strong> on <a href=\"https:\/\/www.inmotionhosting.com\/shared-hosting\">Shared Hosting Plans<\/a> to prevent extremely long processes from impacting other users sharing the server resources. If you need a longer <code>max_execution_time<\/code>, consider one of our <a href=\"https:\/\/www.inmotionhosting.com\/vps-hosting\">VPS Hosting Plans<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p>Congratulations, now you know how to set the php.ini file, and change your PHP settings from the command line!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you are running a PHP file from the command line (on VPS Hosting or otherwise), there may be times when you need to make changes to the PHP settings. In this guide, we will show you how to specify the php.ini file, and change a PHP setting in the command line. If you are<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/\"> Read More ><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4308,4288],"tags":[],"class_list":["post-3453","post","type-post","status-publish","format-standard","hentry","category-linux","category-website"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Setting Your PHP Settings in Command Line<\/title>\n<meta name=\"description\" content=\"Learn how to set your PHP settings in command line.\" \/>\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.inmotionhosting.com\/support\/website\/command-line-settings\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Setting Your PHP Settings in Command Line\" \/>\n<meta property=\"og:description\" content=\"Learn how to set your PHP settings in command line.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-18T16:28:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-11T18:49:23+00:00\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. 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:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\"},\"headline\":\"Setting Your PHP Settings in Command Line\",\"datePublished\":\"2014-11-18T16:28:11+00:00\",\"dateModified\":\"2025-02-11T18:49:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/\"},\"wordCount\":272,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"articleSection\":[\"Linux\",\"Website\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/\",\"name\":\"Setting Your PHP Settings in Command Line\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"datePublished\":\"2014-11-18T16:28:11+00:00\",\"dateModified\":\"2025-02-11T18:49:23+00:00\",\"description\":\"Learn how to set your PHP settings in command line.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting Your PHP Settings in Command Line\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting Your PHP Settings in Command Line","description":"Learn how to set your PHP settings in command line.","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.inmotionhosting.com\/support\/website\/command-line-settings\/","og_locale":"en_US","og_type":"article","og_title":"Setting Your PHP Settings in Command Line","og_description":"Learn how to set your PHP settings in command line.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2014-11-18T16:28:11+00:00","article_modified_time":"2025-02-11T18:49:23+00:00","author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b"},"headline":"Setting Your PHP Settings in Command Line","datePublished":"2014-11-18T16:28:11+00:00","dateModified":"2025-02-11T18:49:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/"},"wordCount":272,"commentCount":4,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"articleSection":["Linux","Website"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/","name":"Setting Your PHP Settings in Command Line","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"datePublished":"2014-11-18T16:28:11+00:00","dateModified":"2025-02-11T18:49:23+00:00","description":"Learn how to set your PHP settings in command line.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/command-line-settings\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Setting Your PHP Settings in Command Line"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/5fbfcaed32a2672fb83ab312f5b7237b","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/john-paul\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3453","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=3453"}],"version-history":[{"count":8,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3453\/revisions"}],"predecessor-version":[{"id":129315,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/3453\/revisions\/129315"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=3453"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=3453"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=3453"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}