• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

Issue Download prompt instead of processing PHP code, after creating an Alias

AdrianC

Basic Pleskian
I tried to install Zabbix statistics on my Plesk (17.8.11), it creates an alias just like phpmyadmin does, but whenever I access the path (/zabbix) it opens a download prompt instead of processing the php code, I am not sure where to edit in order to make it process the php code.

My PHP info page on that server: phpinfo()

This is the file installation created inside /etc/httpd/conf.d/zabbix.conf

Code:
Alias /zabbix /usr/share/zabbix

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None

    <IfModule mod_authz_core.c>
      # Apache 2.4
      Require all granted
    </IfModule>

    <IfModule !mod_authz_core.c>
      # Apache 2.2
      Order allow,deny
      Allow from all
    </IfModule>

    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300

        # Removed in PHP 7
        php_value always_populate_raw_post_data -1

        php_flag session.auto_start off
        php_value mbstring.func_overload 0
        php_value date.timezone UTC
    </IfModule>

</Directory>

<Directory ~ "^/usr/share/zabbix/(conf|app|include|local)/">
    <IfModule mod_authz_core.c>
      # Apache 2.4
      Require all denied
    </IfModule>

    <IfModule !mod_authz_core.c>
      # Apache 2.2
      Order deny,allow
      Deny from all
    </IfModule>

    <files *.php>
      <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all denied
      </IfModule>

      <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
      </IfModule>

    </files>

    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
        SetHandler application/x-httpd-php
    </FilesMatch>


</Directory>
 
To simplify, I created a hello world file in /adr/alias/index.php and set this in a conf.d include file:

Code:
Alias /adr /adr/alias

<Directory "/adr/alias">

        <RequireAny>
        Require all granted
        </RequireAny>

</Directory>

I also tried setting folder and file owner same as my www user, e.g me : psacln
The result is the same, I get a download prompt of the code in plain text, and a "denied" unless I add the Require all granted.
 
Back
Top