<?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: 💻 wp-cli executed by www-data user to avoid Linux permission issues	</title>
	<atom:link href="https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/</link>
	<description>Balancing brackets for a living</description>
	<lastBuildDate>Wed, 20 Dec 2023 10:34:06 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Andrew Jennings		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-17310</link>

		<dc:creator><![CDATA[Andrew Jennings]]></dc:creator>
		<pubDate>Fri, 25 Feb 2022 01:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-17310</guid>

					<description><![CDATA[sudo -u www-data wp ai1wm backup
returns an error:
Error: Strange wp-config.php file: wp-settings.php is not loaded directly.
ls-las
6344 -rwxr-xr-x  1 www-data www-data 6494444 Feb 24 23:26 wp

My wp-config.php has
/** Absolute path to the WordPress directory. */
if ( !defined(&#039;ABSPATH&#039;) )
        define(&#039;ABSPATH&#039;, dirname(__FILE__) . &#039;/&#039;);

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . &#039;wp-settings.php&#039;);]]></description>
			<content:encoded><![CDATA[<p>sudo -u www-data wp ai1wm backup<br />
returns an error:<br />
Error: Strange wp-config.php file: wp-settings.php is not loaded directly.<br />
ls-las<br />
6344 -rwxr-xr-x  1 www-data www-data 6494444 Feb 24 23:26 wp</p>
<p>My wp-config.php has<br />
/** Absolute path to the WordPress directory. */<br />
if ( !defined(&#8216;ABSPATH&#8217;) )<br />
        define(&#8216;ABSPATH&#8217;, dirname(__FILE__) . &#8216;/&#8217;);</p>
<p>/** Sets up WordPress vars and included files. */<br />
require_once(ABSPATH . &#8216;wp-settings.php&#8217;);</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: alexg		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-13501</link>

		<dc:creator><![CDATA[alexg]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 11:33:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-13501</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-13500&quot;&gt;Craig Devoy&lt;/a&gt;.

Glad to hear it!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-13500">Craig Devoy</a>.</p>
<p>Glad to hear it!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Craig Devoy		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-13500</link>

		<dc:creator><![CDATA[Craig Devoy]]></dc:creator>
		<pubDate>Wed, 13 Jan 2021 10:32:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-13500</guid>

					<description><![CDATA[Great post! Saved me a bunch of time, thanks.]]></description>
			<content:encoded><![CDATA[<p>Great post! Saved me a bunch of time, thanks.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: alexg		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-12810</link>

		<dc:creator><![CDATA[alexg]]></dc:creator>
		<pubDate>Mon, 02 Nov 2020 06:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-12810</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-12808&quot;&gt;Dragon&#039;s Way&lt;/a&gt;.

Great to hear that you got it working!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-12808">Dragon&#8217;s Way</a>.</p>
<p>Great to hear that you got it working!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dragon's Way		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-12808</link>

		<dc:creator><![CDATA[Dragon's Way]]></dc:creator>
		<pubDate>Mon, 02 Nov 2020 03:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-12808</guid>

					<description><![CDATA[My apologies, works great... forgot to add sudo....  going for coffee... :-/]]></description>
			<content:encoded><![CDATA[<p>My apologies, works great&#8230; forgot to add sudo&#8230;.  going for coffee&#8230; :-/</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dragon's Way		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-12807</link>

		<dc:creator><![CDATA[Dragon's Way]]></dc:creator>
		<pubDate>Mon, 02 Nov 2020 02:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-12807</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-11708&quot;&gt;Inspired Earth&lt;/a&gt;.

Great Tutorial...

Having the same issue.

Error: /usr/local/bin/wp is not writable by current user.

I created the alias in my .bashrc file as you instructed, but getting the same error (even after reboot).

Any suggestions?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-11708">Inspired Earth</a>.</p>
<p>Great Tutorial&#8230;</p>
<p>Having the same issue.</p>
<p>Error: /usr/local/bin/wp is not writable by current user.</p>
<p>I created the alias in my .bashrc file as you instructed, but getting the same error (even after reboot).</p>
<p>Any suggestions?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Inspired Earth		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-11708</link>

		<dc:creator><![CDATA[Inspired Earth]]></dc:creator>
		<pubDate>Fri, 22 May 2020 05:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-11708</guid>

					<description><![CDATA[Hi there. Thanks for this post.

Regarding this issue:

&lt;code&gt;$ wp cli update
Error: /usr/local/bin is not writable by current user.&lt;/code&gt;

The way I got around this was to create a bash alias like this:

&lt;code&gt;alias wp-cli-update=&quot;sudo chown -R MYUSER:MYUSER ~/.wp-cli/ &amp;&amp; sudo wp cli update &amp;&amp; sudo chown -R www-data:www-data ~/.wp-cli/&quot;&lt;/code&gt;

I can now use &lt;code&gt;wp-cli-update&lt;/code&gt; to change the permissions on &lt;code&gt;~/.wp-cli/&lt;/code&gt; to what&#039;s required, update wp-cli, and change the permissions back to what otherwise makes things work for wp commands in general.]]></description>
			<content:encoded><![CDATA[<p>Hi there. Thanks for this post.</p>
<p>Regarding this issue:</p>
<p><code>$ wp cli update<br />
Error: /usr/local/bin is not writable by current user.</code></p>
<p>The way I got around this was to create a bash alias like this:</p>
<p><code>alias wp-cli-update="sudo chown -R MYUSER:MYUSER ~/.wp-cli/ &#038;& sudo wp cli update &#038;& sudo chown -R www-data:www-data ~/.wp-cli/"</code></p>
<p>I can now use <code>wp-cli-update</code> to change the permissions on <code>~/.wp-cli/</code> to what&#8217;s required, update wp-cli, and change the permissions back to what otherwise makes things work for wp commands in general.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sisir Kanti Adhikari		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-9629</link>

		<dc:creator><![CDATA[Sisir Kanti Adhikari]]></dc:creator>
		<pubDate>Sun, 08 Sep 2019 13:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-9629</guid>

					<description><![CDATA[Big thanks! Saved a lot of time &#038; headache!! :)]]></description>
			<content:encoded><![CDATA[<p>Big thanks! Saved a lot of time &amp; headache!! 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: alexg		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-5943</link>

		<dc:creator><![CDATA[alexg]]></dc:creator>
		<pubDate>Tue, 08 May 2018 16:02:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-5943</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-5871&quot;&gt;Jesse&lt;/a&gt;.

Jesse, you are correct, this interferes with &lt;code&gt;wp cli update&lt;/code&gt;:
&lt;pre&gt;
$ wp cli update
Error: /usr/local/bin is not writable by current user.
&lt;/pre&gt;
If you want to mention me in some credits please do, but I don&#039;t have a good solution about this problem at the moment. If you do find a solution, I would love to hear about it.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-5871">Jesse</a>.</p>
<p>Jesse, you are correct, this interferes with <code>wp cli update</code>:</p>
<pre>
$ wp cli update
Error: /usr/local/bin is not writable by current user.
</pre>
<p>If you want to mention me in some credits please do, but I don&#8217;t have a good solution about this problem at the moment. If you do find a solution, I would love to hear about it.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jesse		</title>
		<link>https://www.alexgeorgiou.gr/wp-cli-www-data-user-permissions-linux/#comment-5871</link>

		<dc:creator><![CDATA[Jesse]]></dc:creator>
		<pubDate>Thu, 03 May 2018 21:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.alexgeorgiou.gr/?p=124#comment-5871</guid>

					<description><![CDATA[Awesome, thanks Alex! WordFence is preventing my comment from being posted so trying again with generic terms....

Is your /usr/local/bin/ also the same? Or have you ever seen permissions issues with updating WP-CPI?

We are playing with a small auto-installer for LEMP stack so were wondering about WP-CLI best permissions.

https://github.com/littlebizzy/slickstack

Would love to mention your name in Credits? Thanks!]]></description>
			<content:encoded><![CDATA[<p>Awesome, thanks Alex! WordFence is preventing my comment from being posted so trying again with generic terms&#8230;.</p>
<p>Is your /usr/local/bin/ also the same? Or have you ever seen permissions issues with updating WP-CPI?</p>
<p>We are playing with a small auto-installer for LEMP stack so were wondering about WP-CLI best permissions.</p>
<p><a href="https://github.com/littlebizzy/slickstack" rel="nofollow ugc">https://github.com/littlebizzy/slickstack</a></p>
<p>Would love to mention your name in Credits? Thanks!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
