<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How to Check if php is running from cli (command line)	</title>
	<atom:link href="https://www.binarytides.com/php-check-running-cli/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.binarytides.com/php-check-running-cli/</link>
	<description>News, Technology, Entertainment and more</description>
	<lastBuildDate>Fri, 13 Jan 2023 08:21:17 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>
		By: How To		</title>
		<link>https://www.binarytides.com/php-check-running-cli/comment-page-1/#comment-323631</link>

		<dc:creator><![CDATA[How To]]></dc:creator>
		<pubDate>Sun, 05 Sep 2021 22:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=501#comment-323631</guid>

					<description><![CDATA[Not exactly related to the topics, but I am facing a problem related to this. When I run ps -aux in my Namecheap server, it shows PHP processes wither the filenames, but when I run the same px -aux command in y VPS (with LAMP, i do not get the filenames but simply /usr/sbin/apache2 -k start
Any idea how to make my LAMP server in my VPS to show PHP filenames when I execute ps -aux ?]]></description>
			<content:encoded><![CDATA[<p>Not exactly related to the topics, but I am facing a problem related to this. When I run ps -aux in my Namecheap server, it shows PHP processes wither the filenames, but when I run the same px -aux command in y VPS (with LAMP, i do not get the filenames but simply /usr/sbin/apache2 -k start<br />
Any idea how to make my LAMP server in my VPS to show PHP filenames when I execute ps -aux ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andreas Heintze		</title>
		<link>https://www.binarytides.com/php-check-running-cli/comment-page-1/#comment-314415</link>

		<dc:creator><![CDATA[Andreas Heintze]]></dc:creator>
		<pubDate>Wed, 03 Mar 2021 23:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=501#comment-314415</guid>

					<description><![CDATA[define(&#039;CLI&#039;, defined(&#039;STDIN&#039;) &#124;&#124; (
    empty($_SERVER[&#039;REMOTE_ADDR&#039;]) 
    &#038;&#038; !isset($_SERVER[&#039;HTTP_USER_AGENT&#039;])
    &#038;&#038; count($_SERVER[&#039;argv&#039;]) &#062; 0
));

if (CLI) {
    // If called from CLI...
} else {
    // ..or from a browser/wget call.
}]]></description>
			<content:encoded><![CDATA[<p>define(&#8216;CLI&#8217;, defined(&#8216;STDIN&#8217;) || (<br />
    empty($_SERVER[&#8216;REMOTE_ADDR&#8217;])<br />
    &amp;&amp; !isset($_SERVER[&#8216;HTTP_USER_AGENT&#8217;])<br />
    &amp;&amp; count($_SERVER[&#8216;argv&#8217;]) &gt; 0<br />
));</p>
<p>if (CLI) {<br />
    // If called from CLI&#8230;<br />
} else {<br />
    // ..or from a browser/wget call.<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Benjamin		</title>
		<link>https://www.binarytides.com/php-check-running-cli/comment-page-1/#comment-87627</link>

		<dc:creator><![CDATA[Benjamin]]></dc:creator>
		<pubDate>Thu, 07 Jul 2016 12:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=501#comment-87627</guid>

					<description><![CDATA[/**
 * Detects whether the current script is running in a command-line environment.
 */
function is_cli() {
  return (!isset($_SERVER[&#039;SERVER_SOFTWARE&#039;]) &#038;&#038; (php_sapi_name() == &#039;cli&#039; &#124;&#124; (is_numeric($_SERVER[&#039;argc&#039;]) &#038;&#038; $_SERVER[&#039;argc&#039;] &#062; 0)));
}]]></description>
			<content:encoded><![CDATA[<p>/**<br />
 * Detects whether the current script is running in a command-line environment.<br />
 */<br />
function is_cli() {<br />
  return (!isset($_SERVER[&#8216;SERVER_SOFTWARE&#8217;]) &amp;&amp; (php_sapi_name() == &#8216;cli&#8217; || (is_numeric($_SERVER[&#8216;argc&#8217;]) &amp;&amp; $_SERVER[&#8216;argc&#8217;] &gt; 0)));<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ruel		</title>
		<link>https://www.binarytides.com/php-check-running-cli/comment-page-1/#comment-65542</link>

		<dc:creator><![CDATA[Ruel]]></dc:creator>
		<pubDate>Thu, 20 Jun 2013 03:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=501#comment-65542</guid>

					<description><![CDATA[Thanks for this very informative and useful article!]]></description>
			<content:encoded><![CDATA[<p>Thanks for this very informative and useful article!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
