{"id":188,"date":"2009-09-22T10:53:00","date_gmt":"2009-09-22T02:53:00","guid":{"rendered":"http:\/\/www.genepeng.com\/index.php\/188"},"modified":"2009-09-22T10:55:04","modified_gmt":"2009-09-22T02:55:04","slug":"useful-php-command-line-options","status":"publish","type":"post","link":"https:\/\/www.genepeng.com\/index.php\/188","title":{"rendered":"Useful PHP Command line options"},"content":{"rendered":"<p><font size=\"2\">&#160;<\/font><\/p>\n<pre><font size=\"2\">Usage: php [options] [-f] &lt;file&gt; [--] [args...]\n       php [options] -r &lt;code&gt; [--] [args...]\n       php [options] [-B &lt;begin_code&gt;] -R &lt;code&gt; [-E &lt;end_code&gt;] [--] [args...]\n       php [options] [-B &lt;begin_code&gt;] -F &lt;file&gt; [-E &lt;end_code&gt;] [--] [args...]\n       php [options] -- [args...]\n       php [options] -a\n\n  -a               Run interactively\n  -c &lt;path&gt;|&lt;file&gt; Look for php.ini file in this directory\n  -n               No php.ini file will be used\n  -d foo[=bar]     Define INI entry foo with value 'bar'\n  -e               Generate extended information for debugger\/profiler\n  -f &lt;file&gt;        Parse and execute &lt;file&gt;.\n  -h               This help\n  -i               PHP information\n  -l               Syntax check only (lint)\n  -m               Show compiled in modules\n  -r &lt;code&gt;        Run PHP &lt;code&gt; without using script tags &lt;?..?&gt;\n  -B &lt;begin_code&gt;  Run PHP &lt;begin_code&gt; before processing input lines\n  -R &lt;code&gt;        Run PHP &lt;code&gt; for every input line\n  -F &lt;file&gt;        Parse and execute &lt;file&gt; for every input line\n  -E &lt;end_code&gt;    Run PHP &lt;end_code&gt; after processing all input lines\n  -H               Hide any passed arguments from external tools.\n  -s               Display colour syntax highlighted source.\n  -v               Version number\n  -w               Display source with stripped comments and whitespace.\n  -z &lt;file&gt;        Load Zend extension &lt;file&gt;.\n\n  args...          Arguments passed to script. Use -- args when first argument\n                   starts with - or script is read from stdin\n\n  --ini            Show configuration file names\n\n  --rf &lt;name&gt;      Show information about function &lt;name&gt;.\n  --rc &lt;name&gt;      Show information about class &lt;name&gt;.\n  --re &lt;name&gt;      Show information about extension &lt;name&gt;.\n  --ri &lt;name&gt;      Show configuration for extension &lt;name&gt;.<\/font><\/pre>\n<pre><font size=\"2\">Detail Usage:<\/font><\/pre>\n<ul>\n<li><font size=\"2\">Telling PHP to execute a certain file<\/font><\/li>\n<\/ul>\n<blockquote>\n<pre><font size=\"2\">$ php my_script.php\n\n$ php -f my_script.php<\/font><\/pre>\n<\/blockquote>\n<ul>\n<li><font size=\"2\">Pass the PHP code to execute directly on the command line<\/font><\/li>\n<\/ul>\n<blockquote>\n<pre><font size=\"2\">$ php -r 'print_r(get_defined_constants());'<\/font><\/pre>\n<\/blockquote>\n<ul>\n<li><font size=\"2\">prints out the built in (and loaded) PHP and Zend modules<\/font><\/li>\n<blockquote>\n<pre><font size=\"2\">$ php -m\n[PHP Modules]\nxml\ntokenizer\nstandard\nsession\nposix\npcre\noverload\nmysql\nmbstring\nctype<\/font><\/pre>\n<\/blockquote>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>&#160; Usage: php [options] [-f] &lt;file&gt; [&#8211;] [args&#8230;] php [options] -r &lt;code&gt; [&#8211;] [args&#8230;] php [options] [-B &lt;begin_code&gt;] -R &lt;code&gt; [-E &lt;end_code&gt;] [&#8211;] [args&#8230;] php [options] [-B &lt;begin_code&gt;] -F &lt;file&gt; [-E &lt;end_code&gt;] [&#8211;] [args&#8230;] php [options] &#8212; [args&#8230;] php [options] -a -a Run interactively -c &lt;path&gt;|&lt;file&gt; Look for php.ini file in this directory -n No &#8230; <a title=\"Useful PHP Command line options\" class=\"read-more\" href=\"https:\/\/www.genepeng.com\/index.php\/188\" aria-label=\"More on Useful PHP Command line options\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/188"}],"collection":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":1,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"predecessor-version":[{"id":189,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/posts\/188\/revisions\/189"}],"wp:attachment":[{"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.genepeng.com\/index.php\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}