• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Prevent PHP-FPM to execute .php? files

Pascal_Netenvie

Regular Pleskian
Server operating system version
Debian 11.7
Plesk version and microupdate number
18.0.52
Hi,
For security reasons i want to prevent PHP-FPM to execute file with extension php3|php4|php5|php7|php8 etc ...
Actually these files are executed.
How can i disable this please ?
 
In a one-liner in .htaccess for example:
RewriteRule ^your-directory/.*\.(php3|php4|php5|php7|php8)$ - [F,L,NC]
With your-directory = the start path to the files, this can also be just /.* or .*
 
Ok but there is no way to put this rule in apache server configuration ?
I have my own configuration file in /etc/apache2/conf-enabled/ and i added following lines in it but it seems to not work :

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule \.(php3|php4|php5|php7|php8)$ - [F,L,NC]
</IfModule>
 
Ok finally i used this and it work perfect :

Code:
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(php3|php4|php5|php7|php8)$">
Require all denied
</FilesMatch>
</IfModule>
</IfModule>
 
And finally i changed it to :


Code:
<IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    <FilesMatch "\.(php.)$">
      Require all denied
    </FilesMatch>
  </IfModule>
</IfModule>
 
Back
Top