PHP not invoked when DocumentRoot directive is added

Discussion in 'General' started by Spawnsworth, Sep 19, 2019.

  1. Spawnsworth

    Spawnsworth Member

    Hi,

    I have a strange problem with a website I am migrating from an old server. I've updated to the latest ISP Config version 3.1.15. When I add the new site and select PHP 5.6 (which I installed separately from the Default 7.2), I place an info.php file in the webroot which by default is:

    /var/www/example.com/web/info.php

    When I call this in my browser, it gives me the PHP info that I would expect to see, so it works.

    However, if I change my document root to be a couple of dirs lower, it no longer invokes PHP and instead displays the contents of the info.php file in text format.

    So by adding the following Apache directive to options:
    DocumentRoot /var/www/example.com/web/www/public/

    Then browsing to:
    http://example.com/info.php

    My browser displays the following:

    <?php

    // Show all information, defaults to INFO_ALL

    phpinfo();


    ?>


    But it should display the PHP information instead. Any ideas why this is happening just by changing the Document root? Thanks!
     
  2. Spawnsworth

    Spawnsworth Member

    Hi all,

    I found the solution to this after bouncing around the forums. The correct apache directive would be thus:

    DocumentRoot "{DOCROOT_CLIENT}/www/public"

    BINGO!
     
    till likes this.

Share This Page