{"id":1402,"date":"2015-02-04T05:13:57","date_gmt":"2015-02-04T05:13:57","guid":{"rendered":"https:\/\/cpanelplesk.com\/wp62\/?p=1402"},"modified":"2021-02-13T04:28:11","modified_gmt":"2021-02-13T04:28:11","slug":"setting-your-php-settings-via-command-line","status":"publish","type":"post","link":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/","title":{"rendered":"Setting your PHP Settings via Command Line"},"content":{"rendered":"<p style=\"text-align: justify;\">When you are operating a PHP file from command line, there may be times when you need to create changes to the PHP configurations. In this post we will explain you how to specify the php.ini file, and modify a PHP settings through command line. If you don&#8217;t know how to use command line, you can modify your PHP configurations in cPanel.<!--more--><\/p>\n<p style=\"text-align: justify;\"><strong>HOW TO Specify the php.ini File in Command Line:<\/strong><\/p>\n<ol class=\"article_list\" style=\"text-align: justify;\">\n<li><span style=\"color: #000000;\">Connect to your server using SSH<\/span>.<\/li>\n<li>You may specify the php.ini file in command line by using the following syntax:<\/li>\n<\/ol>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true\">php -c \/home\/username\/public_html\/php.ini \/home\/username\/public_html\r\n\/example.php<\/pre>\n<\/div>\n<p style=\"text-align: justify;\">Now the <strong>example.php<\/strong> file will run, with the limitations set in the <strong>php.ini<\/strong> file located here: \/home\/username\/public_html.<\/p>\n<p style=\"text-align: justify;\"><strong>Change PHP settings:<\/strong><\/p>\n<ol style=\"text-align: justify;\">\n<li>Connect to your server via SSH.<\/li>\n<li>You can specify php.ini settings in command line with this syntax:<\/li>\n<\/ol>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">php -c \/home\/username\/public_html\/php.ini \/home\/username\/public_html\r\n\/example.php -d memory_limit=512M<\/pre>\n<\/div>\n<p style=\"text-align: justify;\">In the above example you can see that we have modify the <strong>memory limit<\/strong> to 512 MB.There are some other PHP settings that are often modified.<\/p>\n<div class=\"command-sh\">\n<pre class=\"lang:default decode:true \">max_execution_time\r\nmax_input_time\r\nupload_max_filesize<\/pre>\n<\/div>\n<p style=\"text-align: justify;\">now you know how to set the php.ini file, and modify your PHP configurations from command line!<\/p>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>When you are operating a PHP file from command line, there may be times when you need to create changes to the PHP configurations. In this post we will explain you how to specify the php.ini file, and modify a PHP settings through command line. If you don&#8217;t know how to use command line, you [&#8230;]<\/p>\n<p><a class=\"understrap-read-more-link\" href=\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1402","post","type-post","status-publish","format-standard","hentry","category-cpanel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Setting your PHP Settings via Command Line - cPanel Plesk<\/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:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Setting your PHP Settings via Command Line - cPanel Plesk\" \/>\n<meta name=\"twitter:description\" content=\"When you are operating a PHP file from command line, there may be times when you need to create changes to the PHP configurations. In this post we will explain you how to specify the php.ini file, and modify a PHP settings through command line. If you don&#8217;t know how to use command line, you [...]Continue Reading...\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Seemab Saleem\" \/>\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:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/\"},\"author\":{\"name\":\"Seemab Saleem\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\"},\"headline\":\"Setting your PHP Settings via Command Line\",\"datePublished\":\"2015-02-04T05:13:57+00:00\",\"dateModified\":\"2021-02-13T04:28:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/\"},\"wordCount\":189,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"articleSection\":[\"Cpanel\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/\",\"name\":\"Setting your PHP Settings via Command Line - cPanel Plesk\",\"isPartOf\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\"},\"datePublished\":\"2015-02-04T05:13:57+00:00\",\"dateModified\":\"2021-02-13T04:28:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cpanelplesk.com\/wp62\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting your PHP Settings via Command Line\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#website\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/\",\"name\":\"cPanel Plesk\",\"description\":\"Blog on famous hosting control panels\",\"publisher\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13\",\"name\":\"Farooq Omer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"contentUrl\":\"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png\",\"width\":300,\"height\":44,\"caption\":\"Farooq Omer\"},\"logo\":{\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648\",\"name\":\"Seemab Saleem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g\",\"caption\":\"Seemab Saleem\"},\"description\":\"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!\",\"sameAs\":[\"https:\/\/cpanelplesk.com\/wp62\"],\"url\":\"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Setting your PHP Settings via Command Line - cPanel Plesk","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:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/","twitter_card":"summary_large_image","twitter_title":"Setting your PHP Settings via Command Line - cPanel Plesk","twitter_description":"When you are operating a PHP file from command line, there may be times when you need to create changes to the PHP configurations. In this post we will explain you how to specify the php.ini file, and modify a PHP settings through command line. If you don&#8217;t know how to use command line, you [...]Continue Reading...","twitter_misc":{"Written by":"Seemab Saleem","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/#article","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/"},"author":{"name":"Seemab Saleem","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648"},"headline":"Setting your PHP Settings via Command Line","datePublished":"2015-02-04T05:13:57+00:00","dateModified":"2021-02-13T04:28:11+00:00","mainEntityOfPage":{"@id":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/"},"wordCount":189,"commentCount":0,"publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"articleSection":["Cpanel"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/","url":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/","name":"Setting your PHP Settings via Command Line - cPanel Plesk","isPartOf":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#website"},"datePublished":"2015-02-04T05:13:57+00:00","dateModified":"2021-02-13T04:28:11+00:00","breadcrumb":{"@id":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cpanelplesk.com\/wp62\/setting-your-php-settings-via-command-line\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cpanelplesk.com\/wp62\/"},{"@type":"ListItem","position":2,"name":"Setting your PHP Settings via Command Line"}]},{"@type":"WebSite","@id":"https:\/\/cpanelplesk.com\/wp62\/#website","url":"https:\/\/cpanelplesk.com\/wp62\/","name":"cPanel Plesk","description":"Blog on famous hosting control panels","publisher":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cpanelplesk.com\/wp62\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/c78ae1cf9451a09592fb9697d69c0c13","name":"Farooq Omer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","contentUrl":"https:\/\/cpanelplesk.com\/wp62\/wp-content\/uploads\/2020\/11\/cpanelplesk.png","width":300,"height":44,"caption":"Farooq Omer"},"logo":{"@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/73d573cc7eaaf6625cf0dbd72191a648","name":"Seemab Saleem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cpanelplesk.com\/wp62\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6a87ff2e53b03e6839250e5278a6bd46?s=96&d=mm&r=g","caption":"Seemab Saleem"},"description":"Linux Server Administrator, Web Hosting engineer. I'm dealing with Linux servers since 2014. I started this blog to share the work i love with the world . let me know if you need any assistance. Thanks!!","sameAs":["https:\/\/cpanelplesk.com\/wp62"],"url":"https:\/\/cpanelplesk.com\/wp62\/author\/cmb\/"}]}},"_links":{"self":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/1402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/comments?post=1402"}],"version-history":[{"count":0,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/posts\/1402\/revisions"}],"wp:attachment":[{"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/media?parent=1402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/categories?post=1402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelplesk.com\/wp62\/wp-json\/wp\/v2\/tags?post=1402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}