Skip to main content

PHP ignoring modified document root

Comments

3 comments

  • cPanelMichael
    Hello @_jman, It looks like the culprit in your case is the syntax used in the individual account's PHP-FPM configuration file: /var/cpanel/userdata/username123/domain.com.php-fpm.yaml
    For instance, if you want to set the new document root as "/home/username123/test/public_html", then the contents of this file should look like this: --- _is_present: 1 php_admin_value_doc_root: { name: 'php_admin_value[doc_root]', value: /home/username123/test/public_html }
    Once you save the changes to this file, run the following commands: /scripts/php_fpm_config --rebuild /scripts/restartsrv_apache_php_fpm /scripts/restartsrv_httpd
    Let me know if this helps. Thank you.
    0
  • _jman
    Sorry for the delay in replying; got sidetracked with another project. That did the trick, thanks, all working now. Was that particular syntax documented anywhere? Just curious.
    0
  • cPanelMichael
    That did the trick, thanks, all working now. Was that particular syntax documented anywhere? Just curious.

    Hello @_jman, I'm glad to see that helped. That specific syntax isn't documented, but we do document the overall syntax requirements at: Additionally, we recently published a resource with information on how to manage php.ini directives with PHP-FPM that you may find helpful: Thank you.
    0

Please sign in to leave a comment.