{"id":548,"date":"2013-02-04T12:11:28","date_gmt":"2013-02-04T12:11:28","guid":{"rendered":"http:\/\/blog.stratus.org.uk\/?p=548"},"modified":"2013-02-04T13:40:58","modified_gmt":"2013-02-04T13:40:58","slug":"php-using-from-the-shell-command-line-use-php-cli","status":"publish","type":"post","link":"http:\/\/blog.stratus.org.uk\/?p=548","title":{"rendered":"PHP: using from the shell command line (use php-cli)"},"content":{"rendered":"<p>A long-running project uses PHP for the somewhat slow creation of some databases tables and dynamic javascript arrays.<\/p>\n<p>The shell script that calls the PHP uses <em>curl<\/em> to make the scripts work. Alas the hosting provider offers a shared service and the PHP scripts often\u00a0time out.<\/p>\n<p>A way to run your scripts that rely on <em>HTTP $_GET<\/em>, is to use <strong>php-cli<\/strong> as the engine and not the normal PHP processor. In this way, you can test your PHP scripts from the command line as if they are pulled using HTTP.<\/p>\n<p>Be aware that this needs to be enabled for your system and that there is normally a separate php.ini file for it.<\/p>\n<p>The original post has gone, but more info <a href=\"http:\/\/www.php-cli.com\/\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A long-running project uses PHP for the somewhat slow creation of some databases tables and dynamic javascript arrays. The shell script that calls the PHP uses curl to make the scripts work. Alas the hosting provider offers a shared service &hellip; <a href=\"http:\/\/blog.stratus.org.uk\/?p=548\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-548","post","type-post","status-publish","format-standard","hentry","category-misc"],"_links":{"self":[{"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=548"}],"version-history":[{"count":3,"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":551,"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/548\/revisions\/551"}],"wp:attachment":[{"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.stratus.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}