WordPress file ownership and Permissions

Snyder, Alexander J alexander at snyderfamily.co
Mon Jun 24 11:46:20 MST 2019


You can check the PS output:

ps -ef | grep -v grep | grep -Ei 'wordpress|apache|php'

It's likely running as the apache user or the www user.

Thanks,
Alexander

Sent from my Galaxy S10+

On Mon, Jun 24, 2019, 10:53 <techlists at phpcoderusa.com> wrote:

>
>
>
> How would I know what user WordPress runs as?  And how would I know what
> groups that user is in?
>
>
> On 2019-06-20 20:34, James Mcphee wrote:
>
> does the wordpress service run as a user with membership in the www-data
> group?  It should, but you never know.
>
>
> On Thu, Jun 20, 2019 at 8:18 PM <techlists at phpcoderusa.com> wrote:
>
>> Thanks!!
>>
>> Ownership is {my-user-name}:www-data
>>
>> Permissions is 775
>>
>> I added {my-user-name} to the www-data group : usermod -a -G www-data
>> {my-user-name}
>>
>> /etc/group has an entry www-data:x:33:{my-user-name} which I assume
>> verifies {my-user-name} was added to the www-data group?
>>
>> I can SFTP and I can remote edit using my editor, however WordPress asks
>> for FTP credentials when I try to remove a plugin.
>>
>> Any thoughts?
>>
>> Thanks!!
>>
>>
>>
>>
>>
>> On 2019-06-20 19:47, James Mcphee wrote:
>>
>> Also, you're going to want to add your user to the www-data group.  Then
>> check to see what perms a modified or added file has.  If it's not
>> something you can write to, you'll have to set some suids or default facls.
>>
>> On Thu, Jun 20, 2019 at 7:42 PM James Mcphee <jmcphe at gmail.com> wrote:
>>
>>> You need to give www-data write access for wordpress to be able to write
>>> to files.  chmod -R 775 www/
>>> Whether a web daemon SHOULD have access to edit its own files is a whole
>>> nother question.
>>>
>>> On Thu, Jun 20, 2019 at 7:35 PM <techlists at phpcoderusa.com> wrote:
>>>
>>>>
>>>> Hi I am running a local server running Ubunto 16.04LTS with a stock
>>>> LAMP install that runs  stock Apache.
>>>>
>>>> I have an install of WordPress under
>>>> /var/www/vhost/{vhost-name}/public_html
>>>>
>>>> Here is my problem.
>>>>
>>>> I can either FTP or WordPress can edit / remove file.  I cannot do
>>>> both.  Not sure why.
>>>>
>>>> To allow WordPress to modify files I must:  (I cannot SFTP)
>>>>
>>>>    - chown -R {my-user-name}:www-data www/
>>>>    - chmod -R 755 www/
>>>>
>>>> To allow me to SFTP I must change the file ownership:  (WordPress
>>>> cannot modify files)
>>>>
>>>>    - chown -R {my-user-name}:www-data www/
>>>>
>>>> I would like to be able to FTP and allow WordPress to modify files.
>>>>
>>>> Any help much appreciated.
>>>>
>>>> Thanks!!
>>>>
>>>>
>>>> ---------------------------------------------------
>>>> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
>>>> To subscribe, unsubscribe, or to change your mail settings:
>>>> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>>>
>>>
>>>
>>> --
>>> James McPhee
>>> jmcphe at gmail.com
>>>
>>
>>
>> --
>> James McPhee
>> jmcphe at gmail.com
>>
>> ---------------------------------------------------
>> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
>> To subscribe, unsubscribe, or to change your mail settings:
>> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>>
>> ---------------------------------------------------
>> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
>> To subscribe, unsubscribe, or to change your mail settings:
>> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>
>
>
> --
> James McPhee
> jmcphe at gmail.com
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> https://lists.phxlinux.org/mailman/listinfo/plug-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20190624/debae3a0/attachment.html>


More information about the PLUG-discuss mailing list