Amod
Amod

Reputation: 283

How do I find out which process runs PHP? (Litespeed/Centos environment)

This may sound like a super naive question, but here's the scene:

  1. Have a got dedicated server running Centos 7 with multiphp and litespeed.
  2. Installed WHM/cPanel > then WordPress > then got a caching plugin running.
  3. Plugin throws error: WP Rocket cannot configure itself due to missing writing permissions.
  4. Developer says: "The owner / group has to be the same one that owns the process that runs PHP. It's rarely the same as the cPanel account owner, usually account owners will have root access and processes do not usually have root access for security."
  5. The owner/group of the folder/files is the same as cPanel account holder.

Now my question is: How do I solve this dilemma? What does the developer mean when he says "owner/group has to be the same one that owns the process that runs PHP".

How can the owner (of the cPanel account?) own the process (what process??) that runs PHP?

FYI: Of course, I got shell access. This is a staging server right now.

Upvotes: 1

Views: 783

Answers (1)

Eric
Eric

Reputation: 839

I assume you enabled SuEXEC for PHP on dedicated server. In this case, different accounts of user will running php with different permission.

You could check by command ps aux | lsphp. Output example:

jimmy    895363  0.5  0.0 423668 25380 ?        S    22:13   0:00 lsphp
jeff  895389  0.6  0.0 423668 25388 ?        S    22:13   0:00 lsphp

How to fix permission
Try /scripts/disablefileprotect, which should restore file permission for all users, set 711 on /home/$user and the mount point.

Upvotes: 1

Related Questions