Skip to main content

MPM Pre_fork to Worker changes file permissions

Comments

8 comments

  • cPanelMichael
    here you have a description of the issue: - Removed -

    Hello, It looks like the output was moderated. Could you provide some more details about what was changed, ensuring to exclude any real domain names or identifying information about your server? Thank you.
    0
  • itmonitor
    Hello Michael, Sorry if this post is a bit long but I want to share all informatin I gathered since May, to help you fix the issue. Here you have the link to the descritpion of the issue - Removed Please Use Words to Explain Your Issue - . If this is moderated again, please google "Wordpress plugin installation: FTP credentials" by Christian Weiske. This MPM file permission issue happened to me in end May with another VPS server (Virtuozzo, Centos 6.9, Apache 2.4), after changing MPM. At the time, the hosting company informed that "We have corrected the issue by running a permission fix script and also by changing the PHP handler." ---- Reproducing the present Issue: 1. Before changing from Server MPM Prefork into MPM Worker, the Wordpress install, uninstall, update features were working without issue. 2. After changing into MPM Worker, somehow the server file permissions were changed and I when I try to install a plugin/update Wordpress I get the error described in detail in the above article: "To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host." Check here screenshot - Removed Please Attach Images To Your Posts - 3. Even when I fill in the credentials fields, and check the SFTP, it will not proceed to uninstall/install/update plugins and Wordpress. 4. I moved back to MPM Prefork, but the file issue persists. 5. Presently the server is set to MPM Event, but the file issue persists. 6. The hosting company has run a script to chwon the server files, it does not fix this issue. They do not remember which PHP handler modification solved the same issue back in May. --- The website is not broken and load quickly under 2.5s. Wordpress and the plugins are not able to write the files in the server. The article by Weiske proposes a fix
    define('FS_METHOD', 'direct');
    that is not working, at least for me. Even so, ideally when changing MPMs (Prefor, Worker, Event) the file permissions shoud not be modified in the server. Hope this information helps CPanel to fix this bug. If you need further testing, please, I am here to help you. Any help to solve this issue is welcome.
    0
  • cPanelMichael
    Hello, It seems more likely related to the PHP handler (e.g. suPHP, DSO, CGI) as opposed to MPM worker/prefork. Could you browse to "WHM >> MultiPHP Manager" and confirm which PHP handler is associated with the version of PHP utilized by the affected domain name? Thank you.
    0
  • itmonitor
    sure, here you have the screenshot diigo.com/item/image/5pj5q/ipn3 PHP7.0 is not associated to any handler. Which one should it be? EDIT: sorry, the website in question is running over PHP 5.6. The PHP 5.6 Handler is set to cgi.
    0
  • cPanelMichael
    EDIT: sorry, the website in question is running over PHP 5.6. The PHP 5.6 Handler is set to cgi.

    Hello, It's likely you used suPHP in the past. Try switching to the suPHP handler for PHP 5.6 to see if that helps address the issue. You can find more information about using suPHP at: PHP Handlers - EasyApache 4 - cPanel Documentation More about PHP Handlers - Documentation - cPanel Documentation Thank you.
    0
  • itmonitor
    Hello, the hosting company managed to solve the issue...by installing a backup from before the day I changed MPM from Perfork into Workers. Nobody can tell me why the MPM change affected the file permissions. I would need to enable the suPHP handler and change it, but this could bring back the file permission issue. I believe that when changing MPMs in the server this file permission issue should not happen.
    0
  • cPanelMichael
    Nobody can tell me why the MPM change affected the file permissions.

    I'm not seeing anything that shows permissions on existing files were changed (e.g. /path/to/file.php changing from 0644 to 0666 permissions). It looks like it's more so an issue where WordPress can not manipulate existing files or directories because of the change to the PHP handler. Feel free to open a support ticket if you'd like us to take a closer look at the affected system. Thank you.
    0
  • itmonitor
    It took me 15 days of research and tests in my spare time, but just found the right solution. I post the solution here to help others: When fine tuning Apache through EasyApache4 for improving website load speed, I had enabled mod_pagespeed. On enabling it, it will automatically disable mod_ruid2 and mod_cgi (and enable other two modules). When disabling mod_pagespeed, it will not re-enable mod_ruid2 automatically - it will re-enable only mod_cgi. Without mod_ruid2 Wordpress will request the FTP credentials. There is no need to hard code wp-config.php. Just enable mod_ruid2 manually, restart Apache and the FTP/file permission issue is solved. Wordpress and plugins now can be updated as usual and media uploaded to the Wordpress gallery. It works right away, at least on the server environment informed in my original post above. EDIT: I just checked that when changing from MPM Prefork into Worker, it will disable mod_ruid2. When reverting from Worker to Prefork it will not enable mod_ruid2, causing the issue described in this post. In both cases, the key is to enable mod_ruid2. Hope to have helped.
    0

Please sign in to leave a comment.