Permissions issue Ubuntu 24/Apache2/PHP-FPM - update3

techlists at phpcoderusa.com techlists at phpcoderusa.com
Wed Dec 11 07:38:30 MST 2024


Disregard.  Set premsaturely.


On 2024-12-11 07:37, Keith Smith via PLUG-discuss wrote:
> Ok,
> 
> Yikes.  I do not think I have the PHP-FPM configured correctly. I think 
> I am close.  I have worked on this for an embarrassing maybe as much as 
> 40 hours.  Yikes!!
> 
> My PHP-FPM user and group is a user named lamp.  lamp has ssh but not 
> sudo.
> 
> 1) Set Ownership and Permissions
> 
>     – sudo usermod -aG lamp www-data
>     – sudo chown -R lamp:lamp /var/www/lamp.internal
>     – sudo find /var/www/lamp.internal -type d -exec chmod 775 {} \;
>     – sudo find /var/www/lamp.internal -type f -exec chmod 644 {} \;
> 
> 
> 
> 
> I has to add to the mix 3 things:
> 1) Added php_admin_value[umask] = 0022 to  
> /etc/php/8.3/fpm/pool.d/lamp.conf
> 2)
> 3) sudo find /var/www/lamp.internal -type d -exec chmod 775 {} \;
> 
> Set Ownership and Permissions
> 
> – sudo usermod -aG lamp www-data
> – sudo chown -R lamp:lamp /var/www/lamp.internal
> – sudo find /var/www/lamp.internal -type d -exec chmod 775 {} \;
> – sudo find /var/www/lamp.internal -type f -exec chmod 644 {} \;
> 
> 
> 
> 
> On 2024-12-05 09:53, Snyder, Alexander J wrote:
>> What is the group of the Apache process? I think that group needs to
>> be there like
>> 
>> chown lamp:www-data test_file.txt
>> chmod 775 test_file.txt
>> 
>> Its working when you set 777 because that's making it writable to
>> everyone.
>> 
>> ---
>> Thanks,
>> Alexander
>> 
>> Sent from my Google Pixel 7 Pro
>> 
>> On Thu, Dec 5, 2024, 09:46 Keith Smith via PLUG-discuss
>> <plug-discuss at lists.phxlinux.org> wrote:
>> 
>>> Hello;
>>> 
>>> I have a private net that runs non-rountable domain names of
>>> .internal.
>>> I use the hosts files for DNS.
>>> 
>>> This is for PHP development and testing.
>>> 
>>> Desktop is Kubuntu. Have installed Virtual Studio Code (VSC).
>>> 
>>> I have a Win10 laptop running VirtualBox and multiple VMs of which
>>> only
>>> one runs at a time. As I complete a configuration I clone the last
>>> successful VM to take it to the next level.
>>> 
>>> The Goal is to be able to remote edit using VSC.
>>> 
>>> My config
>>> 
>>> Ubuntu 24.04lts
>>> Apache2
>>> PHP 8.3
>>> MySQL
>>> PHP-FPM
>>> 
>>> I think I have a complete PHP-FPM config, user is lamp, group is
>>> lamp.
>>> 
>>> PHP Info shows Server API FPM/FastCGI which I understand the config
>>> is
>>> correct.
>>> 
>>> I can access the server using VSC and am able to
>>> add/edit/delete/save
>>> code files.
>>> 
>>> My permissions and ownership is:
>>> 
>>> - sudo chown -R lamp:lamp /var/www/lamp.internal
>>> – sudo find /var/www/lamp.internal -type d -exec chmod 755 {} \;
>>> – sudo find /var/www/lamp.internal -type f -exec chmod 644 {} \;
>>> 
>>> When I run : http://lamp.internal/php-write-edit-delete.php it
>>> reports:
>>> 
>>> The file does not exist. It will be created shortly.
>>> 
>>> Error writing to the file.
>>> 
>>> Error appending to the file.
>>> 
>>> Error deleting the file.
>>> 
>>> ---
>>> 
>>> When I change permissions : sudo find /var/www/lamp.internal -type d
>>> 
>>> -exec chmod 777 {} \;
>>> 
>>> The script reports:
>>> 
>>> The file does not exist. It will be created shortly.
>>> 
>>> Successfully written to the file: 'test_file.txt'
>>> 
>>> Successfully appended content to the file: 'test_file.txt'
>>> File Content (After Modifying):
>>> 
>>> This is the initial content of the file.
>>> Appended content: 2024-12-05 16:37:21
>>> 
>>> Successfully deleted the file: 'test_file.txt'
>>> 
>>> ---
>>> 
>>> Interestingly I can edit files using VSC however I have difficulty
>>> running a script from a browser.
>>> 
>>> Any help much appreciated!!
>>> 
>>> Thanks!!
>>> 
>>> Keith
>>> 
>>> ---------------------------------------------------
>>> 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


More information about the PLUG-discuss mailing list